Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

WIP: Input/Output toolbars #543

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,6 @@ list( APPEND SOURCES PRIVATE
list( APPEND SOURCES PRIVATE
toolbars/ControlToolBar.cpp
toolbars/ControlToolBar.h
toolbars/DeviceToolBar.cpp
toolbars/DeviceToolBar.h
toolbars/EditToolBar.cpp
toolbars/EditToolBar.h
toolbars/MeterToolBar.cpp
Expand Down
2 changes: 0 additions & 2 deletions src/Screenshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,11 +724,9 @@ void ScreenshotBigDialog::OnCaptureSomething(wxCommandEvent & event)
ScreenshotCommand::ktimer,
ScreenshotCommand::ktools,
ScreenshotCommand::ktransport,
ScreenshotCommand::kmeter,
ScreenshotCommand::kplaymeter,
ScreenshotCommand::krecordmeter,
ScreenshotCommand::kedit,
ScreenshotCommand::kdevice,
ScreenshotCommand::ktranscription,
ScreenshotCommand::kscrub,
ScreenshotCommand::ktrackpanel,
Expand Down
6 changes: 0 additions & 6 deletions src/commands/ScreenshotCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] =
{ XO("Timer") },
{ XO("Tools") },
{ XO("Transport") },
{ XO("Meter") },
{ wxT("PlayMeter"), XO("Play Meter") },
{ wxT("RecordMeter"), XO("Record Meter") },
{ XO("Edit") },
{ XO("Device") },
{ XO("Scrub") },
{ XO("Play-at-Speed") },
{ XO("Trackpanel") },
Expand Down Expand Up @@ -793,16 +791,12 @@ bool ScreenshotCommand::Apply(const CommandContext & context)
return CaptureToolbar(context, &toolManager, ToolsBarID, mFileName);
case ktransport:
return CaptureToolbar(context, &toolManager, TransportBarID, mFileName);
case kmeter:
return CaptureToolbar(context, &toolManager, MeterBarID, mFileName);
case krecordmeter:
return CaptureToolbar(context, &toolManager, RecordMeterBarID, mFileName);
case kplaymeter:
return CaptureToolbar(context, &toolManager, PlayMeterBarID, mFileName);
case kedit:
return CaptureToolbar(context, &toolManager, EditBarID, mFileName);
case kdevice:
return CaptureToolbar(context, &toolManager, DeviceBarID, mFileName);
case ktranscription:
return CaptureToolbar(context, &toolManager, TranscriptionBarID, mFileName);
case kscrub:
Expand Down
2 changes: 0 additions & 2 deletions src/commands/ScreenshotCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ class TENACITY_DLL_API ScreenshotCommand : public AudacityCommand
ktimer,
ktools,
ktransport,
kmeter,
kplaymeter,
krecordmeter,
kedit,
kdevice,
kscrub,
ktranscription,
ktrackpanel,
Expand Down
53 changes: 0 additions & 53 deletions src/menus/ExtraMenus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "../Project.h"
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"
#include "../toolbars/DeviceToolBar.h"

#include <wx/frame.h>

Expand All @@ -22,34 +21,6 @@ namespace ExtraActions {

struct Handler : CommandHandlerObject {

void OnInputDevice(const CommandContext &context)
{
auto &project = context.project;
auto &tb = DeviceToolBar::Get( project );
tb.ShowInputDialog();
}

void OnOutputDevice(const CommandContext &context)
{
auto &project = context.project;
auto &tb = DeviceToolBar::Get( project );
tb.ShowOutputDialog();
}

void OnInputChannels(const CommandContext &context)
{
auto &project = context.project;
auto &tb = DeviceToolBar::Get( project );
tb.ShowChannelsDialog();
}

void OnAudioHost(const CommandContext &context)
{
auto &project = context.project;
auto &tb = DeviceToolBar::Get( project );
tb.ShowHostDialog();
}

void OnFullScreen(const CommandContext &context)
{
auto &project = context.project;
Expand Down Expand Up @@ -79,16 +50,12 @@ static CommandHandlerObject &findCommandHandler(AudacityProject &) {
namespace {
using namespace MenuTable;

BaseItemSharedPtr ExtraDeviceMenu();

BaseItemSharedPtr ExtraMenu()
{
// Table of menu factories.
// TODO: devise a registration system instead.
static BaseItemSharedPtr extraItems{ Items( wxEmptyString,
Section( "Part1",
ExtraDeviceMenu()
),

Section( "Part2" )
) };
Expand All @@ -107,26 +74,6 @@ AttachedItem sAttachment1{
Shared( ExtraMenu() )
};

// Under /MenuBar/Optional/Extra/Part1
BaseItemSharedPtr ExtraDeviceMenu()
{
static BaseItemSharedPtr menu{
( FinderScope{ findCommandHandler },
Menu( wxT("Device"), XXO("De&vice"),
Command( wxT("InputDevice"), XXO("Change &Recording Device..."),
FN(OnInputDevice),
AudioIONotBusyFlag(), wxT("Shift+I") ),
Command( wxT("OutputDevice"), XXO("Change &Playback Device..."),
FN(OnOutputDevice),
AudioIONotBusyFlag(), wxT("Shift+O") ),
Command( wxT("AudioHost"), XXO("Change Audio &Host..."), FN(OnAudioHost),
AudioIONotBusyFlag(), wxT("Shift+H") ),
Command( wxT("InputChannels"), XXO("Change Recording Cha&nnels..."),
FN(OnInputChannels),
AudioIONotBusyFlag(), wxT("Shift+N") )
) ) };
return menu;
}

// Under /MenuBar/Optional/Extra/Part2
BaseItemSharedPtr ExtraMiscItems()
Expand Down
Loading