Audacity  2.3.1
Macros | Functions | Variables
ScreenshotCommand.cpp File Reference
#include "../Audacity.h"
#include "ScreenshotCommand.h"
#include "CommandTargets.h"
#include "../Project.h"
#include <wx/toplevel.h>
#include <wx/dcscreen.h>
#include <wx/dcmemory.h>
#include <wx/settings.h>
#include <wx/bitmap.h>
#include <wx/valgen.h>
#include "../Track.h"
#include "../TrackPanel.h"
#include "../toolbars/ToolManager.h"
#include "../toolbars/ToolBar.h"
#include "../toolbars/ControlToolBar.h"
#include "../toolbars/DeviceToolBar.h"
#include "../toolbars/EditToolBar.h"
#include "../toolbars/MeterToolBar.h"
#include "../toolbars/MixerToolBar.h"
#include "../toolbars/SelectionBar.h"
#include "../toolbars/ToolsToolBar.h"
#include "../toolbars/TranscriptionToolBar.h"
#include "../widgets/Ruler.h"
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "CommandContext.h"
#include "CommandManager.h"

Go to the source code of this file.

Macros

#define TRICKY_CAPTURE
 
#define CAPTURE_NYQUIST_TOO
 

Functions

void IdleHandler (wxIdleEvent &event)
 
static void Yield ()
 
void ExploreMenu (const CommandContext &context, wxMenu *pMenu, int Id, int depth)
 

Variables

static const IdentInterfaceSymbol kCaptureWhatStrings [ScreenshotCommand::nCaptureWhats]
 
static const IdentInterfaceSymbol kBackgroundStrings [ScreenshotCommand::nBackgrounds]
 

Macro Definition Documentation

#define CAPTURE_NYQUIST_TOO
#define TRICKY_CAPTURE

Function Documentation

void ExploreMenu ( const CommandContext context,
wxMenu *  pMenu,
int  Id,
int  depth 
)

Definition at line 342 of file ScreenshotCommand.cpp.

References Label.

344  {
345  static_cast<void>(Id);//compiler food.
346 
347  if( !pMenu )
348  return;
349 
350  wxMenuItemList list = pMenu->GetMenuItems();
351  size_t lcnt = list.GetCount();
352  wxMenuItem * item;
353  wxString Label;
354  wxString Accel;
355 
356  for (size_t lndx = 0; lndx < lcnt; lndx++) {
357  item = list.Item(lndx)->GetData();
358  Label = item->GetItemLabelText();
359  Accel = item->GetItemLabel();
360  if( Accel.Contains("\t") )
361  Accel = Accel.AfterLast('\t');
362  else
363  Accel = "";
364  if( item->IsSeparator() )
365  Label = "----";
366  int flags = 0;
367  if (item->IsSubMenu())
368  flags +=1;
369  if (item->IsCheck() && item->IsChecked())
370  flags +=2;
371 
372  if (item->IsSubMenu()) {
373  pMenu = item->GetSubMenu();
374  ExploreMenu( context, pMenu, item->GetId(), depth+1 );
375  }
376  }
377 }
void ExploreMenu(const CommandContext &context, wxMenu *pMenu, int Id, int depth)
void IdleHandler ( wxIdleEvent &  event)

Definition at line 131 of file ScreenshotCommand.cpp.

References ScreenshotCommand::CaptureWindowOnIdle(), and GetActiveProject().

Referenced by ScreenshotCommand::CaptureCommands(), and ScreenshotCommand::CapturePreferences().

131  {
132  wxWindow * pWin = dynamic_cast<wxWindow*>(event.GetEventObject());
133  wxASSERT( pWin );
134  pWin->Unbind(wxEVT_IDLE, IdleHandler);
135  CommandContext context( *GetActiveProject() );
136  // We have the relevant window, so go and capture it.
139 }
void CaptureWindowOnIdle(const CommandContext &context, wxWindow *pWin)
CommandContext provides addiitonal information to an 'Apply()' command. It provides the project...
static ScreenshotCommand * mpShooter
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:312
void IdleHandler(wxIdleEvent &event)
static void Yield ( )
static

Definition at line 198 of file ScreenshotCommand.cpp.

Referenced by ScreenshotCommand::Capture(), and ScreenshotCommand::CaptureToolbar().

199 {
200  int cnt;
201  for (cnt = 10; cnt && !wxTheApp->Yield(true); cnt--) {
202  wxMilliSleep(10);
203  }
204  wxMilliSleep(200);
205  for (cnt = 10; cnt && !wxTheApp->Yield(true); cnt--) {
206  wxMilliSleep(10);
207  }
208 }

Variable Documentation

const IdentInterfaceSymbol kBackgroundStrings[ScreenshotCommand::nBackgrounds]
static
Initial value:
=
{
{ XO("Blue") },
{ XO("White") },
{ XO("None") },
}
#define XO(s)
Definition: Internat.h:33

Definition at line 89 of file ScreenshotCommand.cpp.

Referenced by ScreenshotCommand::DefineParams(), and ScreenshotCommand::PopulateOrExchange().

const IdentInterfaceSymbol kCaptureWhatStrings[ScreenshotCommand::nCaptureWhats]
static