From 8aa9508c82f32efcf9c7c00e2c9e76268d4dddce Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 Feb 2008 22:43:18 +0000 Subject: [PATCH] Merge with 2.0-ongoing R3071. git-svn-id: svn://localhost/ardour2/branches/3.0@3073 d708f5d6-7413-0410-9779-e7cbd77b26cf --- ...-sae-de.bindings.in => SAE-de.bindings.in} | 697 +++++++------ gtk2_ardour/SConscript | 150 ++- gtk2_ardour/ardev_common.sh.in | 1 + gtk2_ardour/ardour-sae.menus | 8 +- gtk2_ardour/ardour.menus | 12 +- gtk2_ardour/ardour2_ui_sae.conf | 95 ++ gtk2_ardour/ardour3_ui_dark.rc.in | 192 ++-- gtk2_ardour/ardour3_ui_light.rc.in | 167 ++-- gtk2_ardour/ardour_ui.cc | 65 +- gtk2_ardour/ardour_ui.h | 11 +- gtk2_ardour/ardour_ui_dependents.cc | 42 +- gtk2_ardour/ardour_ui_dialogs.cc | 2 +- gtk2_ardour/ardour_ui_ed.cc | 6 +- gtk2_ardour/ardour_ui_options.cc | 8 + gtk2_ardour/au_pluginui.h | 24 +- gtk2_ardour/au_pluginui.mm | 249 +++-- gtk2_ardour/audio_clock.cc | 12 +- gtk2_ardour/audio_region_view.cc | 16 +- gtk2_ardour/audio_region_view.h | 2 +- gtk2_ardour/cocoacarbon.mm | 2 +- gtk2_ardour/editor.cc | 109 ++- gtk2_ardour/editor.h | 43 +- gtk2_ardour/editor_actions.cc | 6 + gtk2_ardour/editor_audio_import.cc | 309 ++++-- gtk2_ardour/editor_canvas.cc | 37 +- gtk2_ardour/editor_markers.cc | 19 +- gtk2_ardour/editor_mixer.cc | 1 - gtk2_ardour/editor_mouse.cc | 161 ++- gtk2_ardour/editor_ops.cc | 580 +++++++---- gtk2_ardour/editor_region_list.cc | 31 +- gtk2_ardour/editor_route_list.cc | 1 + gtk2_ardour/editor_rulers.cc | 4 +- gtk2_ardour/editor_selection.cc | 32 +- gtk2_ardour/engine_dialog.cc | 4 +- ...i.bindings.in => ergonomic-us.bindings.in} | 0 gtk2_ardour/generic_pluginui.cc | 2 +- gtk2_ardour/icons/fader_belt_h.png | Bin 0 -> 3320 bytes gtk2_ardour/icons/grabber_edit_point.png | Bin 0 -> 543 bytes gtk2_ardour/keyboard.cc | 210 +++- gtk2_ardour/keyboard.h | 10 + gtk2_ardour/keyeditor.cc | 22 +- gtk2_ardour/location_ui.cc | 16 +- gtk2_ardour/main.cc | 79 +- gtk2_ardour/mixer_strip.cc | 9 +- gtk2_ardour/mixer_strip.h | 1 + gtk2_ardour/mixer_ui.cc | 6 +- ...ur.bindings.in => mnemonic-us.bindings.in} | 20 +- gtk2_ardour/new_session_dialog.cc | 38 +- gtk2_ardour/option_editor.cc | 44 +- gtk2_ardour/option_editor.h | 10 +- gtk2_ardour/opts.cc | 2 +- gtk2_ardour/plugin_ui.cc | 81 +- gtk2_ardour/plugin_ui.h | 6 +- gtk2_ardour/processor_box.cc | 22 +- gtk2_ardour/public_editor.h | 3 +- gtk2_ardour/rhythm_ferret.cc | 2 +- gtk2_ardour/route_time_axis.cc | 77 +- gtk2_ardour/route_time_axis.h | 13 + gtk2_ardour/splash.cc | 27 +- gtk2_ardour/splash.h | 2 + gtk2_ardour/sync-menu.c | 921 ------------------ gtk2_ardour/sync-menu.h | 44 - gtk2_ardour/tape_region_view.cc | 6 +- gtk2_ardour/time_axis_view.cc | 31 +- gtk2_ardour/time_axis_view.h | 1 + gtk2_ardour/utils.cc | 33 +- gtk2_ardour/vst_pluginui.cc | 2 +- 67 files changed, 2417 insertions(+), 2421 deletions(-) rename gtk2_ardour/{ardour-sae-de.bindings.in => SAE-de.bindings.in} (93%) create mode 100644 gtk2_ardour/ardour2_ui_sae.conf rename gtk2_ardour/{ardour-sae-ansi.bindings.in => ergonomic-us.bindings.in} (100%) create mode 100644 gtk2_ardour/icons/fader_belt_h.png create mode 100644 gtk2_ardour/icons/grabber_edit_point.png rename gtk2_ardour/{ardour.bindings.in => mnemonic-us.bindings.in} (96%) delete mode 100644 gtk2_ardour/sync-menu.c delete mode 100644 gtk2_ardour/sync-menu.h diff --git a/gtk2_ardour/ardour-sae-de.bindings.in b/gtk2_ardour/SAE-de.bindings.in similarity index 93% rename from gtk2_ardour/ardour-sae-de.bindings.in rename to gtk2_ardour/SAE-de.bindings.in index 68f9b13b0b..e0758e5c04 100644 --- a/gtk2_ardour/ardour-sae-de.bindings.in +++ b/gtk2_ardour/SAE-de.bindings.in @@ -1,348 +1,399 @@ -; ardour GtkAccelMap rc-file -*- scheme -*- -; this file is an automated accelerator map dump +; ardour-2.2 GtkAccelMap rc-file -*- scheme -*- +; this file is a hand-edited map that is processed by scons +; to produce a real accelmap. ; -; (gtk_accel_path "/RegionList/RegionListSort" "") -(gtk_accel_path "/Common/Quit" "<%PRIMARY%>q") -(gtk_accel_path "/Common/Save" "<%PRIMARY%>s") -; (gtk_accel_path "/Editor/Pullup" "") -(gtk_accel_path "/Editor/zoom-to-session" "<%SECONDARY%>z") -; (gtk_accel_path "/JACK/JACKReconnect" "") -; (gtk_accel_path "/Editor/Autoconnect" "") -; (gtk_accel_path "/Editor/Edit" "") -(gtk_accel_path "/Editor/cycle-edit-point" "asciicircum") -(gtk_accel_path "/Editor/cycle-edit-point-with-marker" "<%SECONDARY%>asciicircum") -(gtk_accel_path "/Editor/toggle-edit-mode" "1") -(gtk_accel_path "/Editor/cycle-snap-mode" "2") -(gtk_accel_path "/Editor/cycle-snap-choice" "3") -; (gtk_accel_path "/redirectmenu/copy" "") -; (gtk_accel_path "/options/MeterFalloffFaster" "") + +;; punctuation + +(gtk_accel_path "/Transport/ToggleRoll" "space") (gtk_accel_path "/Transport/ToggleRollForgetCapture" "<%PRIMARY%>space") (gtk_accel_path "/Transport/record-roll" "<%TERTIARY%>space") -(gtk_accel_path "/Transport/Record" "<%TERTIARY%>r") -; (gtk_accel_path "/RegionList/SortByRegionLength" "") -; (gtk_accel_path "/options/MeterFalloffSlowest" "") -; (gtk_accel_path "/Editor/playhead-to-previous-region-sync" "") -; (gtk_accel_path "/redirectmenu/deactivate_all" "") -; (gtk_accel_path "/RegionList/SortByRegionPosition" "") -; (gtk_accel_path "/Editor/ZoomFocus" "") -(gtk_accel_path "/Editor/addExistingAudioFiles" "<%PRIMARY%>i") -; (gtk_accel_path "/options/MeterFalloffSlow" "") -; (gtk_accel_path "/RegionList/rlHide" "") -; (gtk_accel_path "/Main/Metering" "") -(gtk_accel_path "/Editor/playhead-to-next-region-boundary" "rightarrow") -(gtk_accel_path "/Editor/selected-marker-to-next-region-boundary" "<%PRIMARY%><%TERTIARY%>rightarrow") -; (gtk_accel_path "/Zoom/zoom-focus-playhead" "") -; (gtk_accel_path "/Editor/center-edit-cursor" "") -; (gtk_accel_path "/Editor/Monitoring" "") -; (gtk_accel_path "/redirectmenu/deactivate" "") -; (gtk_accel_path "/options/LatchedRecordEnable" "") -; (gtk_accel_path "/Transport/TogglePunchIn" "") -; (gtk_accel_path "/ShuttleActions/SetShuttleUnitsPercentage" "") -(gtk_accel_path "/Main/Close" "<%PRIMARY%>w") -(gtk_accel_path "/Main/New" "<%PRIMARY%>n") -(gtk_accel_path "/Editor/nudge-next-backward" "<%PRIMARY%>KP_Subtract") -; (gtk_accel_path "/Editor/EditSelectRangeOptions" "") -; (gtk_accel_path "/Transport/ToggleTimeMaster" "") -; (gtk_accel_path "/Snap/snap-to-thirds" "") -(gtk_accel_path "/Editor/align-regions-start-relative" "<%LEVEL4%>less") -(gtk_accel_path "/Editor/align-regions-start" "<%LEVEL4%><%SECONDARY%>less") -; (gtk_accel_path "/Main/Export" "<%PRIMARY%>e") -(gtk_accel_path "/Editor/jump-forward-to-mark" "<%PRIMARY%>KP_6") -; (gtk_accel_path "/Editor/Smpte30" "") -; (gtk_accel_path "/Editor/playhead-to-range-start" "") -; (gtk_accel_path "/Editor/Subframes" "") -; (gtk_accel_path "/Editor/Smpte2997drop" "") -(gtk_accel_path "/Main/AddTrackBus" "<%PRIMARY%><%TERTIARY%>n") + (gtk_accel_path "/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less") (gtk_accel_path "/Editor/align-regions-end-relative" "<%PRIMARY%>less") -; (gtk_accel_path "/JACK/JACKDisconnect" "") -; (gtk_accel_path "/options/MeterFalloffFast" "") -; (gtk_accel_path "/options/FileDataFormatFloat" "") -; (gtk_accel_path "/Snap/snap-to-region-end" "") -(gtk_accel_path "/Editor/edit-cursor-to-next-region-sync" "semicolon") -; (gtk_accel_path "/options/StopRecordingOnXrun" "") -; (gtk_accel_path "/RegionList/SortDescending" "") -; (gtk_accel_path "/options/DoNotRunPluginsWhileRecording" "") -; (gtk_accel_path "/Editor/PullupNone" "") -(gtk_accel_path "/MouseMode/set-mouse-mode-range" "r") -(gtk_accel_path "/Editor/jump-backward-to-mark" "<%PRIMARY%>KP_4") -; (gtk_accel_path "/Main/AudioFileFormatData" "") -; (gtk_accel_path "/options/MeterFalloffFastest" "") -(gtk_accel_path "/Editor/audition-at-mouse" "w") -(gtk_accel_path "/Transport/Forward" "<%PRIMARY%>rightarrow") -; (gtk_accel_path "/Snap/snap-to-smpte-seconds" "") -; (gtk_accel_path "/Snap/snap-to-smpte-frame" "") -; (gtk_accel_path "/Main/ExportSelection" "") -; (gtk_accel_path "/options/StopPluginsWithTransport" "") -(gtk_accel_path "/Editor/editor-paste" "<%PRIMARY%>v") -(gtk_accel_path "/Editor/scroll-tracks-down" "Page_Down") -(gtk_accel_path "/Editor/select-next-route" "downarrow") -(gtk_accel_path "/Editor/select-prev-route" "uparrow") -; (gtk_accel_path "/Snap/snap-to-smpte-minutes" "") -; (gtk_accel_path "/Main/FlushWastebasket" "") -(gtk_accel_path "/Editor/normalize-region" "n") -(gtk_accel_path "/Editor/nudge-forward" "h") -; (gtk_accel_path "/RegionList/SortByRegionEndinFile" "") -; (gtk_accel_path "/Editor/ToggleMeasureVisibility" "") -; (gtk_accel_path "/Zoom/zoom-focus-center" "") -(gtk_accel_path "/Editor/nudge-backward" "g") -; (gtk_accel_path "/options/LatchedSolo" "") -; (gtk_accel_path "/options/MeterHoldOff" "") -; (gtk_accel_path "/options/OutputAutoConnectMaster" "") -; (gtk_accel_path "/JACK/JACKLatency64" "") -(gtk_accel_path "/Editor/undo" "<%PRIMARY%>z") -(gtk_accel_path "/Editor/insert-region" "i") -; (gtk_accel_path "/Editor/center-playhead" "") -; (gtk_accel_path "/Snap/snap-to-region-start" "") -; (gtk_accel_path "/Editor/View" "") -; (gtk_accel_path "/Editor/Layering" "") -; (gtk_accel_path "/JACK/JACKLatency4096" "") -(gtk_accel_path "/Editor/scroll-tracks-up" "Page_Up") -(gtk_accel_path "/Editor/set-edit-point" "g") -; (gtk_accel_path "/Editor/Smpte30drop" "") -; (gtk_accel_path "/Zoom/zoom-focus-edit" "") -(gtk_accel_path "/Editor/playhead-to-previous-region-boundary" "leftarrow") -(gtk_accel_path "/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow") -; (gtk_accel_path "/Editor/EditCursorMovementOptions" "") -; (gtk_accel_path "/redirectmenu/activate_all" "") -; (gtk_accel_path "/redirectmenu/paste" "") -; (gtk_accel_path "/Editor/Smpte25" "") -; (gtk_accel_path "/options/RegionEquivalentsOverlap" "") -; (gtk_accel_path "/Main/MeteringFallOffRate" "") -; (gtk_accel_path "/options/UseHardwareMonitoring" "") -; (gtk_accel_path "/Editor/Smpte24" "") -; (gtk_accel_path "/Snap/snap-to-mark" "") -; (gtk_accel_path "/Editor/CrossfadesShort" "") -; (gtk_accel_path "/Editor/Smpte5994" "") -; (gtk_accel_path "/JACK/JACKLatency8192" "") -; (gtk_accel_path "/Editor/toggle-xfades-visible" "") -(gtk_accel_path "/Editor/extend-range-to-end-of-region" "rightanglebracket") -(gtk_accel_path "/Editor/start-range" "F1") -; (gtk_accel_path "/ShuttleActions/SetShuttleUnitsSemitones" "") -; (gtk_accel_path "/JACK/JACKLatency128" "") -; (gtk_accel_path "/Snap/snap-to-beat" "") -; (gtk_accel_path "/Editor/RegionEditOps" "") -; (gtk_accel_path "/Editor/snap-magnetic" "") -; (gtk_accel_path "/Editor/playhead-to-range-end" "") -(gtk_accel_path "/Editor/scroll-playhead-forward" "<%TERTIARY%>rightarrow") -(gtk_accel_path "/Editor/align-regions-sync-relative" "less") +(gtk_accel_path "/Editor/align-regions-start" "<%LEVEL4%><%SECONDARY%>less") +(gtk_accel_path "/Editor/align-regions-start-relative" "<%LEVEL4%>less") (gtk_accel_path "/Editor/align-regions-sync" "<%SECONDARY%>less") -; (gtk_accel_path "/Editor/EditSelectRegionOptions" "") -(gtk_accel_path "/Editor/crop" "c") -; (gtk_accel_path "/redirectmenu/newsend" "") -; (gtk_accel_path "/Editor/ToggleGeneric MIDISurfaceSubMenu" "") -; (gtk_accel_path "/Editor/MeterFalloff" "") -; (gtk_accel_path "/RegionList/rlRemove" "") -(gtk_accel_path "/Transport/GotoStart" "Home") -(gtk_accel_path "/Editor/select-all-before-edit-cursor" "<%TERTIARY%>Home") -(gtk_accel_path "/Editor/scroll-playhead-backward" "<%TERTIARY%>leftarrow") -(gtk_accel_path "/Editor/split-region" "y") -; (gtk_accel_path "/Transport/ToggleAutoInput" "") -; (gtk_accel_path "/Snap/snap-to-thirtyseconds" "") -; (gtk_accel_path "/Snap/snap-to-minutes" "") -; (gtk_accel_path "/Main/Windows" "") -; (gtk_accel_path "/Main/CleanupUnused" "") -; (gtk_accel_path "/redirectmenu/deselectall" "<%PRIMARY%><%TERTIARY%>a") -; (gtk_accel_path "/options/SoloViaBus" "") -; (gtk_accel_path "/RegionList/rlAudition" "") -(gtk_accel_path "/Editor/set-region-sync-position" "u") -; (gtk_accel_path "/Editor/PullupPlus4Plus1" "") -; (gtk_accel_path "/Snap/snap-to-region-boundary" "") -; (gtk_accel_path "/JACK/JACK" "") -(gtk_accel_path "/Editor/editor-cut" "<%PRIMARY%>x") -(gtk_accel_path "/Editor/editor-separate" "x") -; (gtk_accel_path "/RegionList/SortAscending" "") -; (gtk_accel_path "/Main/Help" "") -; (gtk_accel_path "/options/UseExternalMonitoring" "") -; (gtk_accel_path "/Editor/Smpte23976" "") -(gtk_accel_path "/Common/goto-editor" "<%PRIMARY%>e") -(gtk_accel_path "/Editor/select-all" "<%PRIMARY%>a") -(gtk_accel_path "/Editor/invert-selection" "<%TERTIARY%>i") -(gtk_accel_path "/Editor/nudge-next-forward" "<%PRIMARY%>KP_Add") -; (gtk_accel_path "/options/ShowSoloMutes" "") -; (gtk_accel_path "/Snap/snap-to-eighths" "") -(gtk_accel_path "/Editor/select-all-after-playhead" "<%TERTIARY%><%PRIMARY%>End") -(gtk_accel_path "/Common/ToggleMaximalEditor" "F11") -; (gtk_accel_path "/RegionList/SortBySourceFileLength" "") -; (gtk_accel_path "/Editor/Timecode" "") -; (gtk_accel_path "/Transport/PlaySelection" "") -; (gtk_accel_path "/Editor/PullupMinus4Minus1" "") -(gtk_accel_path "/Editor/select-all-after-edit-cursor" "<%TERTIARY%><%PRIMARY%>e") -; (gtk_accel_path "/RegionList/SortBySourceFileName" "") -(gtk_accel_path "/Editor/finish-range" "F2") -(gtk_accel_path "/Editor/select-range-between-cursors" "F16") -(gtk_accel_path "/Transport/Loop" "l") -; (gtk_accel_path "/Editor/CrossfadesFull" "") -(gtk_accel_path "/Editor/finish-add-range" "<%TERTIARY%><%PRIMARY%>KP_Up") -; (gtk_accel_path "/options/SendMTC" "") -; (gtk_accel_path "/Transport/TogglePunchOut" "") -(gtk_accel_path "/Editor/select-all-in-loop-range" "<%TERTIARY%>l") -(gtk_accel_path "/Editor/show-editor-mixer" "<%TERTIARY%>e") -; (gtk_accel_path "/options/SoloInPlace" "") -; (gtk_accel_path "/Main/Options" "") -; (gtk_accel_path "/options/MeterFalloffMedium" "") -(gtk_accel_path "/Editor/toggle-follow-playhead" "f") -; (gtk_accel_path "/Main/SaveTemplate" "") -(gtk_accel_path "/Transport/TransitionToRoll" "<%PRIMARY%>uparrow") -; (gtk_accel_path "/RegionList/SortByRegionStartinFile" "") -; (gtk_accel_path "/options/GainReduceFastTransport" "") -; (gtk_accel_path "/Common/ToggleInspector" "") -; (gtk_accel_path "/Transport/ToggleAutoPlay" "") -; (gtk_accel_path "/Editor/playhead-to-next-region-sync" "") -(gtk_accel_path "/Editor/edit-to-playhead" "<%SECONDARY%>Return") -; (gtk_accel_path "/Editor/LayerMoveAddHigher" "") -; (gtk_accel_path "/Editor/Smpte60" "") -(gtk_accel_path "/Main/Open" "<%PRIMARY%>o") -; (gtk_accel_path "/Zoom/zoom-focus-left" "") -; (gtk_accel_path "/Main/TransportOptions" "") -; (gtk_accel_path "/Main/ControlSurfaces" "") -; (gtk_accel_path "/options/FileHeaderFormatBWF" "") -; (gtk_accel_path "/Transport/ToggleAutoReturn" "") -; (gtk_accel_path "/Editor/Smpte2997" "") -; (gtk_accel_path "/Editor/ToggleWaveformVisibility" "") -(gtk_accel_path "/Editor/redo" "<%PRIMARY%>r") -(gtk_accel_path "/Main/ExportSession" "<%PRIMARY%>e") -; (gtk_accel_path "/options/InputAutoConnectPhysical" "") -; (gtk_accel_path "/Snap/snap-to-edit-cursor" "") -(gtk_accel_path "/Editor/temporal-zoom-in" "t") -; (gtk_accel_path "/JACK/Latency" "") -(gtk_accel_path "/Editor/edit-cursor-to-range-end" "<%TERTIARY%>F2") -; (gtk_accel_path "/redirectmenu/rename" "") -; (gtk_accel_path "/RegionList/rlShowAuto" "") -(gtk_accel_path "/Editor/select-all-before-playhead" "<%TERTIARY%>Home") -; (gtk_accel_path "/Main/Session" "") -(gtk_accel_path "/Editor/edit-cursor-to-range-start" "<%TERTIARY%>F1") -; (gtk_accel_path "/Main/AudioFileFormat" "") -; (gtk_accel_path "/Transport/Transport" "") -; (gtk_accel_path "/MouseMode/set-mouse-mode-timefx" "t") -; (gtk_accel_path "/RegionList/SortByRegionName" "") -; (gtk_accel_path "/Main/KeyMouse Actions" "") -(gtk_accel_path "/MouseMode/set-mouse-mode-gain" "g") -; (gtk_accel_path "/Snap/snap-to-frame" "") -; (gtk_accel_path "/Editor/SnapTo" "") -(gtk_accel_path "/Transport/TransitionToReverse" "<%PRIMARY%>downarrow") -; (gtk_accel_path "/Editor/Crossfades" "") -; (gtk_accel_path "/Editor/PullupPlus4" "") -; (gtk_accel_path "/Main/MeteringHoldTime" "") -; (gtk_accel_path "/Editor/PullupPlus1" "") -; (gtk_accel_path "/Editor/Smpte24976" "") -; (gtk_accel_path "/options/FileDataFormat24bit" "") -; (gtk_accel_path "/Editor/SnapMode" "") -(gtk_accel_path "/Common/ToggleOptionsEditor" "<%PRIMARY%>o") -; (gtk_accel_path "/Editor/PullupMinus4" "") -(gtk_accel_path "/Common/goto-mixer" "<%PRIMARY%>m") -; (gtk_accel_path "/RegionList/SortBySourceFileCreationDate" "") -; (gtk_accel_path "/redirectmenu/activate" "") -(gtk_accel_path "/Editor/extend-range-to-start-of-region" "leftanglebracket") -; (gtk_accel_path "/Editor/PullupMinus1" "") -; (gtk_accel_path "/Editor/snap-normal" "") -(gtk_accel_path "/Common/ToggleBigClock" "<%PRIMARY%>b") -(gtk_accel_path "/Common/ToggleKeyEditor" "<%PRIMARY%>k") -; (gtk_accel_path "/Snap/snap-to-asixteenthbeat" "") -(gtk_accel_path "/Editor/select-all-in-punch-range" "<%TERTIARY%>p") -; (gtk_accel_path "/redirectmenu/edit" "") -(gtk_accel_path "/Editor/duplicate-region" "d") -(gtk_accel_path "/Editor/multi-duplicate-region" "<%SECONDARY%>d") -; (gtk_accel_path "/JACK/JACKLatency2048" "") -; (gtk_accel_path "/Editor/ToggleWaveformsWhileRecording" "") -; (gtk_accel_path "/Zoom/zoom-focus-right" "") -(gtk_accel_path "/Editor/remove-last-capture" "<%PRIMARY%>Delete") -; (gtk_accel_path "/options/FileHeaderFormatWAVE" "") -(gtk_accel_path "/Transport/GotoZero" "KP_Insert") -(gtk_accel_path "/Editor/select-all-after-edit-cursor" "<%TERTIARY%>End") -; (gtk_accel_path "/redirectmenu/cut" "") -; (gtk_accel_path "/redirectmenu/newinsert" "") -; (gtk_accel_path "/options/UseMMC" "") -; (gtk_accel_path "/options/MeterFalloffOff" "") -;(gtk_accel_path "/MouseMode/set-mouse-mode-object" "o") -; (gtk_accel_path "/Editor/PullupMinus4Plus1" "") -; (gtk_accel_path "/Editor/MeterHold" "") -; (gtk_accel_path "/Snap/snap-to-cd-frame" "") -; (gtk_accel_path "/options/StopTransportAtEndOfSession" "") -; (gtk_accel_path "/Main/Cleanup" "") -(gtk_accel_path "/Main/Snapshot" "<%PRIMARY%><%TERTIARY%>s") -; (gtk_accel_path "/Transport/ToggleVideoSync" "") -(gtk_accel_path "/Transport/ToggleRoll" "space") -; (gtk_accel_path "/RegionList/SortBySourceFilesystem" "") -(gtk_accel_path "/Common/ToggleColorManager" "<%PRIMARY%>c") -; (gtk_accel_path "/Common/About" "") -; (gtk_accel_path "/JACK/JACKLatency32" "") -(gtk_accel_path "/Editor/playhead-to-edit" "Return") -; (gtk_accel_path "/options/FileHeaderFormatWAVE64" "") -(gtk_accel_path "/Editor/brush-at-mouse" "F3") -; (gtk_accel_path "/RegionList/rlShowAll" "") -(gtk_accel_path "/Transport/Rewind" "<%PRIMARY%>leftarrow") -; (gtk_accel_path "/RegionList/SortByRegionTimestamp" "") -; (gtk_accel_path "/options/VerifyRemoveLastCapture" "") -; (gtk_accel_path "/options/OutputAutoConnectPhysical" "") -; (gtk_accel_path "/options/SendMMC" "") -; (gtk_accel_path "/Editor/toggle-auto-xfades" "") -; (gtk_accel_path "/Main/AudioFileFormatHeader" "") -; (gtk_accel_path "/options/MeterHoldShort" "") -; (gtk_accel_path "/options/MeterHoldMedium" "") -(gtk_accel_path "/Editor/select-all-before-edit-cursor" "<%PRIMARY%>e") -; (gtk_accel_path "/Editor/Subframes80" "") -; (gtk_accel_path "/options/FileHeaderFormatCAF" "") -(gtk_accel_path "/Common/ToggleLocations" "<%PRIMARY%>l") -; (gtk_accel_path "/Editor/ToggleGeneric MIDISurface" "") -(gtk_accel_path "/Editor/editor-delete" "BackSpace") -; (gtk_accel_path "/JACK/JACKLatency256" "") -(gtk_accel_path "/Editor/select-all-between-cursors" "F16") -; (gtk_accel_path "/Editor/LayerAddHigher" "") -; (gtk_accel_path "/Editor/Solo" "") -; (gtk_accel_path "/JACK/JACKLatency1024" "") -; (gtk_accel_path "/Main/ExportRangeMarkers" "") -(gtk_accel_path "/Editor/set-playhead" "p") -; (gtk_accel_path "/Editor/toggle-xfades-active" "") -; (gtk_accel_path "/Snap/snap-to-bar" "") -; (gtk_accel_path "/Editor/LayerLaterHigher" "") -; (gtk_accel_path "/redirectmenu/selectall" "") -(gtk_accel_path "/Editor/editor-copy" "<%PRIMARY%>c") -; (gtk_accel_path "/Snap/snap-to-quarters" "") -(gtk_accel_path "/Editor/temporal-zoom-out" "r") -; (gtk_accel_path "/options/UseSoftwareMonitoring" "") -; (gtk_accel_path "/Editor/Subframes100" "") -(gtk_accel_path "/Editor/mute-unmute-region" "<%SECONDARY%>m") -(gtk_accel_path "/Editor/add-location-from-playhead" "m") -; (gtk_accel_path "/options/OutputAutoConnectManual" "") -; (gtk_accel_path "/Snap/snap-to-region-sync" "") +(gtk_accel_path "/Editor/align-regions-sync-relative" "less") + +(gtk_accel_path "/Editor/edit-cursor-to-next-region-sync" "semicolon") (gtk_accel_path "/Editor/edit-cursor-to-previous-region-sync" "apostrophe") -; (gtk_accel_path "/redirectmenu/clear" "") -; (gtk_accel_path "/Editor/ToggleGeneric MIDISurfaceFeedback" "") -; (gtk_accel_path "/Editor/PullupPlus4Minus1" "") -; (gtk_accel_path "/JACK/JACKLatency512" "") -(gtk_accel_path "/Main/Recent" "<%PRIMARY%><%TERTIARY%>o") -; (gtk_accel_path "/redirectmenu/newplugin" "") -; (gtk_accel_path "/options/InputAutoConnectManual" "") -; (gtk_accel_path "/options/MeterHoldLong" "") -; (gtk_accel_path "/Snap/snap-to-seconds" "") -(gtk_accel_path "/Editor/set-fade-in-length" "q") -(gtk_accel_path "/Editor/toggle-fade-in-active" "<%SECONDARY%>q") -(gtk_accel_path "/Editor/set-fade-out-length" "e") -(gtk_accel_path "/Editor/toggle-fade-out-active" "<%SECONDARY%>e") +(gtk_accel_path "/Editor/cycle-edit-point" "asciicircum") +(gtk_accel_path "/Editor/cycle-edit-point-with-marker" "<%SECONDARY%>asciicircum") + +(gtk_accel_path "/Editor/extend-range-to-end-of-region" "rightanglebracket") +(gtk_accel_path "/Editor/extend-range-to-start-of-region" "leftanglebracket") + +(gtk_accel_path "/Editor/set-loop-from-edit-range" "bracketright") +(gtk_accel_path "/Editor/set-loop-from-region" "<%PRIMARY%><%SECONDARY%>bracketright") +(gtk_accel_path "/Editor/loop-region" "<%PRIMARY%>bracketright") + +(gtk_accel_path "/Editor/set-punch-from-edit-range" "bracketleft") + (gtk_accel_path "/Editor/trim-from-start" "<%TERTIARY%>braceleft") (gtk_accel_path "/Editor/trim-to-end" "<%TERTIARY%>braceright") + +;; letters + +;; OBERE ZEILE + +(gtk_accel_path "/Editor/set-fade-in-length" "q") +(gtk_accel_path "/Common/Quit" "<%PRIMARY%>q") +(gtk_accel_path "/Editor/toggle-fade-in-active" "<%SECONDARY%>q") + +;; note that ctrl-w is special and consumed by the keyboard snooper + +(gtk_accel_path "/Editor/audition-at-mouse" "w") +(gtk_accel_path "/Main/Close" "<%PRIMARY%>w") +(gtk_accel_path "/Editor/set-fade-out-length" "e") +(gtk_accel_path "/Main/ExportSession" "<%PRIMARY%>e") +(gtk_accel_path "/Editor/select-all-before-edit-cursor" "<%PRIMARY%>e") +(gtk_accel_path "/Editor/toggle-fade-out-active" "<%SECONDARY%>e") +(gtk_accel_path "/Editor/show-editor-mixer" "<%TERTIARY%>e") +(gtk_accel_path "/Common/goto-editor" "<%WINDOW%>e") +(gtk_accel_path "/Editor/select-all-after-edit-cursor" "<%TERTIARY%><%PRIMARY%>e") +(gtk_accel_path "/MouseMode/set-mouse-mode-range" "r") +(gtk_accel_path "/Editor/redo" "<%PRIMARY%>r") +(gtk_accel_path "/Transport/Record" "<%TERTIARY%>r") +(gtk_accel_path "/Editor/temporal-zoom-out" "r") +(gtk_accel_path "/Editor/temporal-zoom-in" "t") +(gtk_accel_path "/Editor/split-region" "y") +(gtk_accel_path "/Editor/set-region-sync-position" "u") +(gtk_accel_path "/Editor/insert-region" "i") +(gtk_accel_path "/Editor/addExistingAudioFiles" "<%PRIMARY%>i") +(gtk_accel_path "/Editor/invert-selection" "<%TERTIARY%>i") +(gtk_accel_path "/Common/ToggleOptionsEditor" "<%WINDOW%>o") +(gtk_accel_path "/Main/Open" "<%PRIMARY%>o") +(gtk_accel_path "/Main/Recent" "<%PRIMARY%><%TERTIARY%>o") +(gtk_accel_path "/Editor/set-playhead" "p") +(gtk_accel_path "/Editor/select-all-in-punch-range" "<%TERTIARY%>p") + +;; MITTELZEILE + (gtk_accel_path "/Editor/trim-front" "a") +(gtk_accel_path "/Editor/select-all" "<%PRIMARY%>a") (gtk_accel_path "/Editor/trim-back" "s") +(gtk_accel_path "/Common/Save" "<%PRIMARY%>s") +(gtk_accel_path "/Main/Snapshot" "<%PRIMARY%><%TERTIARY%>s") +(gtk_accel_path "/Editor/duplicate-region" "d") +(gtk_accel_path "/Editor/multi-duplicate-region" "<%SECONDARY%>d") +(gtk_accel_path "/Editor/toggle-follow-playhead" "f") +(gtk_accel_path "/Editor/set-edit-point" "g") +(gtk_accel_path "/MouseMode/set-mouse-mode-gain" "g") +(gtk_accel_path "/Editor/nudge-backward" "g") +(gtk_accel_path "/Editor/nudge-forward" "h") +(gtk_accel_path "/Common/ToggleKeyEditor" "<%WINDOW%>k") +(gtk_accel_path "/Common/ToggleLocations" "<%WINDOW%>l") +(gtk_accel_path "/Transport/Loop" "l") +(gtk_accel_path "/Editor/select-all-in-loop-range" "<%TERTIARY%>l") + +;; UNTERE ZEILE + +(gtk_accel_path "/Editor/zoom-to-region" "z") +(gtk_accel_path "/Editor/undo" "<%PRIMARY%>z") +(gtk_accel_path "/Editor/zoom-to-session" "<%SECONDARY%>z") +(gtk_accel_path "/Editor/toggle-zoom" "<%TERTIARY%>z") +(gtk_accel_path "/Editor/editor-separate" "x") +(gtk_accel_path "/Editor/editor-cut" "<%PRIMARY%>x") +(gtk_accel_path "/Editor/crop" "c") +(gtk_accel_path "/Editor/editor-copy" "<%PRIMARY%>c") +(gtk_accel_path "/Common/ToggleColorManager" "<%WINDOW%>c") +(gtk_accel_path "/Editor/editor-paste" "<%PRIMARY%>v") +(gtk_accel_path "/Common/ToggleBigClock" "<%WINDOW%>b") +(gtk_accel_path "/Editor/normalize-region" "n") +(gtk_accel_path "/Main/New" "<%PRIMARY%>n") +(gtk_accel_path "/Main/AddTrackBus" "<%PRIMARY%><%TERTIARY%>n") +(gtk_accel_path "/Common/goto-mixer" "<%WINDOW%>m") +(gtk_accel_path "/Editor/add-location-from-playhead" "m") +(gtk_accel_path "/Editor/mute-unmute-region" "<%SECONDARY%>m") + +;; arrow keys, navigation etc. + +(gtk_accel_path "/Editor/playhead-to-edit" "Return") +(gtk_accel_path "/Editor/edit-to-playhead" "<%SECONDARY%>Return") +(gtk_accel_path "/Editor/editor-delete" "BackSpace") +(gtk_accel_path "/Editor/remove-last-capture" "<%PRIMARY%>Delete") + +(gtk_accel_path "/Editor/playhead-to-previous-region-boundary" "leftarrow") +(gtk_accel_path "/Transport/Rewind" "<%PRIMARY%>leftarrow") +(gtk_accel_path "/Editor/tab-to-transient-backwards" "<%SECONDARY%>leftarrow") +(gtk_accel_path "/Editor/nudge-playhead-backward" "<%TERTIARY%>leftarrow") +(gtk_accel_path "/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow") + +(gtk_accel_path "/Editor/playhead-to-next-region-boundary" "rightarrow") +(gtk_accel_path "/Transport/Forward" "<%PRIMARY%>rightarrow") +(gtk_accel_path "/Editor/tab-to-transient-forwards" "<%SECONDARY%>rightarrow") +(gtk_accel_path "/Editor/nudge-playhead-forward" "<%TERTIARY%>rightarrow") +(gtk_accel_path "/Editor/selected-marker-to-next-region-boundary" "<%PRIMARY%><%TERTIARY%>rightarrow") + +(gtk_accel_path "/Editor/scroll-tracks-down" "Page_Down") +(gtk_accel_path "/Editor/scroll-tracks-up" "Page_Up") + +(gtk_accel_path "/Transport/GotoEnd" "End") +(gtk_accel_path "/Editor/select-all-after-edit-cursor" "<%TERTIARY%>End") +(gtk_accel_path "/Editor/select-all-after-playhead" "<%TERTIARY%><%PRIMARY%>End") + +(gtk_accel_path "/Transport/GotoStart" "Home") +(gtk_accel_path "/Editor/select-all-before-edit-cursor" "<%TERTIARY%>Home") +(gtk_accel_path "/Editor/select-all-before-playhead" "<%TERTIARY%>Home") + +(gtk_accel_path "/Editor/select-prev-route" "uparrow") +(gtk_accel_path "/Transport/TransitionToRoll" "<%PRIMARY%>uparrow") +(gtk_accel_path "/Editor/select-next-route" "downarrow") +(gtk_accel_path "/Transport/TransitionToReverse" "<%PRIMARY%>downarrow") + +;; keypad + +(gtk_accel_path "/Editor/finish-add-range" "<%TERTIARY%><%PRIMARY%>KP_Up") (gtk_accel_path "/Editor/goto-mark-1" "KP_1") (gtk_accel_path "/Editor/goto-mark-2" "KP_2") (gtk_accel_path "/Editor/goto-mark-3" "KP_3") (gtk_accel_path "/Editor/goto-mark-4" "KP_4") +(gtk_accel_path "/Editor/jump-backward-to-mark" "<%PRIMARY%>KP_4") (gtk_accel_path "/Editor/goto-mark-5" "KP_5") (gtk_accel_path "/Editor/goto-mark-6" "KP_6") +(gtk_accel_path "/Editor/jump-forward-to-mark" "<%PRIMARY%>KP_6") (gtk_accel_path "/Editor/goto-mark-7" "KP_7") (gtk_accel_path "/Editor/goto-mark-8" "KP_8") (gtk_accel_path "/Editor/goto-mark-9" "KP_9") -(gtk_accel_path "/Transport/ToggleClick" "5") +(gtk_accel_path "/Editor/nudge-next-backward" "<%PRIMARY%>KP_Subtract") +(gtk_accel_path "/Editor/nudge-next-forward" "<%PRIMARY%>KP_Add") +(gtk_accel_path "/Transport/GotoZero" "KP_Insert") + +;; F-N keys + +(gtk_accel_path "/Editor/start-range" "F1") +(gtk_accel_path "/Editor/edit-cursor-to-range-start" "<%TERTIARY%>F1") +(gtk_accel_path "/Editor/finish-range" "F2") +(gtk_accel_path "/Editor/edit-cursor-to-range-end" "<%TERTIARY%>F2") +(gtk_accel_path "/Editor/brush-at-mouse" "F3") +(gtk_accel_path "/Common/ToggleMaximalEditor" "F11") +(gtk_accel_path "/Editor/select-all" "F14") +(gtk_accel_path "/Editor/invert-selection" "F15") +(gtk_accel_path "/Editor/select-all-between-cursors" "F16") + +;; numbers + +(gtk_accel_path "/Editor/toggle-edit-mode" "1") +(gtk_accel_path "/Editor/cycle-snap-mode" "2") +(gtk_accel_path "/Editor/cycle-snap-choice" "3") (gtk_accel_path "/Transport/ToggleAutoReturn" "4") +(gtk_accel_path "/Transport/ToggleClick" "5") (gtk_accel_path "/Editor/set-tempo-from-region" "9") (gtk_accel_path "/Editor/set-tempo-from-edit-range" "0") -(gtk_accel_path "/Transport/focus-on-clock" "KP_Divide") -(gtk_accel_path "/Editor/set-loop-from-edit-range" "bracketright") -(gtk_accel_path "/Editor/set-punch-from-edit-range" "bracketleft") -(gtk_accel_path "/Editor/set-loop-from-region" "<%PRIMARY%><%SECONDARY%>bracketright") -(gtk_accel_path "/Editor/loop-region" "<%PRIMARY%>bracketright") -(gtk_accel_path "/Editor/toggle-zoom" "<%TERTIARY%>z") -(gtk_accel_path "/Editor/zoom-to-region" "z") + +;; +;; unbound actions +;; + + +; (gtk_accel_path "/Common/About" "") +; (gtk_accel_path "/Common/ToggleInspector" "") +; (gtk_accel_path "/Editor/Autoconnect" "") +; (gtk_accel_path "/Editor/Crossfades" "") +; (gtk_accel_path "/Editor/CrossfadesFull" "") +; (gtk_accel_path "/Editor/CrossfadesShort" "") +; (gtk_accel_path "/Editor/Edit" "") +; (gtk_accel_path "/Editor/EditCursorMovementOptions" "") +; (gtk_accel_path "/Editor/EditSelectRangeOptions" "") +; (gtk_accel_path "/Editor/EditSelectRegionOptions" "") +; (gtk_accel_path "/Editor/LayerAddHigher" "") +; (gtk_accel_path "/Editor/LayerLaterHigher" "") +; (gtk_accel_path "/Editor/LayerMoveAddHigher" "") +; (gtk_accel_path "/Editor/Layering" "") +; (gtk_accel_path "/Editor/MeterFalloff" "") +; (gtk_accel_path "/Editor/MeterHold" "") +; (gtk_accel_path "/Editor/Monitoring" "") +; (gtk_accel_path "/Editor/Pullup" "") +; (gtk_accel_path "/Editor/PullupMinus1" "") +; (gtk_accel_path "/Editor/PullupMinus4" "") +; (gtk_accel_path "/Editor/PullupMinus4Minus1" "") +; (gtk_accel_path "/Editor/PullupMinus4Plus1" "") +; (gtk_accel_path "/Editor/PullupNone" "") +; (gtk_accel_path "/Editor/PullupPlus1" "") +; (gtk_accel_path "/Editor/PullupPlus4" "") +; (gtk_accel_path "/Editor/PullupPlus4Minus1" "") +; (gtk_accel_path "/Editor/PullupPlus4Plus1" "") +; (gtk_accel_path "/Editor/RegionEditOps" "") +; (gtk_accel_path "/Editor/Smpte23976" "") +; (gtk_accel_path "/Editor/Smpte24" "") +; (gtk_accel_path "/Editor/Smpte24976" "") +; (gtk_accel_path "/Editor/Smpte25" "") +; (gtk_accel_path "/Editor/Smpte2997" "") +; (gtk_accel_path "/Editor/Smpte2997drop" "") +; (gtk_accel_path "/Editor/Smpte30" "") +; (gtk_accel_path "/Editor/Smpte30drop" "") +; (gtk_accel_path "/Editor/Smpte5994" "") +; (gtk_accel_path "/Editor/Smpte60" "") +; (gtk_accel_path "/Editor/SnapMode" "") +; (gtk_accel_path "/Editor/SnapTo" "") +; (gtk_accel_path "/Editor/Solo" "") +; (gtk_accel_path "/Editor/Subframes" "") +; (gtk_accel_path "/Editor/Subframes100" "") +; (gtk_accel_path "/Editor/Subframes80" "") +; (gtk_accel_path "/Editor/Timecode" "") +; (gtk_accel_path "/Editor/ToggleGeneric MIDISurface" "") +; (gtk_accel_path "/Editor/ToggleGeneric MIDISurfaceFeedback" "") +; (gtk_accel_path "/Editor/ToggleGeneric MIDISurfaceSubMenu" "") +; (gtk_accel_path "/Editor/ToggleMeasureVisibility" "") +; (gtk_accel_path "/Editor/ToggleWaveformVisibility" "") +; (gtk_accel_path "/Editor/ToggleWaveformsWhileRecording" "") +; (gtk_accel_path "/Editor/View" "") +; (gtk_accel_path "/Editor/ZoomFocus" "") +; (gtk_accel_path "/Editor/center-edit-cursor" "") +; (gtk_accel_path "/Editor/center-playhead" "") +; (gtk_accel_path "/Editor/playhead-to-next-region-sync" "") +; (gtk_accel_path "/Editor/playhead-to-previous-region-sync" "") +; (gtk_accel_path "/Editor/playhead-to-range-end" "") +; (gtk_accel_path "/Editor/playhead-to-range-start" "") +; (gtk_accel_path "/Editor/snap-magnetic" "") +; (gtk_accel_path "/Editor/snap-normal" "") +; (gtk_accel_path "/Editor/toggle-auto-xfades" "") +; (gtk_accel_path "/Editor/toggle-xfades-active" "") +; (gtk_accel_path "/Editor/toggle-xfades-visible" "") +; (gtk_accel_path "/JACK/JACK" "") +; (gtk_accel_path "/JACK/JACKDisconnect" "") +; (gtk_accel_path "/JACK/JACKLatency1024" "") +; (gtk_accel_path "/JACK/JACKLatency128" "") +; (gtk_accel_path "/JACK/JACKLatency2048" "") +; (gtk_accel_path "/JACK/JACKLatency256" "") +; (gtk_accel_path "/JACK/JACKLatency32" "") +; (gtk_accel_path "/JACK/JACKLatency4096" "") +; (gtk_accel_path "/JACK/JACKLatency512" "") +; (gtk_accel_path "/JACK/JACKLatency64" "") +; (gtk_accel_path "/JACK/JACKLatency8192" "") +; (gtk_accel_path "/JACK/JACKReconnect" "") +; (gtk_accel_path "/JACK/Latency" "") +; (gtk_accel_path "/Main/AudioFileFormat" "") +; (gtk_accel_path "/Main/AudioFileFormatData" "") +; (gtk_accel_path "/Main/AudioFileFormatHeader" "") +; (gtk_accel_path "/Main/Cleanup" "") +; (gtk_accel_path "/Main/CleanupUnused" "") +; (gtk_accel_path "/Main/ControlSurfaces" "") +; (gtk_accel_path "/Main/Export" "<%PRIMARY%>e") +; (gtk_accel_path "/Main/ExportRangeMarkers" "") +; (gtk_accel_path "/Main/ExportSelection" "") +; (gtk_accel_path "/Main/FlushWastebasket" "") +; (gtk_accel_path "/Main/Help" "") +; (gtk_accel_path "/Main/KeyMouse Actions" "") +; (gtk_accel_path "/Main/Metering" "") +; (gtk_accel_path "/Main/MeteringFallOffRate" "") +; (gtk_accel_path "/Main/MeteringHoldTime" "") +; (gtk_accel_path "/Main/Options" "") +; (gtk_accel_path "/Main/SaveTemplate" "") +; (gtk_accel_path "/Main/Session" "") +; (gtk_accel_path "/Main/TransportOptions" "") +; (gtk_accel_path "/Main/Windows" "") +; (gtk_accel_path "/MouseMode/set-mouse-mode-timefx" "t") +; (gtk_accel_path "/RegionList/RegionListSort" "") +; (gtk_accel_path "/RegionList/SortAscending" "") +; (gtk_accel_path "/RegionList/SortByRegionEndinFile" "") +; (gtk_accel_path "/RegionList/SortByRegionLength" "") +; (gtk_accel_path "/RegionList/SortByRegionName" "") +; (gtk_accel_path "/RegionList/SortByRegionPosition" "") +; (gtk_accel_path "/RegionList/SortByRegionStartinFile" "") +; (gtk_accel_path "/RegionList/SortByRegionTimestamp" "") +; (gtk_accel_path "/RegionList/SortBySourceFileCreationDate" "") +; (gtk_accel_path "/RegionList/SortBySourceFileLength" "") +; (gtk_accel_path "/RegionList/SortBySourceFileName" "") +; (gtk_accel_path "/RegionList/SortBySourceFilesystem" "") +; (gtk_accel_path "/RegionList/SortDescending" "") +; (gtk_accel_path "/RegionList/rlAudition" "") +; (gtk_accel_path "/RegionList/rlHide" "") +; (gtk_accel_path "/RegionList/rlRemove" "") +; (gtk_accel_path "/RegionList/rlShowAll" "") +; (gtk_accel_path "/RegionList/rlShowAuto" "") +; (gtk_accel_path "/ShuttleActions/SetShuttleUnitsPercentage" "") +; (gtk_accel_path "/ShuttleActions/SetShuttleUnitsSemitones" "") +; (gtk_accel_path "/Snap/snap-to-asixteenthbeat" "") +; (gtk_accel_path "/Snap/snap-to-bar" "") +; (gtk_accel_path "/Snap/snap-to-beat" "") +; (gtk_accel_path "/Snap/snap-to-cd-frame" "") +; (gtk_accel_path "/Snap/snap-to-edit-cursor" "") +; (gtk_accel_path "/Snap/snap-to-eighths" "") +; (gtk_accel_path "/Snap/snap-to-frame" "") +; (gtk_accel_path "/Snap/snap-to-mark" "") +; (gtk_accel_path "/Snap/snap-to-minutes" "") +; (gtk_accel_path "/Snap/snap-to-quarters" "") +; (gtk_accel_path "/Snap/snap-to-region-boundary" "") +; (gtk_accel_path "/Snap/snap-to-region-end" "") +; (gtk_accel_path "/Snap/snap-to-region-start" "") +; (gtk_accel_path "/Snap/snap-to-region-sync" "") +; (gtk_accel_path "/Snap/snap-to-seconds" "") +; (gtk_accel_path "/Snap/snap-to-smpte-frame" "") +; (gtk_accel_path "/Snap/snap-to-smpte-minutes" "") +; (gtk_accel_path "/Snap/snap-to-smpte-seconds" "") +; (gtk_accel_path "/Snap/snap-to-thirds" "") +; (gtk_accel_path "/Snap/snap-to-thirtyseconds" "") +; (gtk_accel_path "/Transport/PlaySelection" "") +; (gtk_accel_path "/Transport/ToggleAutoInput" "") +; (gtk_accel_path "/Transport/ToggleAutoPlay" "") +; (gtk_accel_path "/Transport/ToggleAutoReturn" "") +; (gtk_accel_path "/Transport/TogglePunchIn" "") +; (gtk_accel_path "/Transport/TogglePunchOut" "") +; (gtk_accel_path "/Transport/ToggleTimeMaster" "") +; (gtk_accel_path "/Transport/ToggleVideoSync" "") +; (gtk_accel_path "/Transport/Transport" "") +; (gtk_accel_path "/Zoom/zoom-focus-center" "") +; (gtk_accel_path "/Zoom/zoom-focus-edit" "") +; (gtk_accel_path "/Zoom/zoom-focus-left" "") +; (gtk_accel_path "/Zoom/zoom-focus-playhead" "") +; (gtk_accel_path "/Zoom/zoom-focus-right" "") +; (gtk_accel_path "/options/DoNotRunPluginsWhileRecording" "") +; (gtk_accel_path "/options/FileDataFormat24bit" "") +; (gtk_accel_path "/options/FileDataFormatFloat" "") +; (gtk_accel_path "/options/FileHeaderFormatBWF" "") +; (gtk_accel_path "/options/FileHeaderFormatCAF" "") +; (gtk_accel_path "/options/FileHeaderFormatWAVE" "") +; (gtk_accel_path "/options/FileHeaderFormatWAVE64" "") +; (gtk_accel_path "/options/GainReduceFastTransport" "") +; (gtk_accel_path "/options/InputAutoConnectManual" "") +; (gtk_accel_path "/options/InputAutoConnectPhysical" "") +; (gtk_accel_path "/options/LatchedRecordEnable" "") +; (gtk_accel_path "/options/LatchedSolo" "") +; (gtk_accel_path "/options/MeterFalloffFast" "") +; (gtk_accel_path "/options/MeterFalloffFaster" "") +; (gtk_accel_path "/options/MeterFalloffFastest" "") +; (gtk_accel_path "/options/MeterFalloffMedium" "") +; (gtk_accel_path "/options/MeterFalloffOff" "") +; (gtk_accel_path "/options/MeterFalloffSlow" "") +; (gtk_accel_path "/options/MeterFalloffSlowest" "") +; (gtk_accel_path "/options/MeterHoldLong" "") +; (gtk_accel_path "/options/MeterHoldMedium" "") +; (gtk_accel_path "/options/MeterHoldOff" "") +; (gtk_accel_path "/options/MeterHoldShort" "") +; (gtk_accel_path "/options/OutputAutoConnectManual" "") +; (gtk_accel_path "/options/OutputAutoConnectMaster" "") +; (gtk_accel_path "/options/OutputAutoConnectPhysical" "") +; (gtk_accel_path "/options/RegionEquivalentsOverlap" "") +; (gtk_accel_path "/options/SendMMC" "") +; (gtk_accel_path "/options/SendMTC" "") +; (gtk_accel_path "/options/ShowSoloMutes" "") +; (gtk_accel_path "/options/SoloInPlace" "") +; (gtk_accel_path "/options/SoloViaBus" "") +; (gtk_accel_path "/options/StopPluginsWithTransport" "") +; (gtk_accel_path "/options/StopRecordingOnXrun" "") +; (gtk_accel_path "/options/StopTransportAtEndOfSession" "") +; (gtk_accel_path "/options/UseExternalMonitoring" "") +; (gtk_accel_path "/options/UseHardwareMonitoring" "") +; (gtk_accel_path "/options/UseMMC" "") +; (gtk_accel_path "/options/UseSoftwareMonitoring" "") +; (gtk_accel_path "/options/VerifyRemoveLastCapture" "") +; (gtk_accel_path "/redirectmenu/activate" "") +; (gtk_accel_path "/redirectmenu/activate_all" "") +; (gtk_accel_path "/redirectmenu/clear" "") +; (gtk_accel_path "/redirectmenu/copy" "") +; (gtk_accel_path "/redirectmenu/cut" "") +; (gtk_accel_path "/redirectmenu/deactivate" "") +; (gtk_accel_path "/redirectmenu/deactivate_all" "") +; (gtk_accel_path "/redirectmenu/deselectall" "<%PRIMARY%><%TERTIARY%>a") +; (gtk_accel_path "/redirectmenu/edit" "") +; (gtk_accel_path "/redirectmenu/newinsert" "") +; (gtk_accel_path "/redirectmenu/newplugin" "") +; (gtk_accel_path "/redirectmenu/newsend" "") +; (gtk_accel_path "/redirectmenu/paste" "") +; (gtk_accel_path "/redirectmenu/rename" "") +; (gtk_accel_path "/redirectmenu/selectall" "") +;(gtk_accel_path "/MouseMode/set-mouse-mode-object" "o") diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript index 7a07fdd859..d6d7f987dd 100644 --- a/gtk2_ardour/SConscript +++ b/gtk2_ardour/SConscript @@ -94,7 +94,6 @@ au_pluginui.mm """) gtkosx_files=Split(""" -sync-menu.c cocoacarbon.mm """) @@ -323,74 +322,66 @@ if gtkardour['IS_OSX']: # # OS X font rendering is different even with X11 # - my_font_dict['%FONT_TINY%'] = 'Lucida Grande 7' - my_font_dict['%FONT_SMALLERER%'] = 'Lucida Grande 8' - my_font_dict['%FONT_SMALLER%'] = 'Lucida Grande 9' - my_font_dict['%FONT_SMALL%'] = 'Lucida Grande 10' - my_font_dict['%FONT_NORMAL%'] = 'Lucida Grande 11' - my_font_dict['%FONT_BIG%'] = 'Lucida Grande 12' - my_font_dict['%FONT_BIGGER%'] = 'Lucida Grande 14' - my_font_dict['%FONT_LARGE%'] = 'Lucida Grande 18' - my_font_dict['%FONT_LARGER%'] = 'Lucida Grande 28' - my_font_dict['%FONT_HUGER%'] = 'Lucida Grande 36' - my_font_dict['%FONT_MASSIVE%'] = 'Lucida Grande 60' - my_font_dict['%FONT_BOLD_TINY%'] = 'Lucida Grande bold 7' - my_font_dict['%FONT_BOLD_SMALLER%'] = 'Lucida Grande bold 9' - my_font_dict['%FONT_BOLD_SMALL%'] = 'Lucida Grande bold 10' - my_font_dict['%FONT_BOLD_NORMAL%'] = 'Lucida Grande bold 11' - my_font_dict['%FONT_BOLD_BIG%'] = 'Lucida Grande bold 13' - my_font_dict['%FONT_BOLD_BIGGER%'] = 'Lucida Grande bold 14' - my_font_dict['%FONT_BOLD_LARGE%'] = 'Lucida Grande bold 20' - my_font_dict['%FONT_BOLD_LARGER%'] = 'Lucida Grande bold 25' - my_font_dict['%FONT_BOLD_HUGER%'] = 'Lucida Grande bold 36' - my_font_dict['%FONT_BOLD_MASSIVE%'] = 'Lucida Grande bold 60' - my_font_dict['%FONT_ITALIC_TINY%'] = 'Lucida Grande italic 7' - my_font_dict['%FONT_ITALIC_SMALLER%'] = 'Lucida Grande italic 9' - my_font_dict['%FONT_ITALIC_SMALL%'] = 'Lucida Grande italic 10' - my_font_dict['%FONT_ITALIC_NORMAL%'] = 'Lucida Grande italic 11' - my_font_dict['%FONT_ITALIC_BIG%'] = 'Lucida Grande italic 15' - my_font_dict['%FONT_ITALIC_BIGGER%'] = 'Lucida Grande italic 16' - my_font_dict['%FONT_ITALIC_LARGE%'] = 'Lucida Grande italic 20' - my_font_dict['%FONT_ITALIC_LARGER%'] = 'Lucida Grande italic 28' - my_font_dict['%FONT_ITALIC_HUGER%'] = 'Lucida Grande italic 36' - my_font_dict['%FONT_ITALIC_MASSIVE%'] = 'Lucida Grande italic 60' + + font_sizes = { + 'TINY' : '7', + 'SMALLER' : '9', + 'SMALL' : '10', + 'NORMAL' : '11', + 'BIG' : '12', + 'BIGGER' : '14', + 'LARGE' : '18', + 'LARGER' : '28', + 'HUGER' : '36', + 'MASSIVE' : '60' + } + basefont = "Lucida Grande" + else: # # Linux/X11 font rendering # - my_font_dict['%FONT_TINY%'] = 'sans 4' - my_font_dict['%FONT_SMALLERER%'] = 'sans 6' - my_font_dict['%FONT_SMALLER%'] = 'sans 6' - my_font_dict['%FONT_SMALL%'] = 'sans 7' - my_font_dict['%FONT_NORMAL%'] = 'sans 8' - my_font_dict['%FONT_BIG%'] = 'sans 12' - my_font_dict['%FONT_BIGGER%'] = 'sans 14' - my_font_dict['%FONT_LARGE%'] = 'sans 18' - my_font_dict['%FONT_LARGER%'] = 'sans 24' - my_font_dict['%FONT_HUGER%'] = 'sans 34' - my_font_dict['%FONT_MASSIVE%'] = 'sans 60' - my_font_dict['%FONT_BOLD_TINY%'] = 'sans bold 4' - my_font_dict['%FONT_BOLD_SMALLER%'] = 'sans bold 6' - my_font_dict['%FONT_BOLD_SMALL%'] = 'sans bold 7' - my_font_dict['%FONT_BOLD_NORMAL%'] = 'sans bold 8' - my_font_dict['%FONT_BOLD_BIG%'] = 'sans bold 12' - my_font_dict['%FONT_BOLD_BIGGER%'] = 'sans bold 14' - my_font_dict['%FONT_BOLD_LARGE%'] = 'sans bold 18' - my_font_dict['%FONT_BOLD_LARGER%'] = 'sans bold 24' - my_font_dict['%FONT_BOLD_HUGE%'] = 'sans bold 25' - my_font_dict['%FONT_BOLD_HUGER%'] = 'sans bold 34' - my_font_dict['%FONT_BOLD_MASSIVE%'] = 'sans bold 60' - my_font_dict['%FONT_ITALIC_TINY%'] = 'sans italic 4' - my_font_dict['%FONT_ITALIC_SMALLER%'] = 'sans italic 6' - my_font_dict['%FONT_ITALIC_SMALL%'] = 'sans italic 7' - my_font_dict['%FONT_ITALIC_NORMAL%'] = 'sans italic 8' - my_font_dict['%FONT_ITALIC_BIG%'] = 'sans italic 12' - my_font_dict['%FONT_ITALIC_BIGGER%'] = 'sans italic 14' - my_font_dict['%FONT_ITALIC_LARGE%'] = 'sans italic 18' - my_font_dict['%FONT_ITALIC_LARGER%'] = 'sans italic 24' - my_font_dict['%FONT_ITALIC_HUGE%'] = 'sans italic 25' - my_font_dict['%FONT_ITALIC_HUGER%'] = 'sans italic 34' - my_font_dict['%FONT_ITALIC_MASSIVE%'] = 'sans italic 60' + + if gtkardour['OLDFONTS']: + font_sizes = { + 'TINY' : '4', + 'SMALLER' : '6', + 'SMALL' : '7', + 'NORMAL' : '8', + 'BIG' : '12', + 'BIGGER' : '14', + 'LARGE' : '18', + 'LARGER' : '24', + 'HUGER' : '34', + 'MASSIVE' : '60' + } + else: + font_sizes = { + 'TINY' : '6', + 'SMALLER' : '8', + 'SMALL' : '9', + 'NORMAL' : '10', + 'BIG' : '14', + 'BIGGER' : '16', + 'LARGE' : '18', + 'LARGER' : '24', + 'HUGER' : '34', + 'MASSIVE' : '60' + } + + basefont = "sans" + +for style in ['', 'BOLD', 'ITALIC']: + for sizename,points in font_sizes.iteritems(): + if (len (style)): + key = "_".join (['FONT',style,sizename]) + fontstyle = " ".join ([basefont,style.lower(),points]) + else: + key = "_".join (['FONT',sizename]) + fontstyle = " ".join ([basefont,points]) + + key = '%' + key + '%' + my_font_dict[key] = fontstyle ardour_dark_theme = env.SubstInFile ('ardour3_ui_dark.rc', 'ardour3_ui_dark.rc.in', SUBST_DICT = my_font_dict) ardour_light_theme = env.SubstInFile ('ardour3_ui_light.rc', 'ardour3_ui_light.rc.in', SUBST_DICT = my_font_dict) @@ -405,13 +396,17 @@ keybindings_dict = { } if gtkardour['GTKOSX'] and gtkardour['NATIVE_OSX_KEYS']: # - # Command(Mod1), Alt(Mod5), Ctrl, Shift + # Command(Meta), Alt(Mod1), Ctrl, Shift + # **** as of february 4th 2008, OUR VERSION OF ***** + # Gtk/Quartz maps: + # NSCommand (aka "Command" aka "Apple" aka "Cauliflower") -> Meta + # NSAlternate (aka "Option") -> Mod1 # - keybindings_dict['%PRIMARY%'] = 'Mod5' - keybindings_dict['%SECONDARY%'] = 'Alt' + keybindings_dict['%PRIMARY%'] = 'Meta' + keybindings_dict['%SECONDARY%'] = 'Mod1' keybindings_dict['%TERTIARY%'] = 'Shift' keybindings_dict['%LEVEL4%'] = 'Ctrl' - keybindings_dict['%WINDOW%'] = 'Mod5' + keybindings_dict['%WINDOW%'] = 'Mod1' else: # # Ctrl, Alt, Shift, Mod3(Meta) @@ -422,9 +417,10 @@ else: keybindings_dict['%LEVEL4%'] = 'Mod2' keybindings_dict['%WINDOW%'] = 'Alt' -ardourbindings = env.SubstInFile ('ardour.bindings', 'ardour.bindings.in', SUBST_DICT = keybindings_dict); -ardoursaeDEbindings = env.SubstInFile ('ardour-sae-de.bindings', 'ardour-sae-de.bindings.in', SUBST_DICT = keybindings_dict); -ardoursaeANSIbindings = env.SubstInFile ('ardour-sae-ansi.bindings', 'ardour-sae-ansi.bindings.in', SUBST_DICT = keybindings_dict); +for b in [ 'SAE-de', 'mnemonic-us', 'ergonomic-us' ]: + target_file = b + '.bindings' + src_file = target_file + '.in' + Default (env.SubstInFile (target_file, src_file, SUBST_DICT = keybindings_dict)) my_subst_dict['%INSTALL_PREFIX%'] = final_prefix my_subst_dict['%LIBDIR%'] = env['LIBDIR'] @@ -436,9 +432,6 @@ env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755)) ardourdev = env.SubstInFile ('ardev_common.sh','ardev_common.sh.in', SUBST_DICT = my_subst_dict); env.AddPostAction (ardourdev, Chmod ('$TARGET', 0755)) -Default(ardourbindings) -Default(ardoursaeDEbindings) -Default(ardoursaeANSIbindings) Default(ardourdev) Default(ardoursh) Default(ardour_dark_theme) @@ -468,11 +461,12 @@ if env['NLS']: # configuration files env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), ardour_dark_theme)) env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), ardour_light_theme)) +env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour3_ui_default.conf')) env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), 'ardour.menus')) env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), 'ardour-sae.menus')) -env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), 'ardour.bindings')) -env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), 'ardour-sae-ansi.bindings')) -env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), 'ardour-sae-de.bindings')) +env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ergonomic-us.bindings')) +env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'mnemonic-us.bindings')) +env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'SAE-de.bindings')) # data files env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3'), 'splash.png')) env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3', 'pixmaps'), pixmap_files)) diff --git a/gtk2_ardour/ardev_common.sh.in b/gtk2_ardour/ardev_common.sh.in index b259eb3087..b44eb9c815 100644 --- a/gtk2_ardour/ardev_common.sh.in +++ b/gtk2_ardour/ardev_common.sh.in @@ -3,6 +3,7 @@ cd `dirname "$0"`/.. #export G_DEBUG=fatal_criticals export ARDOUR_PATH=gtk2_ardour/icons:gtk2_ardour/pixmaps:gtk2_ardour:. +export ARDOUR_DATA_PATH=gtk2_ardour:. export GTK_PATH=libs/clearlooks export VAMP_PATH=libs/vamp-plugins:$VAMP_PATH diff --git a/gtk2_ardour/ardour-sae.menus b/gtk2_ardour/ardour-sae.menus index d9c4f1798f..16f00955f3 100644 --- a/gtk2_ardour/ardour-sae.menus +++ b/gtk2_ardour/ardour-sae.menus @@ -43,6 +43,11 @@ + + + + + @@ -61,7 +66,6 @@ - @@ -143,6 +147,7 @@ + @@ -235,6 +240,7 @@ + diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus index 4c5439b68c..9387c1eb3e 100644 --- a/gtk2_ardour/ardour.menus +++ b/gtk2_ardour/ardour.menus @@ -46,6 +46,8 @@ + + @@ -66,7 +68,7 @@ - + @@ -76,6 +78,7 @@ + @@ -118,6 +121,8 @@ + + @@ -172,9 +177,7 @@ - - @@ -198,8 +201,6 @@ - - @@ -433,6 +434,7 @@ + diff --git a/gtk2_ardour/ardour2_ui_sae.conf b/gtk2_ardour/ardour2_ui_sae.conf new file mode 100644 index 0000000000..b9fac38909 --- /dev/null +++ b/gtk2_ardour/ardour2_ui_sae.conf @@ -0,0 +1,95 @@ + + + + + diff --git a/gtk2_ardour/ardour3_ui_dark.rc.in b/gtk2_ardour/ardour3_ui_dark.rc.in index 271cf1a756..05a9981fe5 100644 --- a/gtk2_ardour/ardour3_ui_dark.rc.in +++ b/gtk2_ardour/ardour3_ui_dark.rc.in @@ -91,7 +91,7 @@ style "default_base" = "medium_text" GtkTreeView::vertical-padding = 0 GtkTreeView::horizontal-padding = 0 GtkTreeView::even-row-color = { 0, 0, 0 } - GtkTreeView::odd-row-color = { 0.08, 0.10, 0.15 } + GtkTreeView::odd-row-color = { 0.08, 0.10, 0.14 } fg[NORMAL] = { 0.80, 0.80, 0.80 } fg[ACTIVE] = { 0.80, 0.80, 0.80 } @@ -99,8 +99,8 @@ style "default_base" = "medium_text" fg[INSENSITIVE] = { 0.80, 0.80, 0.80 } fg[SELECTED] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.31, 0.35, 0.40 } - bg[ACTIVE] = { 0.31, 0.35, 0.40 } + bg[NORMAL] = { 0.31, 0.35, 0.38 } + bg[ACTIVE] = { 0.31, 0.35, 0.38 } bg[PRELIGHT] = "#515690" bg[INSENSITIVE] = { 0.06, 0.10, 0.10 } bg[SELECTED] = { 0, 0.40, 0.60 } @@ -111,11 +111,11 @@ style "default_base" = "medium_text" text[INSENSITIVE] = { 0.80, 0.80, 0.80} text[SELECTED] = { 1.0, 1.0, 1.0 } - base[ACTIVE] = "#272a2f" - base[NORMAL] = "#1a1e20" - base[PRELIGHT] = { 0.18, 0.20, 0.20 } + base[ACTIVE] = "#272a32" + base[NORMAL] = "#1a1e24" + base[PRELIGHT] = { 0.18, 0.20, 0.22 } base[INSENSITIVE] = "#4c5159" - base[SELECTED] = { 0.23, 0.25, 0.25 } + base[SELECTED] = { 0.23, 0.25, 0.27 } engine "clearlooks" { @@ -131,7 +131,7 @@ style "default_base" = "medium_text" style "base_frame" { fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.35, 0.35, 0.40 } + bg[NORMAL] = { 0.31, 0.35, 0.40 } } style "transport_base" = "medium_bold_text" @@ -150,26 +150,51 @@ style "black_mackie_menu_bar" bg[NORMAL] = { 0, 0, 0 } } */ -style "default_buttons_menus" + +style "default_button" +{ + font_name = "%FONT_SMALL%" + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + + bg[NORMAL] = { 0.31, 0.35, 0.39 } + bg[ACTIVE] = "#565690" + bg[PRELIGHT] = { 0.41, 0.45, 0.49 } + bg[INSENSITIVE] = { 0.11, 0.15, 0.19 } + bg[SELECTED] = { 0.11, 0.15, 0.19 } +} + +style "default_menu" { font_name = "%FONT_NORMAL%" fg[ACTIVE] = { 1.0, 1.0, 1.0 } - bg[NORMAL] = { 0.30, 0.30, 0.35 } + bg[NORMAL] = { 0.26, 0.30, 0.35 } bg[ACTIVE] = "#565690" - bg[PRELIGHT] = { 0.15, 0.15, 0.20 } - bg[INSENSITIVE] = { 0.15, 0.15, 0.20 } - bg[SELECTED] = { 0.15, 0.15, 0.20 } + bg[PRELIGHT] = { 0.11, 0.15, 0.20 } + bg[INSENSITIVE] = { 0.11, 0.15, 0.20 } + bg[SELECTED] = { 0.11, 0.15, 0.20 } } -style "very_small_button" = "default_buttons_menus" +style "default_generic" +{ + font_name = "%FONT_NORMAL%" + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + + bg[NORMAL] = { 0.26, 0.30, 0.35 } + bg[ACTIVE] = "#545690" + bg[PRELIGHT] = { 0.11, 0.15, 0.20 } + bg[INSENSITIVE] = { 0.11, 0.15, 0.20 } + bg[SELECTED] = { 0.11, 0.15, 0.20 } +} + +style "very_small_button" = "default_button" { font_name = "%FONT_SMALLER%" ythickness = 0 xthickness = 0 } -style "small_button" = "default_buttons_menus" +style "small_button" = "default_button" { } @@ -277,25 +302,24 @@ style "solo_button_active" = "small_button" style "mixer_solo_button" = "solo_button" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } style "mixer_solo_button_alternate" = "solo_button_alternate" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } style "mixer_solo_button_active" = "solo_button_active" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } - style "mute_button" = "small_button" { } @@ -326,23 +350,16 @@ style "mute_button_active" = "small_button" fg[PRELIGHT] = { 0, 0, 0 } } -style "mixer_mute_button" = "mute_button" -{ - font_name = "%FONT_SMALLERER%" - xthickness = 0 - ythickness = 0 -} - style "mixer_mute_button_alternate" = "mute_button_alternate" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } style "mixer_mute_button_active" = "mute_button_active" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } @@ -377,9 +394,9 @@ style "mixer_red_active_button" = "very_small_button" bg[INSENSITIVE] = { 0.16, 0.16, 0.21 } } -style "time_button" = "default_buttons_menus" +style "time_button" = "default_button" { - font_name = "%FONT_NORMAL%" + font_name = "%FONT_SMALL%" } style "transport_button" @@ -434,7 +451,7 @@ style "shuttle_control" = "very_small_text" bg[SELECTED] = { 1.0, 0.04, 0.04 } } -style "ardour_adjusters" = "default_buttons_menus" +style "ardour_adjusters" = "default_generic" { bg[NORMAL] = { 0.60, 0.60, 0.60 } bg[PRELIGHT] = { 0.80, 0.80, 0.80 } @@ -453,7 +470,7 @@ style "editor_hscrollbar" = "ardour_adjusters" GtkScrollbar::slider_width = 27 } -style "ardour_progressbars" = "default_buttons_menus" +style "ardour_progressbars" = "default_generic" { bg[NORMAL] = { 0, 0, 0 } bg[PRELIGHT] = { 0.00, 0.36, 0.40 } @@ -785,6 +802,7 @@ style "track_name_display" style "active_track_name_display" { font_name = "%FONT_NORMAL%" + GtkWidget::cursor_color = {0, 0, 0 } text[NORMAL] = { 0.26, 0.26, 0.26 } base[NORMAL] = { 0.89, 0.89, 0.89 } } @@ -1135,7 +1153,7 @@ style "tearoff_arrow" = "medium_bold_entry" bg[PRELIGHT] = { 0.80, 0.80, 0.80 } } -style "location_row_button" = "default_buttons_menus" +style "location_row_button" = "default_button" { font_name = "%FONT_BIG%" } @@ -1177,7 +1195,7 @@ style "pan_slider" } -style "ardour_button" ="default_buttons_menus" +style "ardour_button" ="default_button" { xthickness = 1 ythickness = 1 @@ -1187,7 +1205,7 @@ style "ardour_button" ="default_buttons_menus" class "GtkWidget" style:highest "default_base" class "GtkScrollbar" style:highest "ardour_adjusters" -class "GtkLabel" style:highest "default_buttons_menus" +class "GtkLabel" style:highest "default_generic" class "GtkButton" style:highest "ardour_button" class "GtkArrow" style:highest "tearoff_arrow" class "GtkProgressBar" style:highest "ardour_progressbars" @@ -1196,7 +1214,7 @@ widget "*FirstActionMessage" style:highest "first_action_message" widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor" widget "*MarkerText" style:highest "marker_text" widget "*TimeAxisViewItemName*" style:highest "time_axis_view_item_name" -#widget "*ExportProgress" style:highest "default_buttons_menus" +#widget "*ExportProgress" style:highest "default_generic" widget "*ExportFileLabel" style:highest "small_bold_text" widget "*ExportFormatLabel" style:highest "medium_bold_text" widget "*ExportHeader" style:highest "small_bold_text" @@ -1208,33 +1226,33 @@ widget "*EditModeSelector" style:highest "medium_bold_entry" widget "*SnapTypeSelector" style:highest "medium_bold_entry" widget "*SnapModeSelector" style:highest "medium_bold_entry" widget "*ZoomFocusSelector" style:highest "medium_bold_entry" -widget "*ArdourContextMenu*" style:highest "default_buttons_menus" -widget "*EditGroupTitleButton*" style:highest "default_buttons_menus" -widget "*MixerGroupTitleButton*" style:highest "default_buttons_menus" -widget "*ErrorLogCloseButton" style:highest "default_buttons_menus" -widget "*EditorGTKButton*" style:highest "default_buttons_menus" -widget "*ToolbarButton" style:highest "default_buttons_menus" -widget "*ToolbarButton*" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton*" style:highest "default_buttons_menus" -widget "*TrackHistoryButton*" style:highest "default_buttons_menus" -widget "*TrackSizeButton*" style:highest "default_buttons_menus" -widget "*TrackPlaylistButton*" style:highest "default_buttons_menus" -widget "*TrackAutomationButton*" style:highest "default_buttons_menus" -widget "*TrackGroupButton*" style:highest "default_buttons_menus" -widget "*TrackMixButton*" style:highest "default_buttons_menus" -widget "*TrackVisualButton*" style:highest "default_buttons_menus" -widget "*TrackRemoveButton*" style:highest "default_buttons_menus" -widget "*BaseButton" style:highest "default_buttons_menus" -widget "*TakeButtonLabel" style:highest "default_buttons_menus" -widget "*MixerWidthButton" style:highest "default_buttons_menus" -widget "*MixerHideButton" style:highest "default_buttons_menus" -widget "*MixerSendButton" style:highest "default_buttons_menus" -widget "*MixerSendButtonLabel" style:highest "default_buttons_menus" -widget "*MixerSendSwitch" style:highest "default_buttons_menus" -widget "*MixerInsertButton" style:highest "default_buttons_menus" -widget "*MixerInsertButtonLabel" style:highest "default_buttons_menus" -widget "*MixerInsertSwitch" style:highest "default_buttons_menus" +widget "*ArdourContextMenu*" style:highest "default_menu" +widget "*EditGroupTitleButton*" style:highest "default_button" +widget "*MixerGroupTitleButton*" style:highest "default_button" +widget "*ErrorLogCloseButton" style:highest "default_button" +widget "*EditorGTKButton*" style:highest "default_button" +widget "*ToolbarButton" style:highest "default_button" +widget "*ToolbarButton*" style:highest "default_button" +widget "*CrossfadeEditButton" style:highest "default_button" +widget "*CrossfadeEditButton*" style:highest "default_button" +widget "*TrackHistoryButton*" style:highest "default_button" +widget "*TrackSizeButton*" style:highest "default_button" +widget "*TrackPlaylistButton*" style:highest "default_button" +widget "*TrackAutomationButton*" style:highest "default_button" +widget "*TrackGroupButton*" style:highest "default_button" +widget "*TrackMixButton*" style:highest "default_button" +widget "*TrackVisualButton*" style:highest "default_button" +widget "*TrackRemoveButton*" style:highest "default_button" +widget "*BaseButton" style:highest "default_button" +widget "*TakeButtonLabel" style:highest "default_button" +widget "*MixerWidthButton" style:highest "default_button" +widget "*MixerHideButton" style:highest "default_button" +widget "*MixerSendButton" style:highest "default_button" +widget "*MixerSendButtonLabel" style:highest "default_button" +widget "*MixerSendSwitch" style:highest "default_button" +widget "*MixerInsertButton" style:highest "default_button" +widget "*MixerInsertButtonLabel" style:highest "default_button" +widget "*MixerInsertSwitch" style:highest "default_button" widget "*MixerMonitorInputButton*" style:highest "very_small_button" widget "*MixerMonitorInputButton.*" style:highest "very_small_button" widget "*MixerIOButton" style:highest "very_small_button" @@ -1338,7 +1356,7 @@ widget "*TakeTagLabel" style:highest "small_bold_text" widget "*ToolBarLabel" style:highest "small_bold_text" widget "*EditorDisplayLabel" style:highest "small_bold_text" widget "*NewSessionLabel" style:highest "large_text" -widget "*GlobalButtonLabel" style:highest "default_buttons_menus" +widget "*GlobalButtonLabel" style:highest "default_generic" widget "*ClickButton" style:highest "medium_entry" widget "*RegionNameDisplay" style:highest "medium_entry" widget "*PluginDisplay" style:highest "medium_entry" @@ -1391,8 +1409,8 @@ widget "*CrossfadeEditCurveButton" style:highest "red_when_active" widget "*CrossfadeEditCurveButton*" style:highest "red_when_active" widget "*CrossfadeEditLabel" style:highest "medium_text" widget "*CrossfadeEditFrame" style:highest "base_frame" -widget "*MouseModeButton" style:highest "default_buttons_menus" -widget "*MouseModeButton*" style:highest "default_buttons_menus" +widget "*MouseModeButton" style:highest "default_button" +widget "*MouseModeButton*" style:highest "default_button" widget "*EditorMainCanvas" style:highest "main_canvas_area" widget "*AudioTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" widget "*BusControlsBaseInactiveUnselected" style:highest "track_controls_inactive" @@ -1462,8 +1480,8 @@ widget "*TransportAuditioningAlert" style:highest "flashing_alert" widget "*TransportAuditioningAlert.*" style:highest "flashing_alert" widget "*FadeCurve" style:highest "medium_bold_entry" widget "*FadeCurve*" style:highest "medium_bold_entry" -widget "*IOSelectorButton" style:highest "default_buttons_menus" -widget "*IOSelectorButton*" style:highest "default_buttons_menus" +widget "*IOSelectorButton" style:highest "default_button" +widget "*IOSelectorButton*" style:highest "default_button" widget "*IOSelectorList" style:highest "medium_entry_noselection_fg" widget "*IOSelectorPortList" style:highest "io_selector_port_list" widget "*IOSelectorPortList.*" style:highest "io_selector_port_list" @@ -1472,8 +1490,8 @@ widget "*IOSelectorPortListSelected.*" style:highest "selected_io_selector_port_ widget "*IOSelectorNotebook" style:highest "io_selector_notebook" widget "*IOSelectorNotebookTab" style:highest "io_selector_notebook" widget "*IOSelectorFrame" style:highest "base_frame" -widget "*ConnectionEditorButton" style:highest "default_buttons_menus" -widget "*ConnectionEditorButton*" style:highest "default_buttons_menus" +widget "*ConnectionEditorButton" style:highest "default_button" +widget "*ConnectionEditorButton*" style:highest "default_button" widget "*ConnectionEditorList" style:highest "medium_entry_noselection_fg" widget "*ConnectionEditorConnectionList" style:highest "medium_entry" widget "*ConnectionEditorPortList" style:highest "io_selector_port_list" @@ -1500,18 +1518,18 @@ widget "*PluginLoadButton*" style:highest "small_button" widget "*MetricDialogFrame" style:highest "base_frame" widget "*MetricEntry" style:highest "medium_bold_entry" -widget "*MetricButton" style:highest "default_buttons_menus" -widget "*MetricButton.*" style:highest "default_buttons_menus" +widget "*MetricButton" style:highest "default_button" +widget "*MetricButton.*" style:highest "default_button" widget "*MetricLabel" style:highest "medium_text" -widget "*TimeStretchButton" style:highest "default_buttons_menus" -widget "*TimeStretchButton.*" style:highest "default_buttons_menus" -widget "*TimeStretchProgress" style:highest "default_buttons_menus" -widget "*ChoiceWindow" style:highest "default_buttons_menus" -widget "*ChoicePrompt" style:highest "default_buttons_menus" -widget "*ChoiceButton" style:highest "default_buttons_menus" -widget "*ChoiceButton*" style:highest "default_buttons_menus" -widget "*SelectionModeButton" style:highest "default_buttons_menus" -widget "*SelectionModeButton*" style:highest "default_buttons_menus" +widget "*TimeStretchButton" style:highest "default_button" +widget "*TimeStretchButton.*" style:highest "default_button" +widget "*TimeStretchProgress" style:highest "default_generic" +widget "*ChoiceWindow" style:highest "default_generic" +widget "*ChoicePrompt" style:highest "default_generic" +widget "*ChoiceButton" style:highest "default_button" +widget "*ChoiceButton*" style:highest "default_button" +widget "*SelectionModeButton" style:highest "default_button" +widget "*SelectionModeButton*" style:highest "default_button" widget "*TrackLabel" style:highest "medium_text" widget "*TrackPlugName" style:highest "medium_text" widget "*TrackParameterName" style:highest "small_text" @@ -1521,7 +1539,7 @@ widget "*AddRouteDialogChannelChoice" style:highest "medium_bold_entry" widget "*AddRouteDialogSpinner" style:highest "medium_bold_entry" widget "*AddRouteDialogSpinner*" style:highest "medium_bold_entry" widget "*AddRouteDialogRadioButton" style:highest "red_when_active" -widget "*AddRouteDialogButton" style:highest "default_buttons_menus" +widget "*AddRouteDialogButton" style:highest "default_button" widget "*AddRouteDialogNameTemplateEntry" style:highest "medium_bold_entry" widget "*NewSessionIOLabel" style:highest "larger_bold_text" widget "*NewSessionSR1Label" style:highest "red_medium_text" @@ -1544,10 +1562,10 @@ widget "*LocationEditNumberLabel" style:highest "small_text" widget "*LocationLocEditorFrame" style:highest "base_frame" widget "*LocationRangeEditorFrame" style:highest "base_frame" widget "*LocationEditNameEntry" style:highest "option_entry" -widget "*LocationAddLocationButton" style:highest "default_buttons_menus" -widget "*LocationAddLocationButton*" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton*" style:highest "default_buttons_menus" +widget "*LocationAddLocationButton" style:highest "default_button" +widget "*LocationAddLocationButton*" style:highest "default_button" +widget "*LocationAddRangeButton" style:highest "default_button" +widget "*LocationAddRangeButton*" style:highest "default_button" widget "*LocationEditRemoveButton" style:highest "location_row_button" widget "*LocationEditRemoveButton*" style:highest "location_row_button" widget "*PanSlider" style:highest "pan_slider" @@ -1556,7 +1574,7 @@ widget "*PanningLinkButton.*" style:highest "mixer_red_active_button" widget "*PanningLinkDirectionButton" style:highest "very_small_button" widget "*PanningLinkDirectionButton.*" style:highest "very_small_button" widget "*ChannelCountSelector" style:highest "medium_bold_entry" -widget "*ChannelCountSelector.GtkArrow" style:highest "default_buttons_menus" +widget "*ChannelCountSelector.GtkArrow" style:highest "default_generic" widget "*RegionListWholeFile" style:highest "treeview_parent_node" widget "*EditorHScrollbar" style:highest "editor_hscrollbar" diff --git a/gtk2_ardour/ardour3_ui_light.rc.in b/gtk2_ardour/ardour3_ui_light.rc.in index e5cf578620..5a5ab6cc3f 100644 --- a/gtk2_ardour/ardour3_ui_light.rc.in +++ b/gtk2_ardour/ardour3_ui_light.rc.in @@ -148,7 +148,19 @@ style "black_mackie_menu_bar" bg[NORMAL] = { 0, 0, 0 } } */ -style "default_buttons_menus" +style "default_button" +{ + font_name = "%FONT_SMALL%" + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + + bg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = "#565690" + bg[PRELIGHT] = { 0.70, 0.70, 0.90 } + bg[INSENSITIVE] = { 0.70, 0.70, 0.90 } + bg[SELECTED] = { 0.70, 0.70, 0.90 } +} + +style "default_menu" { font_name = "%FONT_NORMAL%" fg[ACTIVE] = { 1.0, 1.0, 1.0 } @@ -160,14 +172,26 @@ style "default_buttons_menus" bg[SELECTED] = { 0.70, 0.70, 0.90 } } -style "very_small_button" = "default_buttons_menus" +style "default_generic" +{ + font_name = "%FONT_NORMAL%" + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + + bg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = "#565690" + bg[PRELIGHT] = { 0.70, 0.70, 0.90 } + bg[INSENSITIVE] = { 0.70, 0.70, 0.90 } + bg[SELECTED] = { 0.70, 0.70, 0.90 } +} + +style "very_small_button" = "default_button" { font_name = "%FONT_SMALLER%" ythickness = 0 xthickness = 0 } -style "small_button" = "default_buttons_menus" +style "small_button" = "default_button" { } @@ -275,20 +299,20 @@ style "solo_button_active" = "small_button" style "mixer_solo_button" = "solo_button" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } style "mixer_solo_button_alternate" = "solo_button_alternate" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } style "mixer_solo_button_active" = "solo_button_active" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } @@ -324,23 +348,16 @@ style "mute_button_active" = "small_button" fg[PRELIGHT] = { 0, 0, 0 } } -style "mixer_mute_button" = "mute_button" -{ - font_name = "%FONT_SMALLERER%" - xthickness = 0 - ythickness = 0 -} - style "mixer_mute_button_alternate" = "mute_button_alternate" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } style "mixer_mute_button_active" = "mute_button_active" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } @@ -354,7 +371,7 @@ style "multiline_combo" = "small_button" style "mixer_mute_button" = "mute_button" { - font_name = "%FONT_SMALLERER%" + font_name = "%FONT_SMALLER%" xthickness = 0 ythickness = 0 } @@ -375,9 +392,9 @@ style "mixer_red_active_button" = "very_small_button" bg[INSENSITIVE] = { 0.80, 0.80, 0.80 } } -style "time_button" = "default_buttons_menus" +style "time_button" = "default_button" { - font_name = "%FONT_NORMAL%" + font_name = "%FONT_SMALL%" } style "transport_button" @@ -432,7 +449,7 @@ style "shuttle_control" = "very_small_text" bg[SELECTED] = { 1.0, 0.04, 0.04 } } -style "ardour_adjusters" = "default_buttons_menus" +style "ardour_adjusters" = "default_generic" { bg[NORMAL] = { 0.60, 0.60, 0.60 } bg[PRELIGHT] = { 0.80, 0.80, 0.80 } @@ -451,7 +468,7 @@ style "editor_hscrollbar" = "ardour_adjusters" GtkScrollbar::slider_width = 27 } -style "ardour_progressbars" = "default_buttons_menus" +style "ardour_progressbars" = "default_generic" { bg[NORMAL] = { 0, 0, 0 } bg[PRELIGHT] = { 0.00, 0.36, 0.40 } @@ -1134,7 +1151,7 @@ style "tearoff_arrow" = "medium_bold_entry" bg[PRELIGHT] = { 0.30, 0.30, 0.30 } } -style "location_row_button" = "default_buttons_menus" +style "location_row_button" = "default_button" { font_name = "%FONT_SMALL%" } @@ -1176,7 +1193,7 @@ style "pan_slider" } -style "ardour_button" ="default_buttons_menus" +style "ardour_button" ="default_button" { xthickness = 1 ythickness = 1 @@ -1186,7 +1203,7 @@ style "ardour_button" ="default_buttons_menus" class "GtkWidget" style:highest "default_base" class "GtkScrollbar" style:highest "ardour_adjusters" -class "GtkLabel" style:highest "default_buttons_menus" +class "GtkLabel" style:highest "default_generic" class "GtkButton" style:highest "ardour_button" class "GtkArrow" style:highest "tearoff_arrow" class "GtkProgressBar" style:highest "ardour_progressbars" @@ -1195,7 +1212,7 @@ widget "*FirstActionMessage" style:highest "first_action_message" widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor" widget "*MarkerText" style:highest "marker_text" widget "*TimeAxisViewItemName*" style:highest "time_axis_view_item_name" -#widget "*ExportProgress" style:highest "default_buttons_menus" +#widget "*ExportProgress" style:highest "default_generic" widget "*ExportFileLabel" style:highest "small_bold_text" widget "*ExportFormatLabel" style:highest "medium_bold_text" widget "*ExportHeader" style:highest "small_bold_text" @@ -1207,33 +1224,33 @@ widget "*EditModeSelector" style:highest "medium_bold_entry" widget "*SnapTypeSelector" style:highest "medium_bold_entry" widget "*SnapModeSelector" style:highest "medium_bold_entry" widget "*ZoomFocusSelector" style:highest "medium_bold_entry" -widget "*ArdourContextMenu*" style:highest "default_buttons_menus" -widget "*EditGroupTitleButton*" style:highest "default_buttons_menus" -widget "*MixerGroupTitleButton*" style:highest "default_buttons_menus" -widget "*ErrorLogCloseButton" style:highest "default_buttons_menus" -widget "*EditorGTKButton*" style:highest "default_buttons_menus" -widget "*ToolbarButton" style:highest "default_buttons_menus" -widget "*ToolbarButton*" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton*" style:highest "default_buttons_menus" -widget "*TrackHistoryButton*" style:highest "default_buttons_menus" -widget "*TrackSizeButton*" style:highest "default_buttons_menus" -widget "*TrackPlaylistButton*" style:highest "default_buttons_menus" -widget "*TrackAutomationButton*" style:highest "default_buttons_menus" -widget "*TrackGroupButton*" style:highest "default_buttons_menus" -widget "*TrackMixButton*" style:highest "default_buttons_menus" -widget "*TrackVisualButton*" style:highest "default_buttons_menus" -widget "*TrackRemoveButton*" style:highest "default_buttons_menus" -widget "*BaseButton" style:highest "default_buttons_menus" -widget "*TakeButtonLabel" style:highest "default_buttons_menus" -widget "*MixerWidthButton" style:highest "default_buttons_menus" -widget "*MixerHideButton" style:highest "default_buttons_menus" -widget "*MixerSendButton" style:highest "default_buttons_menus" -widget "*MixerSendButtonLabel" style:highest "default_buttons_menus" -widget "*MixerSendSwitch" style:highest "default_buttons_menus" -widget "*MixerInsertButton" style:highest "default_buttons_menus" -widget "*MixerInsertButtonLabel" style:highest "default_buttons_menus" -widget "*MixerInsertSwitch" style:highest "default_buttons_menus" +widget "*ArdourContextMenu*" style:highest "default_menu" +widget "*EditGroupTitleButton*" style:highest "default_button" +widget "*MixerGroupTitleButton*" style:highest "default_button" +widget "*ErrorLogCloseButton" style:highest "default_button" +widget "*EditorGTKButton*" style:highest "default_button" +widget "*ToolbarButton" style:highest "default_button" +widget "*ToolbarButton*" style:highest "default_button" +widget "*CrossfadeEditButton" style:highest "default_button" +widget "*CrossfadeEditButton*" style:highest "default_button" +widget "*TrackHistoryButton*" style:highest "default_button" +widget "*TrackSizeButton*" style:highest "default_button" +widget "*TrackPlaylistButton*" style:highest "default_button" +widget "*TrackAutomationButton*" style:highest "default_button" +widget "*TrackGroupButton*" style:highest "default_button" +widget "*TrackMixButton*" style:highest "default_button" +widget "*TrackVisualButton*" style:highest "default_button" +widget "*TrackRemoveButton*" style:highest "default_button" +widget "*BaseButton" style:highest "default_button" +widget "*TakeButtonLabel" style:highest "default_generic" +widget "*MixerWidthButton" style:highest "default_button" +widget "*MixerHideButton" style:highest "default_button" +widget "*MixerSendButton" style:highest "default_button" +widget "*MixerSendButtonLabel" style:highest "default_button" +widget "*MixerSendSwitch" style:highest "default_button" +widget "*MixerInsertButton" style:highest "default_button" +widget "*MixerInsertButtonLabel" style:highest "default_button" +widget "*MixerInsertSwitch" style:highest "default_button" widget "*MixerMonitorInputButton*" style:highest "very_small_button" widget "*MixerMonitorInputButton.*" style:highest "very_small_button" widget "*MixerIOButton" style:highest "very_small_button" @@ -1337,7 +1354,7 @@ widget "*TakeTagLabel" style:highest "small_bold_text" widget "*ToolBarLabel" style:highest "small_bold_text" widget "*EditorDisplayLabel" style:highest "small_bold_text" widget "*NewSessionLabel" style:highest "large_text" -widget "*GlobalButtonLabel" style:highest "default_buttons_menus" +widget "*GlobalButtonLabel" style:highest "default_generic" widget "*ClickButton" style:highest "medium_entry" widget "*RegionNameDisplay" style:highest "medium_entry" widget "*PluginDisplay" style:highest "medium_entry" @@ -1390,8 +1407,8 @@ widget "*CrossfadeEditCurveButton" style:highest "red_when_active" widget "*CrossfadeEditCurveButton*" style:highest "red_when_active" widget "*CrossfadeEditLabel" style:highest "medium_text" widget "*CrossfadeEditFrame" style:highest "base_frame" -widget "*MouseModeButton" style:highest "default_buttons_menus" -widget "*MouseModeButton*" style:highest "default_buttons_menus" +widget "*MouseModeButton" style:highest "default_button" +widget "*MouseModeButton*" style:highest "default_button" widget "*EditorMainCanvas" style:highest "main_canvas_area" widget "*AudioTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" widget "*BusControlsBaseInactiveUnselected" style:highest "track_controls_inactive" @@ -1461,8 +1478,8 @@ widget "*TransportAuditioningAlert" style:highest "flashing_alert" widget "*TransportAuditioningAlert.*" style:highest "flashing_alert" widget "*FadeCurve" style:highest "medium_bold_entry" widget "*FadeCurve*" style:highest "medium_bold_entry" -widget "*IOSelectorButton" style:highest "default_buttons_menus" -widget "*IOSelectorButton*" style:highest "default_buttons_menus" +widget "*IOSelectorButton" style:highest "default_button" +widget "*IOSelectorButton*" style:highest "default_button" widget "*IOSelectorList" style:highest "medium_entry_noselection_fg" widget "*IOSelectorPortList" style:highest "io_selector_port_list" widget "*IOSelectorPortList.*" style:highest "io_selector_port_list" @@ -1471,8 +1488,8 @@ widget "*IOSelectorPortListSelected.*" style:highest "selected_io_selector_port_ widget "*IOSelectorNotebook" style:highest "io_selector_notebook" widget "*IOSelectorNotebookTab" style:highest "io_selector_notebook" widget "*IOSelectorFrame" style:highest "base_frame" -widget "*ConnectionEditorButton" style:highest "default_buttons_menus" -widget "*ConnectionEditorButton*" style:highest "default_buttons_menus" +widget "*ConnectionEditorButton" style:highest "default_button" +widget "*ConnectionEditorButton*" style:highest "default_button" widget "*ConnectionEditorList" style:highest "medium_entry_noselection_fg" widget "*ConnectionEditorConnectionList" style:highest "medium_entry" widget "*ConnectionEditorPortList" style:highest "io_selector_port_list" @@ -1499,18 +1516,18 @@ widget "*PluginLoadButton*" style:highest "small_button" widget "*MetricDialogFrame" style:highest "base_frame" widget "*MetricEntry" style:highest "medium_bold_entry" -widget "*MetricButton" style:highest "default_buttons_menus" -widget "*MetricButton.*" style:highest "default_buttons_menus" +widget "*MetricButton" style:highest "default_button" +widget "*MetricButton.*" style:highest "default_button" widget "*MetricLabel" style:highest "medium_text" -widget "*TimeStretchButton" style:highest "default_buttons_menus" -widget "*TimeStretchButton.*" style:highest "default_buttons_menus" -widget "*TimeStretchProgress" style:highest "default_buttons_menus" -widget "*ChoiceWindow" style:highest "default_buttons_menus" -widget "*ChoicePrompt" style:highest "default_buttons_menus" -widget "*ChoiceButton" style:highest "default_buttons_menus" -widget "*ChoiceButton*" style:highest "default_buttons_menus" -widget "*SelectionModeButton" style:highest "default_buttons_menus" -widget "*SelectionModeButton*" style:highest "default_buttons_menus" +widget "*TimeStretchButton" style:highest "default_button" +widget "*TimeStretchButton.*" style:highest "default_button" +widget "*TimeStretchProgress" style:highest "default_button" +widget "*ChoiceWindow" style:highest "default_generic" +widget "*ChoicePrompt" style:highest "default_generic" +widget "*ChoiceButton" style:highest "default_button" +widget "*ChoiceButton*" style:highest "default_button" +widget "*SelectionModeButton" style:highest "default_button" +widget "*SelectionModeButton*" style:highest "default_button" widget "*TrackLabel" style:highest "medium_text" widget "*TrackPlugName" style:highest "medium_text" widget "*TrackParameterName" style:highest "small_text" @@ -1520,7 +1537,7 @@ widget "*AddRouteDialogChannelChoice" style:highest "medium_bold_entry" widget "*AddRouteDialogSpinner" style:highest "medium_bold_entry" widget "*AddRouteDialogSpinner*" style:highest "medium_bold_entry" widget "*AddRouteDialogRadioButton" style:highest "red_when_active" -widget "*AddRouteDialogButton" style:highest "default_buttons_menus" +widget "*AddRouteDialogButton" style:highest "default_button" widget "*AddRouteDialogNameTemplateEntry" style:highest "medium_bold_entry" widget "*NewSessionIOLabel" style:highest "larger_bold_text" widget "*NewSessionSR1Label" style:highest "red_medium_text" @@ -1543,10 +1560,10 @@ widget "*LocationEditNumberLabel" style:highest "small_text" widget "*LocationLocEditorFrame" style:highest "base_frame" widget "*LocationRangeEditorFrame" style:highest "base_frame" widget "*LocationEditNameEntry" style:highest "option_entry" -widget "*LocationAddLocationButton" style:highest "default_buttons_menus" -widget "*LocationAddLocationButton*" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton*" style:highest "default_buttons_menus" +widget "*LocationAddLocationButton" style:highest "default_button" +widget "*LocationAddLocationButton*" style:highest "default_button" +widget "*LocationAddRangeButton" style:highest "default_button" +widget "*LocationAddRangeButton*" style:highest "default_button" widget "*LocationEditRemoveButton" style:highest "location_row_button" widget "*LocationEditRemoveButton*" style:highest "location_row_button" widget "*PanSlider" style:highest "pan_slider" @@ -1555,7 +1572,7 @@ widget "*PanningLinkButton.*" style:highest "mixer_red_active_button" widget "*PanningLinkDirectionButton" style:highest "very_small_button" widget "*PanningLinkDirectionButton.*" style:highest "very_small_button" widget "*ChannelCountSelector" style:highest "medium_bold_entry" -widget "*ChannelCountSelector.GtkArrow" style:highest "default_buttons_menus" +widget "*ChannelCountSelector.GtkArrow" style:highest "default_generic" widget "*RegionListWholeFile" style:highest "treeview_parent_node" widget "*EditorHScrollbar" style:highest "editor_hscrollbar" diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 271cbab85b..f7a6c43b0f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -172,6 +172,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) #ifdef TOP_MENUBAR _auto_display_errors = false; #endif + about = 0; splash = 0; @@ -210,18 +211,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) sys::path key_bindings_file; - find_file_in_search_path (ardour_search_path() + system_config_search_path(), - "ardour.bindings", key_bindings_file); - - keybindings_path = key_bindings_file.to_string(); - - /* store all bindings changes in per-user file, no matter where they were loaded from */ - user_keybindings_path = user_config_directory().to_string (); - user_keybindings_path += '/'; - user_keybindings_path += "ardour.bindings"; - - can_save_keybindings = false; - last_configure_time.tv_sec = 0; last_configure_time.tv_usec = 0; @@ -354,7 +343,11 @@ ARDOUR_UI::post_engine () /* set default clock modes */ - primary_clock.set_mode (AudioClock::SMPTE); + if (Profile->get_sae()) { + primary_clock.set_mode (AudioClock::MinSec); + } else { + primary_clock.set_mode (AudioClock::SMPTE); + } secondary_clock.set_mode (AudioClock::BBT); /* start the time-of-day-clock */ @@ -540,7 +533,7 @@ ARDOUR_UI::save_ardour_state () Config->add_instant_xml (mnode); } - save_keybindings (); + Keyboard::save_keybindings (); } gint @@ -647,6 +640,8 @@ ARDOUR_UI::startup () return; } + BootMessage (_("Ardour is ready for use")); + show (); } @@ -2245,7 +2240,6 @@ ARDOUR_UI::end_loading_messages () void ARDOUR_UI::loading_message (const std::string& msg) { - cerr << "say: " << msg << endl; show_splash (); splash->message (msg); flush_pending (); @@ -2921,6 +2915,8 @@ ARDOUR_UI::add_route (Gtk::Window* float_window) } /* XXX do something with name template */ + + cerr << "Adding with " << input_chan << " in and " << output_chan << "out\n"; if (add_route_dialog->type() == ARDOUR::DataType::MIDI) { if (track) { @@ -2988,16 +2984,33 @@ ARDOUR_UI::keyboard_settings () const return node; } +void +ARDOUR_UI::create_xrun_marker(nframes_t where) +{ + ENSURE_GUI_THREAD (bind(mem_fun(*this, &ARDOUR_UI::create_xrun_marker), where)); + editor->mouse_add_new_marker (where, false, true); +} + void ARDOUR_UI::halt_on_xrun_message () { - ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::halt_on_xrun_message)); - MessageDialog msg (*editor, _("Recording was stopped because your system could not keep up.")); msg.run (); } +void +ARDOUR_UI::xrun_handler(nframes_t where) +{ + if (Config->get_create_xrun_marker() && session->actively_recording()) { + create_xrun_marker(where); + } + + if (Config->get_stop_recording_on_xrun() && session->actively_recording()) { + halt_on_xrun_message (); + } +} + void ARDOUR_UI::disk_overrun_handler () { @@ -3090,8 +3103,8 @@ The audioengine is currently running at %2 Hz\n"), desired, actual)); hbox->pack_start (*image, PACK_EXPAND_WIDGET, 12); hbox->pack_end (message, PACK_EXPAND_PADDING, 12); dialog.get_vbox()->pack_start(*hbox, PACK_EXPAND_PADDING, 6); - dialog.add_button (_("Load session anyway"), RESPONSE_ACCEPT); dialog.add_button (_("Do not load session"), RESPONSE_REJECT); + dialog.add_button (_("Load session anyway"), RESPONSE_ACCEPT); dialog.set_default_response (RESPONSE_ACCEPT); dialog.set_position (WIN_POS_CENTER); message.show(); @@ -3230,27 +3243,13 @@ ARDOUR_UI::record_state_changed () } } -void -ARDOUR_UI::set_keybindings_path (string path) -{ - keybindings_path = path; -} - -void -ARDOUR_UI::save_keybindings () -{ - if (can_save_keybindings) { - AccelMap::save (user_keybindings_path); - } -} - bool ARDOUR_UI::first_idle () { if (session) { session->allow_auto_play (true); } - can_save_keybindings = true; + Keyboard::set_can_save_keybindings (true); return false; } diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 01e53c7d54..2bc2736183 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -198,6 +198,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI void do_transport_locate (nframes_t position); void halt_on_xrun_message (); + void xrun_handler (nframes_t); + void create_xrun_marker (nframes_t); AudioClock primary_clock; AudioClock secondary_clock; @@ -236,9 +238,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI void set_native_file_header_format (ARDOUR::HeaderFormat sf); void set_native_file_data_format (ARDOUR::SampleFormat sf); - void set_keybindings_path (std::string path); - void save_keybindings (); - void setup_profile (); void setup_theme (); @@ -601,10 +600,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI void connect_dependents_to_session (ARDOUR::Session *); void we_have_dependents (); - std::string keybindings_path; - std::string user_keybindings_path; - - void setup_keybindings (); void setup_session_options (); guint32 last_key_press_time; @@ -725,6 +720,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI void toggle_VerifyRemoveLastCapture(); void toggle_PeriodicSafetyBackups(); void toggle_StopRecordingOnXrun(); + void toggle_CreateXrunMarker(); void toggle_StopTransportAtEndOfSession(); void toggle_GainReduceFastTransport(); void toggle_LatchedSolo(); @@ -758,7 +754,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI void toggle_control_protocol (ARDOUR::ControlProtocolInfo*); void toggle_control_protocol_feedback (ARDOUR::ControlProtocolInfo*, const char* group_name, std::string action_name); - bool can_save_keybindings; bool first_idle (); void no_memory_warning (); diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index a2ac809203..f81dc8d311 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -23,8 +23,6 @@ #include -#include - #include #include "ardour_ui.h" @@ -33,6 +31,7 @@ #include "keyboard.h" #include "splash.h" #include "route_params_ui.h" +#include "opts.h" #include "i18n.h" using namespace sigc; @@ -44,6 +43,8 @@ namespace ARDOUR { class Route; } +using namespace ARDOUR; + void ARDOUR_UI::shutdown () { @@ -58,53 +59,26 @@ ARDOUR_UI::shutdown () void ARDOUR_UI::we_have_dependents () -{ - setup_keybindings (); - editor->UpdateAllTransportClocks.connect (mem_fun (*this, &ARDOUR_UI::update_transport_clocks)); -} - -static void -accel_map_changed (GtkAccelMap* map, - gchar* path, - guint key, - GdkModifierType mod, - gpointer arg) -{ - static_cast(arg)->save_keybindings (); -} - -void -ARDOUR_UI::setup_keybindings () { install_actions (); ProcessorBox::register_actions (); - - cerr << "loading bindings from " << keybindings_path << endl; - try { - AccelMap::load (keybindings_path); - } catch (...) { - error << string_compose (_("Ardour key bindings file not found at \"%1\" or contains errors."), keybindings_path) - << endmsg; - } - - /* catch changes */ - - GtkAccelMap* accelmap = gtk_accel_map_get(); - g_signal_connect (accelmap, "changed", (GCallback) accel_map_changed, this); - - + Keyboard::setup_keybindings (); + editor->UpdateAllTransportClocks.connect (mem_fun (*this, &ARDOUR_UI::update_transport_clocks)); } void ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s) { + BootMessage (_("Setup Editor")); editor->connect_to_session (s); + BootMessage (_("Setup Mixer")); mixer->connect_to_session (s); /* its safe to do this now */ + BootMessage (_("Reload Session History")); s->restore_history (""); } diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 34104016d7..0d410cd526 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -51,7 +51,7 @@ ARDOUR_UI::connect_to_session (Session *s) { session = s; - session->HaltOnXrun.connect (mem_fun(*this, &ARDOUR_UI::halt_on_xrun_message)); + session->Xrun.connect (mem_fun(*this, &ARDOUR_UI::xrun_handler)); session->RecordStateChanged.connect (mem_fun (*this, &ARDOUR_UI::record_state_changed)); /* sensitize menu bar options that are now valid */ diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 30b6424fb4..dff8745252 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -37,7 +37,10 @@ #include "engine_dialog.h" #include "editor.h" #include "actions.h" -#include "sync-menu.h" + +#ifdef GTKOSX +#include +#endif #include #include @@ -421,6 +424,7 @@ ARDOUR_UI::install_actions () ActionManager::register_toggle_action (option_actions, X_("VerifyRemoveLastCapture"), _("Verify remove last capture"), mem_fun (*this, &ARDOUR_UI::toggle_VerifyRemoveLastCapture)); ActionManager::register_toggle_action (option_actions, X_("PeriodicSafetyBackups"), _("Make periodic safety backups"), mem_fun (*this, &ARDOUR_UI::toggle_PeriodicSafetyBackups)); ActionManager::register_toggle_action (option_actions, X_("StopRecordingOnXrun"), _("Stop recording on xrun"), mem_fun (*this, &ARDOUR_UI::toggle_StopRecordingOnXrun)); + ActionManager::register_toggle_action (option_actions, X_("CreateXrunMarker"), _("Create marker at xrun location"), mem_fun (*this, &ARDOUR_UI::toggle_CreateXrunMarker)); ActionManager::register_toggle_action (option_actions, X_("StopTransportAtEndOfSession"), _("Stop transport at session end"), mem_fun (*this, &ARDOUR_UI::toggle_StopTransportAtEndOfSession)); ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport)); ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable)); diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index 2b730fd585..903255cd87 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -469,6 +469,12 @@ ARDOUR_UI::toggle_StopRecordingOnXrun() ActionManager::toggle_config_state ("options", "StopRecordingOnXrun", &Configuration::set_stop_recording_on_xrun, &Configuration::get_stop_recording_on_xrun); } +void +ARDOUR_UI::toggle_CreateXrunMarker() +{ + ActionManager::toggle_config_state ("options", "CreateXrunMarker", &Configuration::set_create_xrun_marker, &Configuration::get_create_xrun_marker); +} + void ARDOUR_UI::toggle_sync_order_keys () { @@ -1052,6 +1058,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name) ActionManager::map_some_state ("options", "PeriodicSafetyBackups", &Configuration::get_periodic_safety_backups); } else if (PARAM_IS ("stop-recording-on-xrun")) { ActionManager::map_some_state ("options", "StopRecordingOnXrun", &Configuration::get_stop_recording_on_xrun); + } else if (PARAM_IS ("create-xrun-marker")) { + ActionManager::map_some_state ("options", "CreateXrunMarker", &Configuration::get_create_xrun_marker); } else if (PARAM_IS ("sync-all-route-ordering")) { ActionManager::map_some_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::get_sync_all_route_ordering); } else if (PARAM_IS ("stop-at-session-end")) { diff --git a/gtk2_ardour/au_pluginui.h b/gtk2_ardour/au_pluginui.h index 1ca5dca485..4f27cb1062 100644 --- a/gtk2_ardour/au_pluginui.h +++ b/gtk2_ardour/au_pluginui.h @@ -1,6 +1,9 @@ #ifndef __gtk2_ardour_auplugin_ui_h__ #define __gtk2_ardour_auplugin_ui_h__ +#include +#include + #include #include #include @@ -13,6 +16,10 @@ #undef verify #include +#include +#include +#include + #include "plugin_ui.h" namespace ARDOUR { @@ -34,7 +41,8 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox virtual void activate (); virtual void deactivate (); - + + void lower_box_realized (); void on_realize (); void on_show (); void on_hide (); @@ -49,6 +57,15 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox boost::shared_ptr au; int prefheight; int prefwidth; + + Gtk::HBox top_box; + Gtk::EventBox low_box; + Gtk::VBox vpacker; + Gtk::Label automation_mode_label; + Gtk::ComboBoxText automation_mode_selector; + Gtk::Label preset_label; + + static std::vector automation_mode_strings; /* Cocoa */ @@ -63,14 +80,11 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox AudioUnitCarbonView editView; WindowRef carbon_window; EventHandlerRef carbon_event_handler; - bool carbon_parented; - bool cocoa_parented; bool _activating_from_app; - void test_view_support (bool&, bool&); bool test_cocoa_view_support (); bool test_carbon_view_support (); - int create_carbon_view (bool generic); + int create_carbon_view (); int create_cocoa_view (); int parent_carbon_window (); diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index d2bdecfe60..4dfa62275a 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -2,8 +2,13 @@ #include #include +#undef check // stupid gtk, stupid apple + +#include #include +#include + #include "au_pluginui.h" #include "gui_thread.h" @@ -17,58 +22,92 @@ using namespace ARDOUR; using namespace Gtk; +using namespace Gtkmm2ext; using namespace sigc; using namespace std; using namespace PBD; -static const float kOffsetForAUView_X = 220; -static const float kOffsetForAUView_Y = 90; +vector AUPluginUI::automation_mode_strings; + +static const gchar* _automation_mode_strings[] = { + X_("Manual"), + X_("Play"), + X_("Write"), + X_("Touch"), + 0 +}; AUPluginUI::AUPluginUI (boost::shared_ptr insert) : PlugUIBase (insert) + , automation_mode_label (_("Automation")) + , preset_label (_("Presets")) + { + if (automation_mode_strings.empty()) { + automation_mode_strings = I18N (_automation_mode_strings); + } + + set_popdown_strings (automation_mode_selector, automation_mode_strings); + automation_mode_selector.set_active_text (automation_mode_strings.front()); + if ((au = boost::dynamic_pointer_cast (insert->plugin())) == 0) { error << _("unknown type of editor-supplying plugin (note: no AudioUnit support in this version of ardour)") << endmsg; throw failed_constructor (); } - bool has_carbon; - bool has_cocoa; + /* stuff some stuff into the top of the window */ + + top_box.set_spacing (6); + top_box.set_border_width (6); + + top_box.pack_end (bypass_button, false, true); + top_box.pack_end (automation_mode_selector, false, false); + top_box.pack_end (automation_mode_label, false, false); + top_box.pack_end (save_button, false, false); + top_box.pack_end (preset_combo, false, false); + top_box.pack_end (preset_label, false, false); + + set_spacing (6); + pack_start (top_box, false, false); + pack_start (low_box, false, false); + + preset_label.show (); + preset_combo.show (); + automation_mode_label.show (); + automation_mode_selector.show (); + bypass_button.show (); + top_box.show (); + low_box.show (); _activating_from_app = false; - carbon_parented = false; - cocoa_parented = false; cocoa_parent = 0; cocoa_window = 0; au_view = 0; - test_view_support (has_carbon, has_cocoa); + /* prefer cocoa, fall back to cocoa, but use carbon if its there */ - if (has_cocoa) { + if (test_cocoa_view_support()) { create_cocoa_view (); - } else if (has_carbon) { - create_carbon_view (has_carbon); + } else if (test_carbon_view_support()) { + create_carbon_view (); } else { - /* fallback to cocoa */ create_cocoa_view (); } -} + low_box.signal_realize().connect (mem_fun (this, &AUPluginUI::lower_box_realized)); +} AUPluginUI::~AUPluginUI () { - if (carbon_parented) { + if (cocoa_parent) { NSWindow* win = get_nswindow(); RemoveEventHandler(carbon_event_handler); [win removeChildWindow:cocoa_parent]; + } else if (carbon_window) { + /* never parented */ + DisposeWindow (carbon_window); } -} -void -AUPluginUI::test_view_support (bool& has_carbon, bool& has_cocoa) -{ - has_carbon = test_carbon_view_support(); - has_cocoa = test_cocoa_view_support(); } bool @@ -216,24 +255,16 @@ AUPluginUI::create_cocoa_view () } if (!wasAbleToLoadCustomView) { - // [B] Otherwise show generic Cocoa view + // load generic Cocoa view au_view = [[AUGenericView alloc] initWithAudioUnit:*au->get_au()]; [(AUGenericView *)au_view setShowsExpertParameters:YES]; } - /* make a child cocoa window */ - - cocoa_window = [[NSWindow alloc] - initWithContentRect:crect - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:NO]; - return 0; } int -AUPluginUI::create_carbon_view (bool generic) +AUPluginUI::create_carbon_view () { OSStatus err; ControlRef root_control; @@ -252,7 +283,7 @@ AUPluginUI::create_carbon_view (bool generic) kWindowNoShadowAttribute| kWindowNoTitleBarAttribute); - if ((err = CreateNewWindow(kFloatingWindowClass, attr, &r, &carbon_window)) != noErr) { + if ((err = CreateNewWindow(kDocumentWindowClass, attr, &r, &carbon_window)) != noErr) { error << string_compose (_("AUPluginUI: cannot create carbon window (err: %1)"), err) << endmsg; return -1; } @@ -277,14 +308,13 @@ AUPluginUI::create_carbon_view (bool generic) GetControlBounds(viewPane, &bounds); size.x = bounds.right-bounds.left; size.y = bounds.bottom-bounds.top; - SizeWindow(carbon_window, (short) (size.x + 0.5), (short) (size.y + 0.5), true); prefwidth = (int) (size.x + 0.5); prefheight = (int) (size.y + 0.5); -#if 0 - mViewPaneResizer->WantEventTypes (GetControlEventTarget(mAUViewPane), GetEventTypeCount(resizeEvent), resizeEvent); -#endif + SizeWindow (carbon_window, prefwidth, prefheight, true); + low_box.set_size_request (prefwidth, prefheight); + return 0; } @@ -311,22 +341,25 @@ AUPluginUI::get_nswindow () void AUPluginUI::activate () { - NSWindow* win = get_nswindow (); - [win setLevel:NSFloatingWindowLevel]; - - if (carbon_parented) { - [cocoa_parent makeKeyAndOrderFront:nil]; - cerr << "APP activated, activate carbon window\n"; + cerr << "AUPluginUI:: activate!\n"; + return; + if (carbon_window && cocoa_parent) { + cerr << "APP activated, activate carbon window " << insert->name() << endl; _activating_from_app = true; ActivateWindow (carbon_window, TRUE); _activating_from_app = false; + [cocoa_parent makeKeyAndOrderFront:nil]; } } void AUPluginUI::deactivate () { - /* nothing to do here */ + return; + cerr << "APP DEactivated, for " << insert->name() << endl; + _activating_from_app = true; + ActivateWindow (carbon_window, FALSE); + _activating_from_app = false; } @@ -339,6 +372,8 @@ _carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event, void *userDat OSStatus AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event) { + cerr << "CARBON EVENT\n"; + UInt32 eventKind = GetEventKind(event); ClickActivationResult howToHandleClick; NSWindow* win = get_nswindow (); @@ -347,7 +382,7 @@ AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event) switch (eventKind) { case kEventWindowHandleActivate: - cerr << "carbon window activated\n"; + cerr << "carbon window for " << insert->name() << " activated\n"; if (_activating_from_app) { cerr << "app activation, ignore window activation\n"; return noErr; @@ -357,12 +392,14 @@ AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event) break; case kEventWindowHandleDeactivate: - cerr << "carbon window deactivated\n"; - return eventNotHandledErr; + cerr << "carbon window for " << insert->name() << " deactivated\n"; + // never deactivate the carbon window + return noErr; break; case kEventWindowGetClickActivation: cerr << "carbon window CLICK activated\n"; + [win makeKeyAndOrderFront:nil]; howToHandleClick = kActivateAndHandleClick; SetEventParameter(event, kEventParamClickActivation, typeClickActivationResult, sizeof(ClickActivationResult), &howToHandleClick); @@ -400,7 +437,9 @@ AUPluginUI::parent_carbon_window () int titlebar_height = wm_frame.size.height - content_frame.size.height; - MoveWindow (carbon_window, x, y + titlebar_height, false); + int packing_extra = 6; // this is the total vertical packing in our top level window + + MoveWindow (carbon_window, x, y + titlebar_height + top_box.get_height() + packing_extra, false); ShowWindow (carbon_window); // create the cocoa window for the carbon one and make it visible @@ -408,8 +447,7 @@ AUPluginUI::parent_carbon_window () EventTypeSpec windowEventTypes[] = { {kEventClassWindow, kEventWindowGetClickActivation }, - {kEventClassWindow, kEventWindowHandleDeactivate }, - {kEventClassWindow, kEventWindowHandleActivate } + {kEventClassWindow, kEventWindowHandleDeactivate } }; EventHandlerUPP ehUPP = NewEventHandlerUPP(_carbon_event); @@ -421,11 +459,7 @@ AUPluginUI::parent_carbon_window () } [win addChildWindow:cocoa_parent ordered:NSWindowAbove]; - [win setLevel:NSFloatingWindowLevel]; - [win setHidesOnDeactivate:YES]; - carbon_parented = true; - return 0; } @@ -433,6 +467,8 @@ int AUPluginUI::parent_cocoa_window () { NSWindow* win = get_nswindow (); + NSView* packView = 0; + NSRect packFrame; if (!win) { return -1; @@ -446,9 +482,11 @@ AUPluginUI::parent_cocoa_window () } // Get the size of the new AU View's frame - NSRect au_view_frame = [au_view frame]; + packFrame = [au_view frame]; + packFrame.origin.x = 0; + packFrame.origin.y = 0; - if (au_view_frame.size.width > 500 || au_view_frame.size.height > 500) { + if (packFrame.size.width > 500 || packFrame.size.height > 500) { /* its too big - use a scrollview */ @@ -458,7 +496,7 @@ AUPluginUI::parent_cocoa_window () [scroll_view setHasHorizontalScroller:YES]; [scroll_view setHasVerticalScroller:YES]; - NSSize frameSize = [NSScrollView frameSizeForContentSize:au_view_frame.size + packFrame.size = [NSScrollView frameSizeForContentSize:packFrame.size hasHorizontalScroller:[scroll_view hasHorizontalScroller] hasVerticalScroller:[scroll_view hasVerticalScroller] borderType:[scroll_view borderType]]; @@ -467,77 +505,25 @@ AUPluginUI::parent_cocoa_window () // frame but size equal to the size of the new view NSRect newFrame; newFrame.origin = [scroll_view frame].origin; - newFrame.size = frameSize; + newFrame.size = packFrame.size; // Set the new frame and document views on the scroll view - NSRect currentFrame = [scroll_view frame]; [scroll_view setFrame:newFrame]; [scroll_view setDocumentView:au_view]; - cerr << "scroll view size is " << newFrame.size.width << " x " << newFrame.size.height << endl; - - NSSize oldContentSize = [[cocoa_window contentView] frame].size; - NSSize newContentSize = oldContentSize; - - cerr << "original size is " << newContentSize.width << " x " << newContentSize.height << endl; - - newContentSize.width += (newFrame.size.width - currentFrame.size.width); - newContentSize.height += (newFrame.size.height - currentFrame.size.height); - -#ifdef PACK_COCOA_INTO_GTK_WINDOW - NSView* view = [win contentView]; + packView = scroll_view; - [win setContentSize:newContentSize]; - [view addSubview:scroll_view]; -#else - [cocoa_window setContentSize:newContentSize]; - [cocoa_window setContentView:scroll_view]; -#endif - } else { -#ifdef PACK_COCOA_INTO_GTK_WINDOW - NSView* view = [win contentView]; - - [win setContentSize:au_view_frame.size]; - [view addSubview:au_view]; -#else - [cocoa_window setContentSize:au_view_frame.size]; - [cocoa_window setContentView:au_view]; -#endif - + packView = au_view; } - /* compute how tall the title bar is, because we have to offset the position of the child window - by that much. - */ - - NSRect content_frame = [NSWindow contentRectForFrameRect:[win frame] styleMask:[win styleMask]]; - NSRect wm_frame = [NSWindow frameRectForContentRect:content_frame styleMask:[win styleMask]]; - int titlebar_height = wm_frame.size.height - content_frame.size.height; - - // move cocoa window into position relative to the toplevel window - - NSRect view_frame = [[cocoa_window contentView] frame]; - view_frame.origin.x = content_frame.origin.x; - view_frame.origin.y = content_frame.origin.y; - - [cocoa_window setFrame:view_frame display:NO]; - - /* make top level window big enough to hold cocoa window and titlebar */ - - content_frame.size.width = view_frame.size.width; - content_frame.size.height = view_frame.size.height + titlebar_height; - - [win setFrame:content_frame display:NO]; - - /* now make cocoa window a child of this top level */ + NSView* view = gdk_quartz_window_get_nsview (low_box.get_window()->gobj()); - [win addChildWindow:cocoa_window ordered:NSWindowAbove]; - [win setLevel:NSFloatingWindowLevel]; - [win setHidesOnDeactivate:YES]; + [view setFrame:packFrame]; + [view addSubview:packView]; - cocoa_parented = true; + low_box.set_size_request (packFrame.size.width, packFrame.size.height); return 0; } @@ -547,16 +533,21 @@ AUPluginUI::on_realize () { VBox::on_realize (); + /* our windows should not have that resize indicator */ + + NSWindow* win = get_nswindow (); + if (win) { + [win setShowsResizeIndicator:NO]; + } +} + +void +AUPluginUI::lower_box_realized () +{ if (au_view) { - - if (parent_cocoa_window ()) { - } - + parent_cocoa_window (); } else if (carbon_window) { - - if (parent_carbon_window ()) { - // ShowWindow (carbon_window); - } + parent_carbon_window (); } } @@ -572,12 +563,15 @@ AUPluginUI::on_map_event (GdkEventAny* ev) { cerr << "AU plugin map event\n"; - if (au_view) { - show_all (); - } else if (carbon_window) { - [cocoa_parent setIsVisible:YES]; - ShowWindow (carbon_window); + if (carbon_window) { + + // move top level GTK window to the correct level + // to keep the stack together and not be sliceable + + NSWindow* win = get_nswindow (); + // [win setLevel:NSFloatingWindowLevel]; } + return false; } @@ -588,6 +582,8 @@ AUPluginUI::on_show () VBox::on_show (); + gtk_widget_realize (GTK_WIDGET(low_box.gobj())); + if (au_view) { show_all (); } else if (carbon_window) { @@ -629,3 +625,4 @@ AUPluginUI::on_focus_out_event (GdkEventFocus* ev) cerr << "au plugin focus out\n"; return false; } + diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 43862c9d0b..787f70a993 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "ardour_ui.h" @@ -854,11 +855,12 @@ AudioClock::field_key_release_event (GdkEventKey *ev, Field field) case Bars: case Beats: case Ticks: - // Bars or beats should never be 0 - if (atoi(bars_label.get_text()) == 0) { + // Bars should never be, unless this clock is for a duration + if (atoi(bars_label.get_text()) == 0 && !is_duration) { bars_label.set_text("001"); } - if (atoi(beats_label.get_text()) == 0) { + // beats should never be 0, unless this clock is for a duration + if (atoi(beats_label.get_text()) == 0 && !is_duration) { beats_label.set_text("01"); } break; @@ -1881,7 +1883,9 @@ AudioClock::build_ops_menu () MenuList& ops_items = ops_menu->items(); ops_menu->set_name ("ArdourContextMenu"); - ops_items.push_back (MenuElem (_("Timecode"), bind (mem_fun(*this, &AudioClock::set_mode), SMPTE))); + if (!Profile->get_sae()) { + ops_items.push_back (MenuElem (_("Timecode"), bind (mem_fun(*this, &AudioClock::set_mode), SMPTE))); + } ops_items.push_back (MenuElem (_("Bars:Beats"), bind (mem_fun(*this, &AudioClock::set_mode), BBT))); ops_items.push_back (MenuElem (_("Minutes:Seconds"), bind (mem_fun(*this, &AudioClock::set_mode), MinSec))); ops_items.push_back (MenuElem (_("Samples"), bind (mem_fun(*this, &AudioClock::set_mode), Frames))); diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index ea98bae1ed..901b52ec1d 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -123,7 +123,7 @@ AudioRegionView::init (Gdk::Color& basic_color, bool wfd) // FIXME: Some redundancy here with RegionView::init. Need to figure out // where order is important and where it isn't... - RegionView::init(basic_color, false); + RegionView::init (basic_color, wfd); XMLNode *node; @@ -808,7 +808,7 @@ AudioRegionView::create_waves () } ChanCount nchans = atv.get_diskstream()->n_channels(); - + /* in tmp_waves, set up null pointers for each channel so the vector is allocated */ for (uint32_t n = 0; n < nchans.n_audio(); ++n) { tmp_waves.push_back (0); @@ -823,6 +823,14 @@ AudioRegionView::create_waves () wave_caches.push_back (WaveView::create_cache ()); if (wait_for_data) { + if (audio_region()->audio_source(n)->peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n), data_ready_connection)) { + create_one_wave (n, true); + } else { + // we'll get a PeaksReady signal from the source in the future + // and will call create_one_wave(n) then. + } + + } else { create_one_wave (n, true); } @@ -917,8 +925,8 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct) void AudioRegionView::peaks_ready_handler (uint32_t which) { - //Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun(*this, &AudioRegionView::create_one_wave), which, false)); - cerr << "AudioRegionView::peaks_ready_handler() called on " << which << " this: " << this << endl; + Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun(*this, &AudioRegionView::create_one_wave), which, false)); + // cerr << "AudioRegionView::peaks_ready_handler() called on " << which << " this: " << this << endl; } void diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 30ab8304a6..01ec7c95ce 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -58,7 +58,7 @@ class AudioRegionView : public RegionView ~AudioRegionView (); - virtual void init (Gdk::Color& base_color, bool wait_for_data = false); + virtual void init (Gdk::Color& base_color, bool wait_for_data); boost::shared_ptr audio_region() const; diff --git a/gtk2_ardour/cocoacarbon.mm b/gtk2_ardour/cocoacarbon.mm index 6317cec6c6..75141d34f6 100644 --- a/gtk2_ardour/cocoacarbon.mm +++ b/gtk2_ardour/cocoacarbon.mm @@ -24,7 +24,7 @@ #include "ardour_ui.h" #include "actions.h" #include "opts.h" -#include "sync-menu.h" +#include #include diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 6d7e291b0e..c5e34c38de 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -175,6 +175,7 @@ Gdk::Cursor* Editor::cross_hair_cursor = 0; Gdk::Cursor* Editor::selector_cursor = 0; Gdk::Cursor* Editor::trimmer_cursor = 0; Gdk::Cursor* Editor::grabber_cursor = 0; +Gdk::Cursor* Editor::grabber_edit_point_cursor = 0; Gdk::Cursor* Editor::zoom_cursor = 0; Gdk::Cursor* Editor::time_fx_cursor = 0; Gdk::Cursor* Editor::fader_cursor = 0; @@ -300,6 +301,8 @@ Editor::Editor () verbose_cursor_on = true; route_removal = false; show_automatic_regions_in_region_list = true; + last_item_entered = 0; + last_item_entered_n = 0; region_list_sort_type = (Editing::RegionListSortType) 0; have_pending_keyboard_selection = false; @@ -344,6 +347,7 @@ Editor::Editor () zoomed_to_region = false; rhythm_ferret = 0; + _scrubbing = false; scrubbing_direction = 0; sfbrowser = 0; @@ -1170,7 +1174,7 @@ Editor::connect_to_session (Session *t) session_connections.push_back (session->TransportStateChange.connect (mem_fun(*this, &Editor::map_transport_state))); session_connections.push_back (session->PositionChanged.connect (mem_fun(*this, &Editor::map_position_change))); session_connections.push_back (session->RouteAdded.connect (mem_fun(*this, &Editor::handle_new_route))); - session_connections.push_back (session->RegionAdded.connect (mem_fun(*this, &Editor::handle_new_region))); + session_connections.push_back (session->RegionsAdded.connect (mem_fun(*this, &Editor::handle_new_regions))); session_connections.push_back (session->RegionRemoved.connect (mem_fun(*this, &Editor::handle_region_removed))); session_connections.push_back (session->DurationChanged.connect (mem_fun(*this, &Editor::handle_new_duration))); session_connections.push_back (session->edit_group_added.connect (mem_fun(*this, &Editor::add_edit_group))); @@ -1340,8 +1344,15 @@ Editor::build_cursors () Gdk::Color c; transparent_cursor = new Gdk::Cursor (bits, bits, c, c, 0, 0); } + grabber_cursor = new Gdk::Cursor (HAND2); + + { + Glib::RefPtr grabber_edit_point_pixbuf (::get_icon ("grabber_edit_point")); + grabber_edit_point_cursor = new Gdk::Cursor (Gdk::Display::get_default(), grabber_edit_point_pixbuf, 5, 17); + } + cross_hair_cursor = new Gdk::Cursor (CROSSHAIR); trimmer_cursor = new Gdk::Cursor (SB_H_DOUBLE_ARROW); selector_cursor = new Gdk::Cursor (XTERM); @@ -1821,7 +1832,7 @@ Editor::add_region_context_items (StreamView* sv, boost::shared_ptr regi bbt_glue_item->set_active (true); break; default: - bbt_glue_item->set_active (true); + bbt_glue_item->set_active (false); break; } @@ -2212,6 +2223,8 @@ Editor::set_edit_point_preference (EditPoint ep) edit_point_selector.set_active_text (str); } + set_canvas_cursor (); + if (!changed) { return; } @@ -2238,7 +2251,7 @@ Editor::set_edit_point_preference (EditPoint ep) break; } } - + instant_save (); } @@ -2817,8 +2830,9 @@ Editor::setup_toolbar () mouse_mode_button_box.set_homogeneous(true); vector edit_mode_strings; - edit_mode_strings.push_back (edit_mode_to_string (Splice)); edit_mode_strings.push_back (edit_mode_to_string (Slide)); + edit_mode_strings.push_back (edit_mode_to_string (Splice)); + edit_mode_strings.push_back (edit_mode_to_string (Lock)); edit_mode_selector.set_name ("EditModeSelector"); Gtkmm2ext::set_size_request_to_display_given_text (edit_mode_selector, longest (edit_mode_strings).c_str(), 2+FUDGE, 10); @@ -3309,12 +3323,12 @@ Editor::duplicate_dialog (bool with_dialog) } } + RegionSelection rs; + get_regions_for_action (rs); if (mouse_mode != MouseRange) { - ensure_entered_region_selected (true); - - if (selection->regions.empty()) { + if (rs.empty()) { return; } } @@ -3365,7 +3379,7 @@ Editor::duplicate_dialog (bool with_dialog) if (mouse_mode == MouseRange) { duplicate_selection (times); } else { - duplicate_some_regions (selection->regions, times); + duplicate_some_regions (rs, times); } } @@ -3425,6 +3439,9 @@ Editor::cycle_edit_mode () Config->set_edit_mode (Splice); break; case Splice: + Config->set_edit_mode (Lock); + break; + case Lock: Config->set_edit_mode (Slide); break; } @@ -3444,6 +3461,8 @@ Editor::edit_mode_selection_done () mode = Splice; } else if (choice == _("Slide Edit")) { mode = Slide; + } else if (choice == _("Lock Edit")) { + mode = Lock; } Config->set_edit_mode (mode); @@ -4499,10 +4518,9 @@ Editor::set_punch_range (nframes_t start, nframes_t end, string cmd) commit_reversible_command (); } -RegionSelection -Editor::get_regions_at (nframes64_t where, const TrackSelection& ts) const +void +Editor::get_regions_at (RegionSelection& rs, nframes64_t where, const TrackSelection& ts) const { - RegionSelection rs; const TrackSelection* tracks; if (ts.empty()) { @@ -4536,15 +4554,11 @@ Editor::get_regions_at (nframes64_t where, const TrackSelection& ts) const } } } - - return rs; } - -RegionSelection -Editor::get_regions_after (nframes64_t where, const TrackSelection& ts) const +void +Editor::get_regions_after (RegionSelection& rs, nframes64_t where, const TrackSelection& ts) const { - RegionSelection rs; const TrackSelection* tracks; if (ts.empty()) { @@ -4578,20 +4592,61 @@ Editor::get_regions_after (nframes64_t where, const TrackSelection& ts) const } } } - - return rs; } -RegionSelection& -Editor::get_regions_for_action () +void +Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered) { - if (!selection->regions.empty()) { - return selection->regions; - } + bool use_regions_at = true; - nframes64_t where = get_preferred_edit_position(); - tmp_regions = get_regions_at (where, selection->tracks); - return tmp_regions; + if (selection->regions.empty()) { + + if (selection->tracks.empty()) { + + /* no regions or tracks selected, but entered regionview is valid + and we're in object mode - just use entered regionview + */ + + if (entered_regionview && (mouse_mode == Editing::MouseObject)) { + rs.add (entered_regionview); + return; + } + + } else { + + /* no regions selected, so get all regions at the edit point across + all selected tracks. + */ + + nframes64_t where = get_preferred_edit_position(); + get_regions_at (rs, where, selection->tracks); + + /* if the entered regionview wasn't selected and neither was its track + then add it. + */ + + if (entered_regionview != 0 && + !selection->selected (entered_regionview) && + !selection->selected (&entered_regionview->get_time_axis_view())) { + rs.add (entered_regionview); + } + } + + } else { + + /* just use the selected regions */ + + rs = selection->regions; + + /* if the entered regionview wasn't selected and we allow this sort of thing, + then add it. + */ + + if (allow_entered && entered_regionview && !selection->selected (entered_regionview)) { + rs.add (entered_regionview); + } + + } } void diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index acd18c211e..4f545385f1 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -472,7 +472,7 @@ class Editor : public PublicEditor void hide_marker (ArdourCanvas::Item*, GdkEvent*); void clear_marker_display (); - void mouse_add_new_marker (nframes_t where, bool is_cd=false); + void mouse_add_new_marker (nframes_t where, bool is_cd=false, bool is_xrun=false); void update_cd_marker_display (); void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location); @@ -555,6 +555,8 @@ class Editor : public PublicEditor Gtk::VBox vpacker; Gdk::Cursor* current_canvas_cursor; + void set_canvas_cursor (); + Gdk::Cursor* which_grabber_cursor (); ArdourCanvas::CanvasAA track_canvas; ArdourCanvas::CanvasAA time_canvas; @@ -960,6 +962,7 @@ class Editor : public PublicEditor static Gdk::Cursor* trimmer_cursor; static Gdk::Cursor* selector_cursor; static Gdk::Cursor* grabber_cursor; + static Gdk::Cursor* grabber_edit_point_cursor; static Gdk::Cursor* zoom_cursor; static Gdk::Cursor* time_fx_cursor; static Gdk::Cursor* fader_cursor; @@ -999,8 +1002,10 @@ class Editor : public PublicEditor int ensure_cursor (nframes_t* pos); void handle_new_region (boost::weak_ptr); + void handle_new_regions (vector >& ); void handle_region_removed (boost::weak_ptr); void add_region_to_region_display (boost::shared_ptr); + void add_regions_to_region_display (std::vector > & ); void region_hidden (boost::shared_ptr); void redisplay_regions (); void insert_into_tmp_regionlist(boost::shared_ptr); @@ -1031,7 +1036,7 @@ class Editor : public PublicEditor void split_region_at (nframes_t); void split_regions_at (nframes_t, RegionSelection&); void split_region_at_transients (); - void split_region_at_points (boost::shared_ptr, ARDOUR::AnalysisFeatureList&); + void split_region_at_points (boost::shared_ptr, ARDOUR::AnalysisFeatureList&, bool can_ferret); void crop_region_to_selection (); void crop_region_to (nframes_t start, nframes_t end); void set_sync_point (nframes64_t, const RegionSelection&); @@ -1088,7 +1093,7 @@ class Editor : public PublicEditor void keyboard_insert_region_list_selection (); void region_from_selection (); - void create_region_from_selection (std::vector >&); + void create_region_from_selection (std::vector >&); void play_from_start (); void play_from_edit_point (); @@ -1120,6 +1125,8 @@ class Editor : public PublicEditor void add_external_audio_action (Editing::ImportMode); void external_audio_dialog (); + + int check_whether_and_how_to_import(string, bool all_or_nothing = true); bool check_multichannel_status (const std::vector& paths); SoundFileOmega* sfbrowser; @@ -1132,7 +1139,7 @@ class Editor : public PublicEditor bool idle_do_embed (vector paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&); int import_sndfiles (vector paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos, - int target_regions, int target_tracks, boost::shared_ptr&); + int target_regions, int target_tracks, boost::shared_ptr&, bool); int embed_sndfiles (vector paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode, nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr&); @@ -1354,6 +1361,14 @@ class Editor : public PublicEditor bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); + + + // These variables are used to detect a feedback loop and break it to avoid a gui hang +private: + ArdourCanvas::Item *last_item_entered; + int last_item_entered_n; +public: + bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*); bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*); bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*); @@ -1652,6 +1667,7 @@ class Editor : public PublicEditor void drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event); void end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event); + ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect; ArdourCanvas::SimpleRect* range_bar_drag_rect; ArdourCanvas::SimpleRect* transport_bar_drag_rect; ArdourCanvas::Line* marker_drag_line; @@ -2120,18 +2136,7 @@ class Editor : public PublicEditor TimeAxisView* entered_track; RegionView* entered_regionview; - class ExclusiveRegionSelection { - public: - ExclusiveRegionSelection (Editor&, RegionView*); - ~ExclusiveRegionSelection (); - private: - Editor& editor; - RegionView* regionview; - bool remove; - }; - - void ensure_entered_region_selected (bool op_acts_on_objects = false); void ensure_entered_track_selected (bool op_acts_on_objects = false); bool clear_entered_track; gint left_track_canvas (GdkEventCrossing*); @@ -2175,12 +2180,10 @@ class Editor : public PublicEditor bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const; - RegionSelection get_regions_at (nframes64_t where, const TrackSelection& ts) const; - RegionSelection get_regions_after (nframes64_t where, const TrackSelection& ts) const; + void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const; + void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const; - RegionSelection tmp_regions; - - RegionSelection& get_regions_for_action (); + void get_regions_for_action (RegionSelection&, bool allowed_entered_regionview = false); sigc::connection fast_screen_update_connection; gint start_updating (); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 3627a7fe23..28c15a4a62 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -206,6 +206,11 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "nudge-next-backward", _("Nudge Next Backward"), bind (mem_fun(*this, &Editor::nudge_backward), true, false)); ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "nudge-playhead-forward", _("Nudge Playhead Forward"), bind (mem_fun(*this, &Editor::nudge_forward), false, true)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, true)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("Zoom Out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true)); ActionManager::session_sensitive_actions.push_back (act); @@ -441,6 +446,7 @@ Editor::register_actions () ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), bind (mem_fun (*this, &Editor::set_edit_mode), Splice)); ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), bind (mem_fun (*this, &Editor::set_edit_mode), Slide)); + ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), bind (mem_fun (*this, &Editor::set_edit_mode), Lock)); ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Toggle Edit Mode"), mem_fun (*this, &Editor::cycle_edit_mode)); ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap To")); diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index ff91dc227c..b0c8b25b50 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -43,6 +43,7 @@ #include #include #include +#include #include #include "ardour_ui.h" @@ -115,60 +116,139 @@ Editor::external_audio_dialog () sfbrowser->show_all (); - again: - int response = sfbrowser->run (); - switch (response) { - case RESPONSE_APPLY: - // leave the dialog open - break; + bool keepRunning; - case RESPONSE_OK: - sfbrowser->hide (); - break; + do { + keepRunning = false; - default: - // cancel from the browser - we are done - sfbrowser->hide (); - return; + int response = sfbrowser->run (); + + switch (response) { + case RESPONSE_APPLY: + // leave the dialog open + break; + + case RESPONSE_OK: + sfbrowser->hide (); + break; + + default: + // cancel from the browser - we are done + sfbrowser->hide (); + return; + } + + /* lets do it */ + + paths = sfbrowser->get_paths (); + + ImportPosition pos = sfbrowser->get_position (); + ImportMode mode = sfbrowser->get_mode (); + ImportDisposition chns = sfbrowser->get_channel_disposition (); + nframes64_t where; + + switch (pos) { + case ImportAtEditPoint: + where = get_preferred_edit_position (); + break; + case ImportAtTimestamp: + where = -1; + break; + case ImportAtPlayhead: + where = playhead_cursor->current_frame; + break; + case ImportAtStart: + where = session->current_start_frame(); + break; + } + + SrcQuality quality = sfbrowser->get_src_quality(); + + + if (sfbrowser->copy_files_btn.get_active()) { + do_import (paths, chns, mode, quality, where); + } else { + do_embed (paths, chns, mode, where); + } + + if (response == RESPONSE_APPLY) { + sfbrowser->clear_selection (); + keepRunning = true; + } + + } while (keepRunning); +} + +typedef std::map > SourceMap; + +/** + * Updating is still disabled, see note in libs/ardour/import.cc Session::import_audiofiles() + * + * all_or_nothing: + * true = show "Update", "Import" and "Skip" + * false = show "Import", and "Cancel" + * + * Returns: + * 0 To update an existing source of the same name + * 1 To import/embed the file normally (make sure the new name will be unique) + * 2 If the user wants to skip this file + **/ +int +Editor::check_whether_and_how_to_import(string path, bool all_or_nothing) +{ + string wave_name (Glib::path_get_basename(path)); + + SourceMap all_sources = session->get_sources(); + bool wave_name_exists = false; + + for (SourceMap::iterator i = all_sources.begin(); i != all_sources.end(); ++i) { + boost::shared_ptr afs = boost::dynamic_pointer_cast(i->second); + + string tmp (Glib::path_get_basename (afs->path())); + + if (tmp == wave_name) { + wave_name_exists = true; + break; + } } - /* lets do it */ - - paths = sfbrowser->get_paths (); + int function = 1; - ImportPosition pos = sfbrowser->get_position (); - ImportMode mode = sfbrowser->get_mode (); - ImportDisposition chns = sfbrowser->get_channel_disposition (); - nframes64_t where; - switch (pos) { - case ImportAtEditPoint: - where = get_preferred_edit_position (); - break; - case ImportAtTimestamp: - where = -1; - break; - case ImportAtPlayhead: - where = playhead_cursor->current_frame; - break; - case ImportAtStart: - where = session->current_start_frame(); - break; + if (wave_name_exists) { + string message; + if (all_or_nothing) { + // updating is still disabled + //message = string_compose(_("The session already contains a source file named %1. Do you want to update that file (and thus all regions using the file) or import this file as a new file?"),wave_name); + message = string_compose(_("The session already contains a source file named %1. This file will be imported as a new file, please confirm."),wave_name); + } else { + message = _("Lorem ipsum. Do you want to skidaddle?"); + + } + MessageDialog dialog(message, false,Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true); + + if (all_or_nothing) { + // disabled + //dialog.add_button("Update", 0); + dialog.add_button("Import", 1); + dialog.add_button("Skip", 2); + } else { + dialog.add_button("Import", 1); + dialog.add_button("Cancel", 2); + } + + + //dialog.add_button("Skip all", 4); // All or rest? + + dialog.show(); + + function = dialog.run (); + + dialog.hide(); } - SrcQuality quality = sfbrowser->get_src_quality(); - - if (sfbrowser->copy_files_btn.get_active()) { - do_import (paths, chns, mode, quality, where); - } else { - do_embed (paths, chns, mode, where); - } - - if (response == RESPONSE_APPLY) { - sfbrowser->clear_selection (); - goto again; - } + return function; } boost::shared_ptr @@ -206,79 +286,107 @@ Editor::do_import (vector paths, ImportDisposition chns, ImportMode mod { boost::shared_ptr track; vector to_import; - bool ok = false; + bool ok = true; int nth = 0; if (interthread_progress_window == 0) { build_interthread_progress_window (); } - switch (chns) { - case Editing::ImportDistinctFiles: - for (vector::iterator a = paths.begin(); a != paths.end(); ++a) { - to_import.clear (); - to_import.push_back (*a); - - if (mode == Editing::ImportToTrack) { - track = get_nth_selected_audio_track (nth++); - } - - if (import_sndfiles (to_import, mode, quality, pos, 1, -1, track)) { - goto out; - } - - } - break; - - case Editing::ImportDistinctChannels: - for (vector::iterator a = paths.begin(); a != paths.end(); ++a) { - - to_import.clear (); - to_import.push_back (*a); - - if (import_sndfiles (to_import, mode, quality, pos, -1, -1, track)) { - goto out; - } - - } - break; - - case Editing::ImportMergeFiles: + if (chns == Editing::ImportMergeFiles) { /* create 1 region from all paths, add to 1 track, ignore "track" */ - if (import_sndfiles (paths, mode, quality, pos, 1, 1, track)) { - goto out; + bool cancel = false; + for (vector::iterator a = paths.begin(); a != paths.end() && ok; ++a) { + int check = check_whether_and_how_to_import(*a, false); + if (check == 2) { + cancel = true; + break; + } } - break; - case Editing::ImportSerializeFiles: - for (vector::iterator a = paths.begin(); a != paths.end(); ++a) { + if (!cancel) { + if (import_sndfiles (paths, mode, quality, pos, 1, 1, track, false)) { + ok = false; + } + } - to_import.clear (); - to_import.push_back (*a); - - /* create 1 region from this path, add to 1 track, - reuse "track" across paths - */ + } else { + bool replace = false; - if (import_sndfiles (to_import, mode, quality, pos, 1, 1, track)) { - goto out; + for (vector::iterator a = paths.begin(); a != paths.end() && ok; ++a) { + + int check = check_whether_and_how_to_import(*a, true); + + if (check == 2 ) { + // skip + continue; } + if (check == 0) { + fatal << "Updating existing sources should be disabled!" << endl; + replace = true; + } else if (check == 1) { + replace = false; + } + + + switch (chns) { + case Editing::ImportDistinctFiles: + + to_import.clear (); + to_import.push_back (*a); + + if (mode == Editing::ImportToTrack) { + track = get_nth_selected_audio_track (nth++); + } + + if (import_sndfiles (to_import, mode, quality, pos, 1, -1, track, replace)) { + ok = false; + } + + break; + + case Editing::ImportDistinctChannels: + + to_import.clear (); + to_import.push_back (*a); + + if (import_sndfiles (to_import, mode, quality, pos, -1, -1, track, replace)) { + ok = false; + } + + break; + + case Editing::ImportSerializeFiles: + + to_import.clear (); + to_import.push_back (*a); + + /* create 1 region from this path, add to 1 track, + reuse "track" across paths + */ + + if (import_sndfiles (to_import, mode, quality, pos, 1, 1, track, replace)) { + ok = false; + } + + break; + + case Editing::ImportMergeFiles: + // Not entered + break; + } } - break; - } - ok = true; - - out: - if (ok) { - session->save_state (""); - } + if (ok) { + session->save_state (""); + } - interthread_progress_window->hide_all (); + interthread_progress_window->hide_all (); + } } bool @@ -366,7 +474,7 @@ Editor::_do_embed (vector paths, ImportDisposition chns, ImportMode mod int Editor::import_sndfiles (vector paths, ImportMode mode, SrcQuality quality, nframes64_t& pos, - int target_regions, int target_tracks, boost::shared_ptr& track) + int target_regions, int target_tracks, boost::shared_ptr& track, bool replace) { WindowTitle title = string_compose (_("importing %1"), paths.front()); @@ -383,6 +491,7 @@ Editor::import_sndfiles (vector paths, ImportMode mode, SrcQuality qual import_status.freeze = false; import_status.done = 0.0; import_status.quality = quality; + import_status.replace_existing_source = replace; interthread_progress_connection = Glib::signal_timeout().connect (bind (mem_fun(*this, &Editor::import_progress_timeout), (gpointer) 0), 100); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index a2df1783aa..e54109c7d6 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -203,6 +203,10 @@ Editor::initialize_canvas () transport_marker_bar->property_outline_what() = (0x1 | 0x8); transport_marker_bar->property_outline_pixels() = 1; + cd_marker_bar_drag_rect = new ArdourCanvas::SimpleRect (*cd_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); + cd_marker_bar_drag_rect->property_outline_pixels() = 0; + cd_marker_bar_drag_rect->hide (); + range_bar_drag_rect = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); range_bar_drag_rect->property_outline_pixels() = 0; range_bar_drag_rect->hide (); @@ -343,16 +347,16 @@ Editor::track_canvas_size_allocated () (*x)->set_line_vpos (y1, canvas_height); } - range_marker_drag_rect->property_y1() = 0.0; - range_marker_drag_rect->property_y2() = canvas_height; - transport_loop_range_rect->property_y1() = 0.0; - transport_loop_range_rect->property_y2() = canvas_height; - transport_punch_range_rect->property_y1() = 0.0; - transport_punch_range_rect->property_y2() = canvas_height; - transport_punchin_line->property_y1() = 0.0; - transport_punchin_line->property_y2() = canvas_height; - transport_punchout_line->property_y1() = 0.0; - transport_punchout_line->property_y2() = canvas_height; + range_marker_drag_rect->property_y1() = y1; + range_marker_drag_rect->property_y2() = full_canvas_height; + transport_loop_range_rect->property_y1() = y1; + transport_loop_range_rect->property_y2() = full_canvas_height; + transport_punch_range_rect->property_y1() = y1; + transport_punch_range_rect->property_y2() = full_canvas_height; + transport_punchin_line->property_y1() = y1; + transport_punchin_line->property_y2() = full_canvas_height; + transport_punchout_line->property_y1() = y1; + transport_punchout_line->property_y2() = full_canvas_height; update_fixed_rulers(); redisplay_tempo (true); @@ -730,15 +734,15 @@ Editor::tie_vertical_scrolling () playhead_cursor->set_y_axis (y1); range_marker_drag_rect->property_y1() = y1; - range_marker_drag_rect->property_y2() = y1 + canvas_height; + range_marker_drag_rect->property_y2() = full_canvas_height; transport_loop_range_rect->property_y1() = y1; - transport_loop_range_rect->property_y2() = y1 + canvas_height; + transport_loop_range_rect->property_y2() = full_canvas_height; transport_punch_range_rect->property_y1() = y1; - transport_punch_range_rect->property_y2() = y1 + canvas_height; + transport_punch_range_rect->property_y2() = full_canvas_height; transport_punchin_line->property_y1() = y1; - transport_punchin_line->property_y2() = y1 + canvas_height; + transport_punchin_line->property_y2() = full_canvas_height; transport_punchout_line->property_y1() = y1; - transport_punchout_line->property_y2() = y1 + canvas_height; + transport_punchout_line->property_y2() = full_canvas_height; if (!selection->markers.empty()) { for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { @@ -809,6 +813,9 @@ Editor::color_handler() transport_marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportMarkerBar.get(); transport_marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get(); + cd_marker_bar_drag_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragBarRect.get(); + cd_marker_bar_drag_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragBarRect.get(); + range_bar_drag_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragBarRect.get(); range_bar_drag_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragBarRect.get(); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 13e8f49d61..084f75124d 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -388,13 +388,20 @@ Editor::LocationMarkers::set_color_rgba (uint32_t rgba) } void -Editor::mouse_add_new_marker (nframes_t where, bool is_cd) +Editor::mouse_add_new_marker (nframes_t where, bool is_cd, bool is_xrun) { - string markername; + string markername, markerprefix; int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark); - + + if (is_xrun) { + markerprefix = "xrun"; + flags = Location::IsMark; + } else { + markerprefix = "mark"; + } + if (session) { - session->locations()->next_available_name(markername,"mark"); + session->locations()->next_available_name(markername, markerprefix); Location *location = new Location (where, where, markername, (Location::Flags) flags); session->begin_reversible_command (_("add marker")); XMLNode &before = session->locations()->get_state(); @@ -1151,6 +1158,10 @@ Editor::update_punch_range_view (bool visibility) void Editor::marker_selection_changed () { + if (session && session->deletion_in_progress()) { + return; + } + for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) { LocationMarkers* lam = i->second; diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index a85c3a4feb..dfa617d082 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -359,7 +359,6 @@ Editor::session_going_away () editor_list_button.set_sensitive(false); /* clear tempo/meter rulers */ - remove_metric_marks (); hide_measures (); clear_marker_display (); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 4234368acd..d4e6a4218f 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -215,6 +215,57 @@ Editor::mouse_mode_toggled (MouseMode m) } } +Gdk::Cursor* +Editor::which_grabber_cursor () +{ + switch (_edit_point) { + case EditAtMouse: + return grabber_edit_point_cursor; + break; + default: + return grabber_cursor; + break; + } +} + +void +Editor::set_canvas_cursor () +{ + switch (mouse_mode) { + case MouseRange: + current_canvas_cursor = selector_cursor; + break; + + case MouseObject: + current_canvas_cursor = which_grabber_cursor(); + break; + + case MouseGain: + current_canvas_cursor = cross_hair_cursor; + break; + + case MouseZoom: + current_canvas_cursor = zoom_cursor; + break; + + case MouseTimeFX: + current_canvas_cursor = time_fx_cursor; // just use playhead + break; + + case MouseAudition: + current_canvas_cursor = speaker_cursor; + break; + + case MouseNote: + set_midi_edit_cursor (current_midi_edit_mode()); + break; + } + + if (is_drawable()) { + track_canvas.get_window()->set_cursor(*current_canvas_cursor); + } +} + void Editor::set_mouse_mode (MouseMode m, bool force) { @@ -266,36 +317,26 @@ Editor::set_mouse_mode (MouseMode m, bool force) switch (mouse_mode) { case MouseRange: mouse_select_button.set_active (true); - current_canvas_cursor = selector_cursor; break; case MouseObject: mouse_move_button.set_active (true); - if (Profile->get_sae()) { - current_canvas_cursor = timebar_cursor; - } else { - current_canvas_cursor = grabber_cursor; - } break; case MouseGain: mouse_gain_button.set_active (true); - current_canvas_cursor = cross_hair_cursor; break; case MouseZoom: mouse_zoom_button.set_active (true); - current_canvas_cursor = zoom_cursor; break; case MouseTimeFX: mouse_timefx_button.set_active (true); - current_canvas_cursor = time_fx_cursor; // just use playhead break; case MouseAudition: mouse_audition_button.set_active (true); - current_canvas_cursor = speaker_cursor; break; case MouseNote: @@ -310,10 +351,8 @@ Editor::set_mouse_mode (MouseMode m, bool force) midi_toolbar_frame.hide(); ignore_mouse_mode_toggle = false; - - if (is_drawable()) { - track_canvas.get_window()->set_cursor(*current_canvas_cursor); - } + + set_canvas_cursor (); } void @@ -904,6 +943,7 @@ bool Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) { nframes_t where = event_frame (event, 0, 0); + AutomationTimeAxisView* atv = 0; /* no action if we're recording */ @@ -1119,14 +1159,14 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case MouseObject: switch (item_type) { case AutomationTrackItem: - dynamic_cast(clicked_axisview)->add_automation_event - (item, - event, - where, - event->button.y); + atv = dynamic_cast(clicked_routeview); + if (atv) { + atv->add_automation_event (item, event, where, event->button.y); + } return true; + break; - + default: break; } @@ -1232,6 +1272,11 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_ Marker * marker; double fraction; + if (last_item_entered != item) { + last_item_entered = item; + last_item_entered_n = 0; + } + switch (item_type) { case ControlPointItem: if (mouse_mode == MouseGain || mouse_mode == MouseObject) { @@ -1247,12 +1292,15 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_ fraction = 1.0 - (cp->get_y() / cp->line().height()); - set_verbose_canvas_cursor (cp->line().get_verbose_cursor_string (fraction), at_x, at_y); - show_verbose_canvas_cursor (); - if (is_drawable() && !_scrubbing) { track_canvas.get_window()->set_cursor (*fader_cursor); } + + last_item_entered_n++; + set_verbose_canvas_cursor (cp->line().get_verbose_cursor_string (fraction), at_x, at_y); + if (last_item_entered_n < 10) { + show_verbose_canvas_cursor (); + } } break; @@ -1303,7 +1351,14 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_ case PlayheadCursorItem: if (is_drawable()) { - track_canvas.get_window()->set_cursor (*grabber_cursor); + switch (_edit_point) { + case EditAtMouse: + track_canvas.get_window()->set_cursor (*grabber_edit_point_cursor); + break; + default: + track_canvas.get_window()->set_cursor (*grabber_cursor); + break; + } } break; @@ -1755,7 +1810,7 @@ Editor::start_grab (GdkEvent* event, Gdk::Cursor *cursor) } if (cursor == 0) { - cursor = grabber_cursor; + cursor = which_grabber_cursor (); } // if dragging with button2, the motion is x constrained, with Alt-button2 it is y constrained @@ -1818,7 +1873,7 @@ Editor::swap_grab (ArdourCanvas::Item* new_item, Gdk::Cursor* cursor, uint32_t t drag_info.item = new_item; if (cursor == 0) { - cursor = grabber_cursor; + cursor = which_grabber_cursor (); } drag_info.item->grab (Gdk::POINTER_MOTION_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK, *cursor, time); @@ -1965,6 +2020,7 @@ Editor::fade_in_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* even XMLNode &before = alist->get_state(); tmp->audio_region()->set_fade_in_length (fade_length); + tmp->audio_region()->set_fade_in_active (true); XMLNode &after = alist->get_state(); session->add_command(new MementoCommand(*alist.get(), &before, &after)); @@ -2081,6 +2137,7 @@ Editor::fade_out_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* eve XMLNode &before = alist->get_state(); tmp->audio_region()->set_fade_out_length (fade_length); + tmp->audio_region()->set_fade_out_active (true); XMLNode &after = alist->get_state(); session->add_command(new MementoCommand(*alist.get(), &before, &after)); @@ -3361,30 +3418,34 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) the region would be if we moved it by that much. */ - if (drag_info.move_threshold_passed) { + if ( drag_info.move_threshold_passed ) { if (drag_info.current_pointer_frame > drag_info.pointer_frame_offset) { nframes_t sync_frame; nframes_t sync_offset; int32_t sync_dir; - + pending_region_position = drag_info.current_pointer_frame - drag_info.pointer_frame_offset; sync_offset = rv->region()->sync_offset (sync_dir); - sync_frame = rv->region()->adjust_to_sync (pending_region_position); - /* we snap if the snap modifier is not enabled. + /* we don't handle a sync point that lies before zero. */ + if (sync_dir >= 0 || (sync_dir < 0 && pending_region_position >= sync_offset)) { + sync_frame = pending_region_position + (sync_dir*sync_offset); + + /* we snap if the snap modifier is not enabled. + */ - if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) { - snap_to (sync_frame); - } + if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) { + snap_to (sync_frame); + } - if (sync_frame - sync_offset <= sync_frame) { - pending_region_position = sync_frame - (sync_dir*sync_offset); + pending_region_position = rv->region()->adjust_to_sync (sync_frame); + } else { - pending_region_position = 0; + pending_region_position = drag_info.last_frame_position; } } else { @@ -3397,7 +3458,8 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) // printf ("3: pending_region_position= %lu %lu\n", pending_region_position, drag_info.last_frame_position ); - if (pending_region_position != drag_info.last_frame_position && !drag_info.x_constrained) { + bool x_move_allowed = ( !drag_info.x_constrained && (Config->get_edit_mode() != Lock)) || ( drag_info.x_constrained && (Config->get_edit_mode() == Lock)) ; + if ( pending_region_position != drag_info.last_frame_position && x_move_allowed ) { /* now compute the canvas unit distance we need to move the regionview to make it appear at the new location. @@ -3420,7 +3482,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) x_delta = 0; } - + /************************************************************* PREPARE TO MOVE ************************************************************/ @@ -4150,7 +4212,7 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event) /* lets try to create new Region for the selection */ - vector > new_regions; + vector > new_regions; create_region_from_selection (new_regions); if (new_regions.empty()) { @@ -4904,7 +4966,23 @@ Editor::drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event) { nframes_t start = 0; nframes_t end = 0; - ArdourCanvas::SimpleRect *crect = (range_marker_op == CreateRangeMarker) ? range_bar_drag_rect: transport_bar_drag_rect; + ArdourCanvas::SimpleRect *crect; + + switch (range_marker_op) { + case CreateRangeMarker: + crect = range_bar_drag_rect; + break; + case CreateTransportMarker: + crect = transport_bar_drag_rect; + break; + case CreateCDMarker: + crect = cd_marker_bar_drag_rect; + break; + default: + cerr << "Error: unknown range marker op passed to Editor::drag_range_markerbar_op ()" << endl; + return; + break; + } if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) { snap_to (drag_info.current_pointer_frame); @@ -4991,9 +5069,11 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event) session->locations()->next_available_name(rangename,"unnamed"); if (range_marker_op == CreateCDMarker) { flags = Location::IsRangeMarker|Location::IsCDMarker; + cd_marker_bar_drag_rect->hide(); } else { flags = Location::IsRangeMarker; + range_bar_drag_rect->hide(); } newloc = new Location(temp_location->start(), temp_location->end(), rangename, (Location::Flags) flags); session->locations()->add (newloc, true); @@ -5001,7 +5081,6 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event) session->add_command(new MementoCommand(*(session->locations()), &before, &after)); commit_reversible_command (); - range_bar_drag_rect->hide(); range_marker_drag_rect->hide(); break; } diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index ea9f059fae..bcf1af444f 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -111,6 +111,9 @@ Editor::split_region () void Editor::split_region_at (nframes_t where) { + RegionSelection rs; + + get_regions_for_action (rs); split_regions_at (where, selection->regions); } @@ -364,14 +367,17 @@ Editor::nudge_forward (bool next, bool force_playhead) { nframes_t distance; nframes_t next_distance; + RegionSelection rs; + + get_regions_for_action (rs); if (!session) return; - if (!force_playhead && !selection->regions.empty()) { + if (!force_playhead && !rs.empty()) { begin_reversible_command (_("nudge regions forward")); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { boost::shared_ptr r ((*i)->region()); distance = get_nudge_distance (r->position(), next_distance); @@ -437,14 +443,17 @@ Editor::nudge_backward (bool next, bool force_playhead) { nframes_t distance; nframes_t next_distance; + RegionSelection rs; + + get_regions_for_action (rs); if (!session) return; - if (!force_playhead && !selection->regions.empty()) { + if (!force_playhead && !rs.empty()) { begin_reversible_command (_("nudge regions backward")); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { boost::shared_ptr r ((*i)->region()); distance = get_nudge_distance (r->position(), next_distance); @@ -520,16 +529,19 @@ void Editor::nudge_forward_capture_offset () { nframes_t distance; + RegionSelection rs; + + get_regions_for_action (rs); if (!session) return; - if (!selection->regions.empty()) { + if (!rs.empty()) { begin_reversible_command (_("nudge forward")); distance = session->worst_output_latency(); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { boost::shared_ptr r ((*i)->region()); XMLNode &before = r->playlist()->get_state(); @@ -547,16 +559,19 @@ void Editor::nudge_backward_capture_offset () { nframes_t distance; + RegionSelection rs; + + get_regions_for_action (rs); if (!session) return; - if (!selection->regions.empty()) { + if (!rs.empty()) { begin_reversible_command (_("nudge forward")); distance = session->worst_output_latency(); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { boost::shared_ptr r ((*i)->region()); XMLNode &before = r->playlist()->get_state(); @@ -931,10 +946,14 @@ void Editor::cursor_to_selection_start (Cursor *cursor) { nframes_t pos = 0; + RegionSelection rs; + + get_regions_for_action (rs); + switch (mouse_mode) { case MouseObject: - if (!selection->regions.empty()) { - pos = selection->regions.start(); + if (!rs.empty()) { + pos = rs.start(); } break; @@ -959,11 +978,14 @@ void Editor::cursor_to_selection_end (Cursor *cursor) { nframes_t pos = 0; + RegionSelection rs; + + get_regions_for_action (rs); switch (mouse_mode) { case MouseObject: - if (!selection->regions.empty()) { - pos = selection->regions.end_frame(); + if (!rs.empty()) { + pos = rs.end_frame(); } break; @@ -1137,10 +1159,14 @@ Editor::selected_marker_to_selection_start () return; } + RegionSelection rs; + + get_regions_for_action (rs); + switch (mouse_mode) { case MouseObject: - if (!selection->regions.empty()) { - pos = selection->regions.start(); + if (!rs.empty()) { + pos = rs.start(); } break; @@ -1172,10 +1198,14 @@ Editor::selected_marker_to_selection_end () return; } + RegionSelection rs; + + get_regions_for_action (rs); + switch (mouse_mode) { case MouseObject: - if (!selection->regions.empty()) { - pos = selection->regions.end_frame(); + if (!rs.empty()) { + pos = rs.end_frame(); } break; @@ -1656,14 +1686,15 @@ Editor::temporal_zoom_region () nframes64_t start = max_frames; nframes64_t end = 0; + RegionSelection rs; - ensure_entered_region_selected (true); + get_regions_for_action (rs); - if (selection->regions.empty()) { + if (rs.empty()) { return; } - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { if ((*i)->region()->position() < start) { start = (*i)->region()->position(); } @@ -1853,11 +1884,15 @@ Editor::add_location_from_playhead_cursor () void Editor::add_location_from_audio_region () { - if (selection->regions.empty()) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { return; } - RegionView* rv = *(selection->regions.begin()); + RegionView* rv = *(rs.begin()); boost::shared_ptr region = rv->region(); Location *location = new Location (region->position(), region->last_frame(), region->name(), Location::IsRangeMarker); @@ -2301,8 +2336,12 @@ Editor::play_selection () void Editor::loop_selected_region () { - if (!selection->regions.empty()) { - RegionView *rv = *(selection->regions.begin()); + RegionSelection rs; + + get_regions_for_action (rs); + + if (!rs.empty()) { + RegionView *rv = *(rs.begin()); Location* tll; if ((tll = transport_loop_location()) != 0) { @@ -2380,7 +2419,11 @@ Editor::edit_region () void Editor::rename_region() { - if (selection->regions.empty()) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { return; } @@ -2405,7 +2448,7 @@ Editor::rename_region() d.set_size_request (300, -1); d.set_position (Gtk::WIN_POS_MOUSE); - entry.set_text (selection->regions.front()->region()->name()); + entry.set_text (rs.front()->region()->name()); entry.select_region (0, -1); entry.signal_activate().connect (bind (mem_fun (d, &Dialog::response), RESPONSE_OK)); @@ -2422,7 +2465,7 @@ Editor::rename_region() std::string str = entry.get_text(); strip_whitespace_edges (str); if (!str.empty()) { - selection->regions.front()->region()->set_name (str); + rs.front()->region()->set_name (str); redisplay_regions (); } } @@ -2463,14 +2506,15 @@ Editor::play_selected_region () { nframes64_t start = max_frames; nframes64_t end = 0; + RegionSelection rs; - ExclusiveRegionSelection esr (*this, entered_regionview); - - if (selection->regions.empty()) { + get_regions_for_action (rs); + + if (rs.empty()) { return; } - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { if ((*i)->region()->position() < start) { start = (*i)->region()->position(); } @@ -2560,7 +2604,7 @@ Editor::region_from_selection () } void -Editor::create_region_from_selection (vector >& new_regions) +Editor::create_region_from_selection (vector >& new_regions) { if (selection->time.empty() || selection->tracks.empty()) { return; @@ -2601,13 +2645,17 @@ Editor::create_region_from_selection (vector >& n void Editor::split_multichannel_region () { - if (selection->regions.empty()) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { return; } vector > v; - for (list::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { + for (list::iterator x = rs.begin(); x != rs.end(); ++x) { AudioRegionView* arv = dynamic_cast(*x); @@ -2649,7 +2697,11 @@ Editor::separate_regions_between (const TimeSelection& ts) /* use tracks with selected regions */ - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + RegionSelection rs; + + get_regions_for_action (rs); + + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { TimeAxisView* tv = &(*i)->get_time_axis_view(); if (find (tmptracks.begin(), tmptracks.end(), tv) == tmptracks.end()) { @@ -2763,10 +2815,6 @@ Editor::separate_region_from_selection () TimeSelection ts; ts.push_back (ar); - /* force track selection */ - - ensure_entered_region_selected (); - separate_regions_between (ts); } } @@ -2790,8 +2838,6 @@ Editor::separate_regions_using_location (Location& loc) void Editor::crop_region_to_selection () { - ensure_entered_region_selected (true); - if (!selection->time.empty()) { crop_region_to (selection->time.start(), selection->time.end_frame()); @@ -2885,8 +2931,11 @@ void Editor::region_fill_track () { nframes_t end; + RegionSelection rs; - if (!session || selection->regions.empty()) { + get_regions_for_action (rs); + + if (!session || rs.empty()) { return; } @@ -2894,7 +2943,7 @@ Editor::region_fill_track () begin_reversible_command (_("region fill")); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { boost::shared_ptr region ((*i)->region()); @@ -2975,8 +3024,9 @@ void Editor::set_region_sync_from_edit_point () { nframes64_t where = get_preferred_edit_position (); - ensure_entered_region_selected (true); - set_sync_point (where, selection->regions); + RegionSelection rs; + get_regions_for_action (rs); + set_sync_point (where, rs); } void @@ -3028,11 +3078,16 @@ Editor::remove_region_sync () void Editor::naturalize () { - if (selection->regions.empty()) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { return; } + begin_reversible_command (_("naturalize")); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { XMLNode &before = (*i)->region()->get_state(); (*i)->region()->move_to_natural_position (this); XMLNode &after = (*i)->region()->get_state(); @@ -3044,16 +3099,17 @@ Editor::naturalize () void Editor::align (RegionPoint what) { - ensure_entered_region_selected (); + RegionSelection rs; + get_regions_for_action (rs, false); nframes64_t where = get_preferred_edit_position(); - if (!selection->regions.empty()) { - align_selection (what, where, selection->regions); + if (!rs.empty()) { + align_selection (what, where, rs); } else { RegionSelection rs; - rs = get_regions_at (where, selection->tracks); + get_regions_at (rs, where, selection->tracks); align_selection (what, where, rs); } } @@ -3062,15 +3118,13 @@ void Editor::align_relative (RegionPoint what) { nframes64_t where = get_preferred_edit_position(); + RegionSelection rs; - if (!selection->regions.empty()) { - align_selection_relative (what, where, selection->regions); - } else { + get_regions_for_action (rs, false); - RegionSelection rs; - rs = get_regions_at (where, selection->tracks); + if (!rs.empty()) { align_selection_relative (what, where, rs); - } + } } struct RegionSortByTime { @@ -3145,10 +3199,9 @@ Editor::align_selection_relative (RegionPoint point, nframes_t position, const R /* move rest by the same amount */ - RegionSelection::const_iterator i = rs.begin(); - ++i; - - for (; i != rs.end(); ++i) { + sorted.pop_front(); + + for (list::iterator i = sorted.begin(); i != sorted.end(); ++i) { boost::shared_ptr region ((*i)->region()); @@ -3240,9 +3293,9 @@ Editor::trim_region_to_punch () void Editor::trim_region_to_location (const Location& loc, const char* str) { - ExclusiveRegionSelection ers (*this, entered_regionview); + RegionSelection rs; - RegionSelection& rs (get_regions_for_action ()); + get_regions_for_action (rs); begin_reversible_command (str); @@ -3291,9 +3344,10 @@ Editor::trim_region_to_location (const Location& loc, const char* str) void Editor::trim_region_to_edit_point () { - ExclusiveRegionSelection ers (*this, entered_regionview); + RegionSelection rs; + + get_regions_for_action (rs); - RegionSelection& rs (get_regions_for_action ()); nframes64_t where = get_preferred_edit_position(); begin_reversible_command (_("trim region start to edit point")); @@ -3335,9 +3389,10 @@ Editor::trim_region_to_edit_point () void Editor::trim_region_from_edit_point () { - ExclusiveRegionSelection ers (*this, entered_regionview); + RegionSelection rs; + + get_regions_for_action (rs); - RegionSelection& rs (get_regions_for_action ()); nframes64_t where = get_preferred_edit_position(); begin_reversible_command (_("trim region end to edit point")); @@ -3580,13 +3635,17 @@ Editor::cut_copy (CutCopyOp op) return; } + RegionSelection rs; + + get_regions_for_action (rs); + switch (current_mouse_mode()) { case MouseObject: - if (!selection->regions.empty() || !selection->points.empty()) { + if (!rs.empty() || !selection->points.empty()) { begin_reversible_command (opname + _(" objects")); - if (!selection->regions.empty()) { + if (!rs.empty()) { cut_copy_regions (op); if (op == Cut) { @@ -3689,9 +3748,12 @@ Editor::cut_copy_regions (CutCopyOp op) /* get ordering correct before we cut/copy */ - selection->regions.sort_by_position_and_track (); + RegionSelection rs; - for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { + get_regions_for_action (rs); + rs.sort_by_position_and_track (); + + for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { first_position = min ((*x)->region()->position(), first_position); @@ -3726,7 +3788,7 @@ Editor::cut_copy_regions (CutCopyOp op) } } - for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ) { + for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ) { boost::shared_ptr pl = (*x)->region()->playlist(); @@ -3985,8 +4047,8 @@ Editor::duplicate_selection (float times) } boost::shared_ptr playlist; - vector > new_regions; - vector >::iterator ri; + vector > new_regions; + vector >::iterator ri; create_region_from_selection (new_regions); @@ -4002,9 +4064,9 @@ Editor::duplicate_selection (float times) if ((playlist = (*i)->playlist()) == 0) { continue; } - XMLNode &before = playlist->get_state(); + XMLNode &before = playlist->get_state(); playlist->duplicate (*ri, selection->time[clicked_selection].end, times); - XMLNode &after = playlist->get_state(); + XMLNode &after = playlist->get_state(); session->add_command (new MementoCommand(*playlist, &before, &after)); ++ri; @@ -4126,11 +4188,15 @@ Editor::remove_last_capture () void Editor::normalize_region () { + RegionSelection rs; + + get_regions_for_action (rs); + if (!session) { return; } - if (selection->regions.empty()) { + if (rs.empty()) { return; } @@ -4139,7 +4205,7 @@ Editor::normalize_region () track_canvas.get_window()->set_cursor (*wait_cursor); gdk_flush (); - for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { AudioRegionView* const arv = dynamic_cast(*r); if (!arv) continue; @@ -4160,15 +4226,17 @@ Editor::denormalize_region () return; } - ExclusiveRegionSelection (*this, entered_regionview); + RegionSelection rs; - if (selection->regions.empty()) { + get_regions_for_action (rs); + + if (rs.empty()) { return; } begin_reversible_command ("denormalize"); - for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { AudioRegionView* const arv = dynamic_cast(*r); if (!arv) continue; @@ -4187,15 +4255,17 @@ Editor::adjust_region_scale_amplitude (bool up) return; } - ExclusiveRegionSelection esr (*this, entered_regionview); + RegionSelection rs; - if (selection->regions.empty()) { + get_regions_for_action (rs); + + if (rs.empty()) { return; } begin_reversible_command ("denormalize"); - for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { AudioRegionView* const arv = dynamic_cast(*r); if (!arv) continue; @@ -4258,7 +4328,11 @@ Editor::quantize_region () void Editor::apply_filter (Filter& filter, string command) { - if (selection->regions.empty()) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { return; } @@ -4267,8 +4341,7 @@ Editor::apply_filter (Filter& filter, string command) track_canvas.get_window()->set_cursor (*wait_cursor); gdk_flush (); - /* this is ugly. */ - for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ) { + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ) { RegionSelection::iterator tmp = r; ++tmp; @@ -4298,7 +4371,7 @@ Editor::apply_filter (Filter& filter, string command) } commit_reversible_command (); - selection->regions.clear (); + rs.clear (); out: track_canvas.get_window()->set_cursor (*current_canvas_cursor); @@ -4342,19 +4415,17 @@ void Editor::brush (nframes_t pos) { RegionSelection sel; + RegionSelection rs; + + get_regions_for_action (rs); + snap_to (pos); - if (selection->regions.empty()) { - /* XXX get selection from region list */ - } else { - sel = selection->regions; - } - - if (sel.empty()) { + if (rs.empty()) { return; } - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { mouse_brush_insert_region ((*i), pos); } } @@ -4362,13 +4433,17 @@ Editor::brush (nframes_t pos) void Editor::reset_region_gain_envelopes () { - if (!session || selection->regions.empty()) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (!session || rs.empty()) { return; } session->begin_reversible_command (_("reset region gain")); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { AudioRegionView* const arv = dynamic_cast(*i); if (arv) { boost::shared_ptr alist (arv->audio_region()->envelope()); @@ -4385,7 +4460,11 @@ Editor::reset_region_gain_envelopes () void Editor::toggle_gain_envelope_visibility () { - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + RegionSelection rs; + + get_regions_for_action (rs); + + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { AudioRegionView* const arv = dynamic_cast(*i); if (arv) { arv->set_envelope_visible (!arv->envelope_visible()); @@ -4396,7 +4475,11 @@ Editor::toggle_gain_envelope_visibility () void Editor::toggle_gain_envelope_active () { - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + RegionSelection rs; + + get_regions_for_action (rs); + + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { AudioRegionView* const arv = dynamic_cast(*i); if (arv) { arv->audio_region()->set_envelope_active (!arv->audio_region()->envelope_active()); @@ -4407,7 +4490,11 @@ Editor::toggle_gain_envelope_active () void Editor::toggle_region_lock () { - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + RegionSelection rs; + + get_regions_for_action (rs); + + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->set_locked (!(*i)->region()->locked()); } } @@ -4415,7 +4502,11 @@ Editor::toggle_region_lock () void Editor::set_region_lock_style (Region::PositionLockStyle ps) { - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + RegionSelection rs; + + get_regions_for_action (rs); + + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->set_position_lock_style (ps); } } @@ -4424,7 +4515,11 @@ Editor::set_region_lock_style (Region::PositionLockStyle ps) void Editor::toggle_region_mute () { - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + RegionSelection rs; + + get_regions_for_action (rs); + + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->set_muted (!(*i)->region()->muted()); } } @@ -4432,7 +4527,11 @@ Editor::toggle_region_mute () void Editor::toggle_region_opaque () { - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + RegionSelection rs; + + get_regions_for_action (rs); + + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->set_opaque (!(*i)->region()->opaque()); } } @@ -4440,14 +4539,16 @@ Editor::toggle_region_opaque () void Editor::set_fade_length (bool in) { - ExclusiveRegionSelection esr (*this, entered_regionview); + RegionSelection rs; + + get_regions_for_action (rs); /* we need a region to measure the offset from the start */ RegionView* rv; - if (!selection->regions.empty()) { - rv = selection->regions.front(); + if (!rs.empty()) { + rv = rs.front(); } else if (entered_regionview) { rv = entered_regionview; } else { @@ -4481,8 +4582,6 @@ Editor::set_fade_length (bool in) begin_reversible_command (cmd); - RegionSelection& rs (get_regions_for_action()); - for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { AudioRegionView* tmp = dynamic_cast (*x); @@ -4501,8 +4600,10 @@ Editor::set_fade_length (bool in) if (in) { tmp->audio_region()->set_fade_in_length (len); + tmp->audio_region()->set_fade_in_active (true); } else { tmp->audio_region()->set_fade_out_length (len); + tmp->audio_region()->set_fade_out_active (true); } XMLNode &after = alist->get_state(); @@ -4515,9 +4616,11 @@ Editor::set_fade_length (bool in) void Editor::toggle_fade_active (bool in) { - ensure_entered_region_selected (true); + RegionSelection rs; - if (selection->regions.empty()) { + get_regions_for_action (rs); + + if (rs.empty()) { return; } @@ -4527,7 +4630,7 @@ Editor::toggle_fade_active (bool in) begin_reversible_command (cmd); - for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { + for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { AudioRegionView* tmp = dynamic_cast (*x); if (!tmp) { @@ -4563,10 +4666,17 @@ Editor::toggle_fade_active (bool in) void Editor::set_fade_in_shape (AudioRegion::FadeShape shape) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { + return; + } begin_reversible_command (_("set fade in shape")); - for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { + for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { AudioRegionView* tmp = dynamic_cast (*x); if (!tmp) { @@ -4589,9 +4699,17 @@ Editor::set_fade_in_shape (AudioRegion::FadeShape shape) void Editor::set_fade_out_shape (AudioRegion::FadeShape shape) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { + return; + } + begin_reversible_command (_("set fade out shape")); - for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { + for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { AudioRegionView* tmp = dynamic_cast (*x); if (!tmp) { @@ -4613,9 +4731,17 @@ Editor::set_fade_out_shape (AudioRegion::FadeShape shape) void Editor::set_fade_in_active (bool yn) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { + return; + } + begin_reversible_command (_("set fade in active")); - for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { + for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { AudioRegionView* tmp = dynamic_cast (*x); if (!tmp) { @@ -4639,9 +4765,17 @@ Editor::set_fade_in_active (bool yn) void Editor::set_fade_out_active (bool yn) { + RegionSelection rs; + + get_regions_for_action (rs); + + if (rs.empty()) { + return; + } + begin_reversible_command (_("set fade out active")); - for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { + for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { AudioRegionView* tmp = dynamic_cast (*x); if (!tmp) { @@ -4731,20 +4865,17 @@ Editor::set_playhead_cursor () void Editor::split () { - ensure_entered_region_selected (); + RegionSelection rs; + get_regions_for_action (rs); + nframes64_t where = get_preferred_edit_position(); - if (!selection->regions.empty()) { - - split_regions_at (where, selection->regions); - - } else { - - RegionSelection rs; - rs = get_regions_at (where, selection->tracks); - split_regions_at (where, rs); + if (rs.empty()) { + return; } + + split_regions_at (where, rs); } void @@ -4765,36 +4896,6 @@ Editor::ensure_entered_track_selected (bool op_really_wants_one_track_if_none_ar } } -void -Editor::ensure_entered_region_selected (bool op_really_wants_one_region_if_none_are_selected) -{ - if (!entered_regionview || mouse_mode != MouseObject) { - return; - } - - - /* heuristic: - - - if there is no existing selection, don't change it. the operation will thus apply to "all" - - - if there is an existing selection, but the entered regionview isn't in it, add it. this - avoids key-mouse ops on unselected regions from interfering with an existing selection, - but also means that the operation will apply to the pointed-at region. - */ - - if (!selection->regions.empty()) { - if (!selection->selected (entered_regionview)) { - selection->add (entered_regionview); - } - } else { - /* there is no selection, but this operation requires/prefers selected objects */ - - if (op_really_wants_one_region_if_none_are_selected) { - selection->set (entered_regionview, false); - } - } -} - void Editor::trim_region_front () { @@ -4810,10 +4911,10 @@ Editor::trim_region_back () void Editor::trim_region (bool front) { - ExclusiveRegionSelection ers (*this, entered_regionview); - nframes64_t where = get_preferred_edit_position(); - RegionSelection& rs = get_regions_for_action (); + RegionSelection rs; + + get_regions_for_action (rs); if (rs.empty()) { return; @@ -4937,14 +5038,15 @@ Editor::set_loop_from_region (bool play) nframes64_t start = max_frames; nframes64_t end = 0; - ExclusiveRegionSelection esr (*this, entered_regionview); + RegionSelection rs; - if (selection->regions.empty()) { - info << _("cannot set loop: no region selected") << endmsg; + get_regions_for_action (rs); + + if (rs.empty()) { return; } - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { if ((*i)->region()->position() < start) { start = (*i)->region()->position(); } @@ -4997,14 +5099,15 @@ Editor::set_punch_from_region () nframes64_t start = max_frames; nframes64_t end = 0; - ExclusiveRegionSelection esr (*this, entered_regionview); + RegionSelection rs; - if (selection->regions.empty()) { - info << _("cannot set punch: no region selected") << endmsg; + get_regions_for_action (rs); + + if (rs.empty()) { return; } - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { if ((*i)->region()->position() < start) { start = (*i)->region()->position(); } @@ -5019,13 +5122,15 @@ Editor::set_punch_from_region () void Editor::pitch_shift_regions () { - ensure_entered_region_selected (true); + RegionSelection rs; + + get_regions_for_action (rs); - if (selection->regions.empty()) { + if (rs.empty()) { return; } - pitch_shift (selection->regions, 1.2); + pitch_shift (rs, 1.2); } void @@ -5035,13 +5140,15 @@ Editor::use_region_as_bar () return; } - ExclusiveRegionSelection esr (*this, entered_regionview); + RegionSelection rs; - if (selection->regions.empty()) { + get_regions_for_action (rs); + + if (rs.empty()) { return; } - RegionView* rv = selection->regions.front(); + RegionView* rv = rs.front(); define_one_bar (rv->region()->position(), rv->region()->last_frame() + 1); } @@ -5092,18 +5199,20 @@ Editor::define_one_bar (nframes64_t start, nframes64_t end) */ vector options; - options.push_back (_("Set global tempo")); - options.push_back (_("Add new marker")); options.push_back (_("Cancel")); + options.push_back (_("Add new marker")); + options.push_back (_("Set global tempo")); Choice c (_("Do you want to set the global tempo or add new tempo marker?"), options); + c.set_default_response (2); switch (c.run()) { case 0: + return; + + case 2: do_global = true; break; - case 2: - return; default: do_global = false; @@ -5143,15 +5252,17 @@ Editor::split_region_at_transients () return; } - ExclusiveRegionSelection esr (*this, entered_regionview); + RegionSelection rs; - if (selection->regions.empty()) { + get_regions_for_action (rs); + + if (rs.empty()) { return; } session->begin_reversible_command (_("split regions")); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ) { + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ) { RegionSelection::iterator tmp; @@ -5161,7 +5272,7 @@ Editor::split_region_at_transients () boost::shared_ptr ar = boost::dynamic_pointer_cast ((*i)->region()); if (ar && (ar->get_transients (positions) == 0)) { - split_region_at_points ((*i)->region(), positions); + split_region_at_points ((*i)->region(), positions, true); positions.clear (); } @@ -5173,15 +5284,11 @@ Editor::split_region_at_transients () } void -Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList& positions) +Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList& positions, bool can_ferret) { - boost::shared_ptr ar = boost::dynamic_pointer_cast (r); - - if (!ar) { - return; - } - - boost::shared_ptr pl = ar->playlist(); + bool use_rhythmic_rodent = false; + + boost::shared_ptr pl = r->playlist(); if (!pl) { return; @@ -5190,11 +5297,47 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList if (positions.empty()) { return; } + + + if (positions.size() > 20) { + Glib::ustring msgstr = string_compose (_("You are about to split\n%1\ninto %2 pieces.\nThis could take a long time."), r->name(), positions.size() + 1); + MessageDialog msg (msgstr, + false, + Gtk::MESSAGE_INFO, + Gtk::BUTTONS_OK_CANCEL); + + if (can_ferret) { + msg.add_button (_("Call for the Ferret!"), RESPONSE_APPLY); + msg.set_secondary_text (_("Press OK to continue with this split operation\nor ask the Ferret dialog to tune the analysis")); + } else { + msg.set_secondary_text (_("Press OK to continue with this split operation")); + } + + msg.set_title (_("Excessive split?")); + msg.present (); + + int response = msg.run(); + msg.hide (); + switch (response) { + case RESPONSE_OK: + break; + case RESPONSE_APPLY: + use_rhythmic_rodent = true; + break; + default: + return; + } + } + if (use_rhythmic_rodent) { + show_rhythm_ferret (); + return; + } + AnalysisFeatureList::const_iterator x; - nframes64_t pos = ar->position(); - + nframes64_t pos = r->position(); + XMLNode& before (pl->get_state()); x = positions.begin(); @@ -5203,6 +5346,7 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList if ((*x) > pos) { break; } + ++x; } if (x == positions.end()) { @@ -5210,36 +5354,58 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList } pl->freeze (); - pl->remove_region (ar); + pl->remove_region (r); - do { + while (x != positions.end()) { /* file start = original start + how far we from the initial position ? */ - nframes64_t file_start = ar->start() + (pos - ar->position()); - + nframes64_t file_start = r->start() + (pos - r->position()); + /* length = next position - current position */ nframes64_t len = (*x) - pos; + + /* XXX we do we really want to allow even single-sample regions? + shouldn't we have some kind of lower limit on region size? + */ + + if (len <= 0) { + break; + } string new_name; - if (session->region_name (new_name, ar->name())) { - continue; + if (session->region_name (new_name, r->name())) { + break; } - pl->add_region (RegionFactory::create (ar->sources(), file_start, len, new_name), pos); - + /* do NOT announce new regions 1 by one, just wait till they are all done */ + + boost::shared_ptr nr = RegionFactory::create (r->sources(), file_start, len, new_name, 0, Region::DefaultFlags, false); + pl->add_region (nr, pos); + pos += len; - ++x; - - } while (x != positions.end() && (*x) < ar->last_frame()); - + + if (*x > r->last_frame()) { + + /* add final fragment */ + + file_start = r->start() + (pos - r->position()); + len = r->last_frame() - pos; + + nr = RegionFactory::create (r->sources(), file_start, len, new_name, 0, Region::DefaultFlags); + pl->add_region (nr, pos); + + break; + } + } + pl->thaw (); - + XMLNode& after (pl->get_state()); session->add_command (new MementoCommand(*pl, &before, &after)); @@ -5279,13 +5445,15 @@ Editor::tab_to_transient (bool forward) } else { - ExclusiveRegionSelection esr (*this, entered_regionview); + RegionSelection rs; + + get_regions_for_action (rs); - if (selection->regions.empty()) { + if (rs.empty()) { return; } - for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { (*r)->region()->get_transients (positions); } } diff --git a/gtk2_ardour/editor_region_list.cc b/gtk2_ardour/editor_region_list.cc index e15ee6448c..ee15602f34 100644 --- a/gtk2_ardour/editor_region_list.cc +++ b/gtk2_ardour/editor_region_list.cc @@ -58,20 +58,10 @@ Editor::handle_region_removed (boost::weak_ptr wregion) } void -Editor::handle_new_region (boost::weak_ptr wregion) +Editor::handle_new_regions (vector >& v) { - ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_new_region), wregion)); - - /* don't copy region - the one we are being notified - about belongs to the session, and so it will - never be edited. - */ - - boost::shared_ptr region (wregion.lock()); - - if (region) { - add_region_to_region_display (region); - } + ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_new_regions), v)); + add_regions_to_region_display (v); } void @@ -82,6 +72,21 @@ Editor::region_hidden (boost::shared_ptr r) redisplay_regions (); } +void +Editor::add_regions_to_region_display (vector >& regions) +{ + cerr << "Adding " << regions.size() << " to region list\n"; + + region_list_display.set_model (Glib::RefPtr(0)); + for (vector >::iterator x = regions.begin(); x != regions.end(); ++x) { + boost::shared_ptr region ((*x).lock()); + if (region) { + add_region_to_region_display (region); + } + } + region_list_display.set_model (region_list_model); +} + void Editor::add_region_to_region_display (boost::shared_ptr region) { diff --git a/gtk2_ardour/editor_route_list.cc b/gtk2_ardour/editor_route_list.cc index c2966d506c..d7611d7cdf 100644 --- a/gtk2_ardour/editor_route_list.cc +++ b/gtk2_ardour/editor_route_list.cc @@ -116,6 +116,7 @@ Editor::handle_new_route (Session::RouteList& routes) if (rtv->route()->order_key(N_("editor")) == -1) { rtv->route()->set_order_key (N_("editor"), route_display_model->children().size()-1); } + rtv->effective_gain_display (); } ignore_route_list_reorder = false; diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index f0624ccbb2..b18e917c85 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -366,7 +366,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t) switch (t) { case MarkerBarItem: - ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, false))); + ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, false, false))); ruler_items.push_back (MenuElem (_("Clear all locations"), mem_fun(*this, &Editor::clear_markers))); ruler_items.push_back (MenuElem (_("Unhide locations"), mem_fun(*this, &Editor::unhide_markers))); ruler_items.push_back (SeparatorElem ()); @@ -384,7 +384,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t) case CdMarkerBarItem: // TODO - ruler_items.push_back (MenuElem (_("New CD track marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, true))); + ruler_items.push_back (MenuElem (_("New CD track marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, true, false))); break; diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 7c75701270..6cd022cce1 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -183,7 +183,6 @@ Editor::set_selected_track_as_side_effect (bool force) void Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no_remove) { - switch (op) { case Selection::Toggle: if (selection->selected (&view)) { @@ -961,13 +960,7 @@ Editor::set_selection_from_region () return; } - RegionView* rv = *(selection->regions.begin()); - boost::shared_ptr region = rv->region(); - - begin_reversible_command (_("set selection from region")); - selection->set (0, region->position(), region->last_frame()); - commit_reversible_command (); - + selection->set (0, selection->regions.start(), selection->regions.end_frame()); set_mouse_mode (Editing::MouseRange, false); } @@ -1323,27 +1316,4 @@ Editor::deselect_all () selection->clear (); } -Editor::ExclusiveRegionSelection::ExclusiveRegionSelection (Editor& ed, RegionView* rv) - : editor (ed), - regionview (rv) -{ - - if (!rv || ed.current_mouse_mode() != Editing::MouseObject) { - return; - } - - if (ed.get_selection().regions.empty() && !ed.get_selection().selected (rv)) { - ed.get_selection().set (rv, false); - remove = true; - } else { - remove = false; - } -} - -Editor::ExclusiveRegionSelection::~ExclusiveRegionSelection () -{ - if (remove) { - editor.get_selection().remove (regionview); - } -} diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 4e5e068f65..ab02a051c2 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -821,7 +821,7 @@ EngineControl::driver_changed () vector& strings = devices[driver]; - if (strings.empty() && driver != "FFADO") { + if (strings.empty() && driver != "FFADO" && driver != "Dummy") { error << string_compose (_("No devices found for driver \"%1\""), driver) << endmsg; return; } @@ -841,7 +841,7 @@ EngineControl::driver_changed () interface_combo.set_active_text (strings.front()); input_device_combo.set_active_text (strings.front()); output_device_combo.set_active_text (strings.front()); - } + } if (driver == "ALSA") { soft_mode_button.set_sensitive (true); diff --git a/gtk2_ardour/ardour-sae-ansi.bindings.in b/gtk2_ardour/ergonomic-us.bindings.in similarity index 100% rename from gtk2_ardour/ardour-sae-ansi.bindings.in rename to gtk2_ardour/ergonomic-us.bindings.in diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index 6e3119b373..4b64098dc0 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -86,7 +86,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr pi, bool scrol smaller_hbox->pack_start (*latency_label, false, false, 10); smaller_hbox->pack_start (latency_gui, false, false, 10); - smaller_hbox->pack_start (combo, false, false); + smaller_hbox->pack_start (preset_combo, false, false); smaller_hbox->pack_start (save_button, false, false); constraint_hbox->set_spacing (5); diff --git a/gtk2_ardour/icons/fader_belt_h.png b/gtk2_ardour/icons/fader_belt_h.png new file mode 100644 index 0000000000000000000000000000000000000000..3525767560b6acda6d84d2efaa0a5d658aa10d57 GIT binary patch literal 3320 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iO7+ z5FQ6c8GhIR000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000bANkl7Xxlb>GM|NlkbcPcKJb#P)ZQ+a}P36{Sj zK@jenz#QfegBS&gFu5+))$yn6x7_2BCe%)>_Fxv1dEL#79QGS7avaH~xUBkvfvFZ={kRC+?_y_rZ+vpw zH`AG|UnBoH>iZ4{oyZLVnSn-cW&n+w;#vE!KSFF5a=VO9!mPiW44@$#bi_u5&Hx(i znOUx-O~=TL+$aXW9kvPI=tJyux4(m8;6UJp*POAeVeQkBFi+!FmG{tdo91SwKL|a#qI4CvQ9)~Ss?TI46D_( z^v#T%Gje7u<}FsYOXLQ~nbBmK(DV5Wx3|~w8?0EsVEwIKCuP$99=pjvnzy+9z6{to zGv@OdzTaL4Y*>G5w+XNKD{VI`=LVS1Tio6*Wzl8PIfF5ux1w*u+9nHnKA+)sbzK&H z)`dQ#8NQodYBwMw&0DNiOBv5>?d)UrG(F~nle4L(@?x0b_O{|M7~qVyeUEYbL)W^_ zB4)JRdyM0KZHJt&ZTB7z*3JNN1{i4D-(Vbn=qzL~%YR+_9@~feN)}j7qqhBk?f63` zDJv^b{Bit;SfA~5%ILJeZA!0||6KK@pMLr)vs>{gwIBw@?PEB~7efmWFpiIvu``es zEdXn;yGu$f2*5Z#8M_An45lL5#c_Nnshs1u4?A!gR4=u&?cj?d z&y(|Syd9qER;~770Nc$YK)~gq)7`U*2{Zs@<<^bvCekMUfRRpvZmNIxX4po2b95VBOo^v1sQCt= z&BiifnS<=bMk-^F+jJ{njU(h4&drwhgIp$njcY<){`yPxQQd?iR{xrh{b^6Rh^f$K zA}RqdR%MDm z>|d!Y0~nQ>+R$my3AG;gAuhI9^k8P`@6t6XbxNW4VM85K9oGdqRWH}Br_-?Lg!&p) z)}e<*2Y|30cYy*eRIhQ|mo}3}DC@pP2@%`jg1o~*+?jF0w2_pNe7?ZRkJo|g8{2|?Y zM*23abgWRd)MC9}7An9b4-Z3!)%qrepqYiLeHUsfG6+!|Qit{TrQⅈ4pNGpEa~E z_lDGBwO&>_sRj~?dmXS@Ptw)uCSWs5uw}Kr4%n-9~*X0Ve-sVNDyOsT_az0?qR zmSxB)r;c08EKIL!LDfx)jmnzc)IA_&6zla(r8;`gRRhmE>BI=2XD z`wMIzHcA~OXD881!6_MrSIU2``qJmme{?BPAf;X@*{)Qv0E}ViL4-hML;uabW^_s0 z85p<6{e?R2!p1bDUMT2h7dE_r<93}i^cppd_yNZymlva73nxiAgDs32j#dkO)y{w3r77x~XoU;6y{4{SvOq^sJ~BeE0560$t0R8gml z7?T1f4ktbwj zJUUS`R^RuFb0v;I#xMv@ zi69=dJt=jxtwM_!YLt}&y&DFltPY#AoQ!L0S8OggHvt<;SxYq4(HhZrS*WAkEmYRO z&I2&ag@TrdV3x#j8cZIQGHWzD^;oTLq&Nb#Fe43paTyNGQg>j{@4F?kn@U-OW~=oQ z2UZtAiw{!jojm2`pzUTDAMQ&u*y^QvZO>{iBV}EGf$?DzXtnI*GmP7NHK&hu&Xgi% z9aHt@LCZUdoZSt^1p*1zpG$N0unvGWZm>tILu2lCl85lka1>I_U zqkCXlR0^71I&SKa=R?!;?Ej9FF!ciSqdj#K6PuDVzlr=ef8xB2No2*KrF)oPh{>x=Un=ig=r@}xi?Fd)Bz99?=#u6`zqw1D(GV3gND8dLyyy!%PxRT0zCA>67~ZX!H8{N)C&WIog-}dtk9g{QMi`o6QT7Y_PGMWZ^EJ$)L4 zm^iYvs*Hm8aOng9$OoZ_^wPB zhw@<+xKHqS@<~*|@ws3XCLr?BF!F)LE95^{eg6&AgEsPx#32;bRa{vGf6951U69E94oEQKA00(qQO+^RT0t^rtHcB%`%K!iYu}MThR7l6| zma%WsKorKmFGT_=LlEd-p;RyhOBE7D-4F*W1B-W-^4~=2!kC4>A%8#zG9VR!#~>M~ zJmfaFiEETdBp-|2xNe*_QO10d^{hMn?(W^ayZ4ApB!vn|V!5qW_k?03XUeI_ECgivg^)lB6&UWsEs3gJqi!0Fp<}IZ0Bx z-Bu9{g5Z+%Jg>Ohc;9NZBuPn<$QYyRbn%$^zJFzwDvd^?8A$Tvx>=^vsnRr66h$Jb z{2V`byWOh1f$?~ZIF8|*L$B8ZfTO&>(QGzPqA1c}Fi?^t8V-kw<5>NEUtt(32m*CF z9eFR_2*A5y7J6EHa_|e2zj*201OBBrKK?d4@7oW7h6mo?#pLV9y;}wFH|h_*)b2ie z_5C~x(%rXLmOefE82~^z@6`c3BH5F)w;)tg&bbM9NS;e-EC45)Y_$Q`1m=a&QU%gV hCD|NkA + #include "ardour_ui.h" #include #include +#include #include +#include + #include #include +#include + +#include #include "keyboard.h" #include "gui_thread.h" +#include "opts.h" #include "i18n.h" using namespace PBD; +using namespace ARDOUR; #define KBD_DEBUG 1 bool debug_keyboard = false; @@ -44,10 +54,10 @@ guint Keyboard::delete_mod = GDK_SHIFT_MASK; guint Keyboard::snap_mod = GDK_MOD3_MASK; #ifdef GTKOSX -guint Keyboard::PrimaryModifier = GDK_MOD1_MASK; // Command -guint Keyboard::SecondaryModifier = GDK_MOD5_MASK; // Alt/Option +guint Keyboard::PrimaryModifier = GDK_META_MASK; // Command +guint Keyboard::SecondaryModifier = GDK_MOD1_MASK; // Alt/Option guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift -guint Keyboard::CopyModifier = GDK_MOD5_MASK; // Alt/Option +guint Keyboard::CopyModifier = GDK_MOD1_MASK; // Alt/Option guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK; #else guint Keyboard::PrimaryModifier = GDK_CONTROL_MASK; // Control @@ -61,6 +71,11 @@ Keyboard* Keyboard::_the_keyboard = 0; Gtk::Window* Keyboard::current_window = 0; bool Keyboard::_some_magic_widget_has_focus = false; +std::string Keyboard::user_keybindings_path; +bool Keyboard::can_save_keybindings = false; +map Keyboard::binding_files; +std::string Keyboard::_current_binding_name = _("Unknown"); + /* set this to initially contain the modifiers we care about, then track changes in ::set_edit_modifier() etc. */ GdkModifierType Keyboard::RelevantModifierKeyMask; @@ -359,3 +374,192 @@ Keyboard::selection_type (guint state) return Selection::Set; } } + + +static void +accel_map_changed (GtkAccelMap* map, + gchar* path, + guint key, + GdkModifierType mod, + gpointer arg) +{ + Keyboard::save_keybindings (); +} + +void +Keyboard::set_can_save_keybindings (bool yn) +{ + can_save_keybindings = yn; +} + +void +Keyboard::save_keybindings () +{ + if (can_save_keybindings) { + Gtk::AccelMap::save (user_keybindings_path); + } +} + +void +Keyboard::setup_keybindings () +{ + using namespace ARDOUR_COMMAND_LINE; + std::string default_bindings = "mnemonic-us.bindings"; + std::string path; + vector strs; + + binding_files.clear (); + + ARDOUR::find_bindings_files (binding_files); + + /* set up the per-user bindings path */ + + strs.push_back (Glib::get_home_dir()); + strs.push_back (".ardour2"); + strs.push_back ("ardour.bindings"); + + user_keybindings_path = Glib::build_filename (strs); + + if (Glib::file_test (user_keybindings_path, Glib::FILE_TEST_EXISTS)) { + std::pair newpair; + newpair.first = _("your own"); + newpair.second = user_keybindings_path; + binding_files.insert (newpair); + } + + /* check to see if they gave a style name ("SAE", "ergonomic") or + an actual filename (*.bindings) + */ + + if (!keybindings_path.empty() && keybindings_path.find (".bindings") == string::npos) { + + // just a style name - allow user to + // specify the layout type. + + char* layout; + + if ((layout = getenv ("ARDOUR_KEYBOARD_LAYOUT")) != 0 && layout[0] != '\0') { + + /* user-specified keyboard layout */ + + keybindings_path += '-'; + keybindings_path += layout; + + } else { + + /* default to US/ANSI - we have to pick something */ + + keybindings_path += "-us"; + } + + keybindings_path += ".bindings"; + } + + if (keybindings_path.empty()) { + + /* no path or binding name given: check the user one first */ + + if (!Glib::file_test (user_keybindings_path, Glib::FILE_TEST_EXISTS)) { + + keybindings_path = ""; + + } else { + + keybindings_path = user_keybindings_path; + } + } + + /* if we still don't have a path at this point, use the default */ + + if (keybindings_path.empty()) { + keybindings_path = default_bindings; + } + + while (true) { + + if (!Glib::path_is_absolute (keybindings_path)) { + + /* not absolute - look in the usual places */ + sys::path keybindings_file; + + SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path(); + + find_file_in_search_path (spath, keybindings_path, keybindings_file); + + if (path.empty()) { + + if (keybindings_path == default_bindings) { + error << _("Default keybindings not found - Ardour will be hard to use!") << endmsg; + return; + } else { + warning << string_compose (_("Key bindings file \"%1\" not found. Default bindings used instead"), + keybindings_path) + << endmsg; + keybindings_path = default_bindings; + } + + } else { + + /* use it */ + + keybindings_path = path; + break; + + } + + } else { + + /* path is absolute already */ + + if (!Glib::file_test (keybindings_path, Glib::FILE_TEST_EXISTS)) { + if (keybindings_path == default_bindings) { + error << _("Default keybindings not found - Ardour will be hard to use!") << endmsg; + return; + } else { + warning << string_compose (_("Key bindings file \"%1\" not found. Default bindings used instead"), + keybindings_path) + << endmsg; + keybindings_path = default_bindings; + } + + } else { + break; + } + } + } + + load_keybindings (keybindings_path); + + /* catch changes */ + + GtkAccelMap* accelmap = gtk_accel_map_get(); + g_signal_connect (accelmap, "changed", (GCallback) accel_map_changed, 0); +} + +bool +Keyboard::load_keybindings (string path) +{ + try { + cerr << "loading bindings from " << path << endl; + + Gtk::AccelMap::load (path); + + _current_binding_name = _("Unknown"); + + for (map::iterator x = binding_files.begin(); x != binding_files.end(); ++x) { + if (path == x->second) { + _current_binding_name = x->first; + break; + } + } + + return true; + + } catch (...) { + error << string_compose (_("Ardour key bindings file not found at \"%1\" or contains errors."), path) + << endmsg; + return false; + } +} + + diff --git a/gtk2_ardour/keyboard.h b/gtk2_ardour/keyboard.h index 7c163245e7..9042dc4f6b 100644 --- a/gtk2_ardour/keyboard.h +++ b/gtk2_ardour/keyboard.h @@ -109,6 +109,13 @@ class Keyboard : public sigc::trackable, PBD::Stateful static void magic_widget_grab_focus (); static void magic_widget_drop_focus (); + static void setup_keybindings (); + static void save_keybindings (); + static bool load_keybindings (std::string path); + static void set_can_save_keybindings (bool yn); + static std::string current_binding_name () { return _current_binding_name; } + static std::map binding_files; + private: static Keyboard* _the_keyboard; @@ -121,6 +128,9 @@ class Keyboard : public sigc::trackable, PBD::Stateful static guint delete_mod; static guint snap_mod; static Gtk::Window* current_window; + static std::string user_keybindings_path; + static bool can_save_keybindings; + static std::string _current_binding_name; static gint _snooper (GtkWidget*, GdkEventKey*, gpointer); gint snooper (GtkWidget*, GdkEventKey*); diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc index c914b6282b..cdac398a30 100644 --- a/gtk2_ardour/keyeditor.cc +++ b/gtk2_ardour/keyeditor.cc @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -50,17 +51,23 @@ KeyEditor::KeyEditor () scroller.add (view); scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); - unbind_box.pack_start (unbind_button, false, false); - - unbind_button.signal_clicked().connect (mem_fun (*this, &KeyEditor::unbind)); get_vbox()->set_spacing (6); get_vbox()->pack_start (scroller); if (!ARDOUR::Profile->get_sae()) { + + Label* hint = manage (new Label (_("Select an action, then press the key(s) to (re)set its shortcut"))); + hint->show (); + unbind_box.set_spacing (6); + unbind_box.pack_start (*hint, false, true); + unbind_box.pack_start (unbind_button, false, false); + unbind_button.signal_clicked().connect (mem_fun (*this, &KeyEditor::unbind)); + get_vbox()->pack_start (unbind_box, false, false); unbind_box.show (); unbind_button.show (); + } get_vbox()->set_border_width (12); @@ -248,9 +255,16 @@ KeyEditor::populate () #ifdef GTKOSX string label = (*k); - replace_all (label, "", _("Command-")); + + /* Gtk/Quartz maps: + NSAlternate/NSOption key to Mod1 + NSCommand key to Meta + */ + + replace_all (label, "", _("Command-")); replace_all (label, "", _("Option-")); replace_all (label, "", _("Shift-")); + replace_all (label, "", _("Control-")); row[columns.binding] = label; #else row[columns.binding] = (*k); diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index 6e0be908ae..2079d0dc7a 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -222,7 +222,7 @@ LocationEditRow::set_location (Location *loc) name_label.set_size_request (80, -1); if (!name_label.get_parent()) { - item_table.attach (name_label, 1, 2, 0, 1, FILL, Gtk::FILL, 4, 0); + item_table.attach (name_label, 1, 2, 0, 1, FILL, FILL, 4, 0); } name_label.show(); @@ -240,10 +240,10 @@ LocationEditRow::set_location (Location *loc) name_entry.show(); if (!cd_check_button.get_parent()) { - item_table.attach (cd_check_button, 5, 6, 0, 1, FILL, Gtk::FILL, 4, 0); + item_table.attach (cd_check_button, 5, 6, 0, 1, FILL, FILL, 4, 0); } if (!remove_button.get_parent()) { - item_table.attach (remove_button, 7, 8, 0, 1, FILL, Gtk::FILL, 4, 0); + item_table.attach (remove_button, 7, 8, 0, 1, FILL, FILL, 4, 0); } /* XXX i can't find a way to hide the button without messing up @@ -267,7 +267,7 @@ LocationEditRow::set_location (Location *loc) } start_clock.set (location->start(), true); - + if (!location->is_mark()) { if (!end_hbox.get_parent()) { @@ -421,9 +421,9 @@ LocationEditRow::cd_toggled () return; } - if (cd_check_button.get_active() == location->is_cd_marker()) { - return; - } + //if (cd_check_button.get_active() == location->is_cd_marker()) { + // return; + //} if (cd_check_button.get_active()) { if (location->start() <= session->current_start_frame()) { @@ -793,10 +793,12 @@ LocationUI::map_locations (Locations::LocationList& locations) else if (location->is_auto_punch()) { punch_edit_row.set_session (session); punch_edit_row.set_location (location); + punch_edit_row.show_all(); } else if (location->is_auto_loop()) { loop_edit_row.set_session (session); loop_edit_row.set_location (location); + loop_edit_row.show_all(); } else { erow = manage (new LocationEditRow(session, location)); diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 968ceccb3c..809e654838 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -156,7 +156,27 @@ fixup_bundle_environment () path += "/../Plugins"; setenv ("LADSPA_PATH", path.c_str(), 1); + + cstr = getenv ("VAMP_PATH"); + if (cstr) { + path = cstr; + path += ':'; + } + path = dir_path; + path += "/../Frameworks"; + setenv ("VAMP_PATH", path.c_str(), 1); + + cstr = getenv ("ARDOUR_CONTROL_SURFACE_PATH"); + if (cstr) { + path = cstr; + path += ':'; + } + path = dir_path; + path += "/../Surfaces"; + + setenv ("ARDOUR_CONTROL_SURFACE_PATH", path.c_str(), 1); + cstr = getenv ("LV2_PATH"); if (cstr) { path = cstr; @@ -225,63 +245,6 @@ fixup_bundle_environment () #endif -static void -setup_keybindings (ARDOUR_UI* ui) -{ - Glib::ustring path; - - if (keybindings_path.empty()) { - keybindings_path = "ardour"; - } - - std::string kbpath; - - if (keybindings_path.find (".bindings") == string::npos) { - - // just a style name - allow user to - // specify the layout type. - - char* layout; - - if ((layout = getenv ("ARDOUR_KEYBOARD_LAYOUT")) != 0) { - keybindings_path += '-'; - keybindings_path += layout; - } - - keybindings_path += ".bindings"; - } - - - // XXX timbyr - we need a portable test for "is-absolute" here - - if (keybindings_path[0] != '/' && keybindings_path[0] != '.') { - - /* not absolute - look in the usual places */ - - sys::path key_bindings_file; - - find_file_in_search_path (ardour_search_path() + system_config_search_path(), - keybindings_path, key_bindings_file); - - path = key_bindings_file.to_string(); - - if (path.empty()) { - warning << string_compose (_("Key bindings file \"%1\" not found. Default bindings used instead"), - keybindings_path) << endmsg; - } - - } else { - - // absolute path from user - use it as is - - path = keybindings_path; - } - - if (!path.empty()) { - ui->set_keybindings_path (path); - } -} - #ifdef VST_SUPPORT /* this is called from the entry point of a wine-compiled executable that is linked against gtk2_ardour built @@ -363,8 +326,6 @@ int main (int argc, char *argv[]) exit (1); } - setup_keybindings (ui); - ui->run (text_receiver); ui = 0; diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 19b81ec4f9..aaa712a8b0 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -86,6 +86,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr rt : AxisView(sess), RouteUI (rt, sess, _("Mute"), _("Solo"), _("Record")), _mixer(mx), + _mixer_owned (in_mixer), pre_processor_box (PreFader, sess, rt, mx.plugin_selector(), mx.selection(), in_mixer), post_processor_box (PostFader, sess, rt, mx.plugin_selector(), mx.selection(), in_mixer), gpm (_route, sess), @@ -720,10 +721,6 @@ MixerStrip::update_diskstream_display () { if (is_track()) { - map_frozen (); - - update_input_display (); - if (input_selector) { input_selector->hide_all (); } @@ -732,9 +729,6 @@ MixerStrip::update_diskstream_display () } else { - map_frozen (); - - update_input_display (); show_passthru_color (); } } @@ -1208,6 +1202,7 @@ MixerStrip::map_frozen () pre_processor_box.set_sensitive (true); post_processor_box.set_sensitive (true); speed_spinner.set_sensitive (true); + // XXX need some way, maybe, to retoggle redirect editors break; } } diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index f134897fc5..cfe350e514 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -107,6 +107,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox bool _embedded; bool _packed; + bool _mixer_owned; Width _width; void* _width_owner; diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index f7a1d48a50..a7bf2a3f97 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -62,7 +62,7 @@ Mixer_UI::Mixer_UI () : Window (Gtk::WINDOW_TOPLEVEL) { session = 0; - Config->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide; + _strip_width = Config->get_default_narrow_ms() ? Narrow : Wide; track_menu = 0; mix_group_context_menu = 0; no_track_list_redisplay = false; @@ -200,10 +200,6 @@ Mixer_UI::Mixer_UI () list_hpane.signal_size_allocate().connect (bind (mem_fun(*this, &Mixer_UI::pane_allocation_handler), static_cast (&list_hpane))); - - rhs_pane1.set_data ("collapse-direction", (gpointer) 0); - list_hpane.set_data ("collapse-direction", (gpointer) 1); - global_vpacker.pack_start (list_hpane, true, true); add (global_vpacker); diff --git a/gtk2_ardour/ardour.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in similarity index 96% rename from gtk2_ardour/ardour.bindings.in rename to gtk2_ardour/mnemonic-us.bindings.in index 0465889f74..4089b71be4 100644 --- a/gtk2_ardour/ardour.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -26,9 +26,7 @@ (gtk_accel_path "/Transport/record-roll" "<%TERTIARY%>space") (gtk_accel_path "/Editor/set-fade-in-length" "slash") -(gtk_accel_path "/Editor/set-fade-in-length" "<%SECONDARY%>slash") (gtk_accel_path "/Editor/set-fade-out-length" "backslash") -(gtk_accel_path "/Editor/set-fade-out-length" "<%SECONDARY%>backslash") (gtk_accel_path "/Editor/trim-from-start" "<%TERTIARY%>braceleft") (gtk_accel_path "/Editor/trim-to-end" "<%TERTIARY%>braceright") @@ -81,6 +79,7 @@ (gtk_accel_path "/Editor/duplicate-region" "d") (gtk_accel_path "/Editor/select-all-in-punch-range" "<%PRIMARY%>d") (gtk_accel_path "/Editor/toggle-follow-playhead" "f") +(gtk_accel_path "/Editor/toggle-rhythm-ferret" "<%WINDOW%>f") (gtk_accel_path "/MouseMode/set-mouse-mode-gain" "g") (gtk_accel_path "/Editor/play-selected-regions" "h") (gtk_accel_path "/Editor/trim-front" "j") @@ -117,13 +116,15 @@ (gtk_accel_path "/Transport/TransitionToReverse" "<%PRIMARY%>downarrow") (gtk_accel_path "/Editor/select-next-route" "<%SECONDARY%>downarrow") -(gtk_accel_path "/Editor/scroll-backward" "leftarrow") -(gtk_accel_path "/Transport/Rewind" "<%PRIMARY%>leftarrow") -(gtk_accel_path "/Editor/scroll-playhead-backward" "<%TERTIARY%>leftarrow") +(gtk_accel_path "/Editor/playhead-to-previous-region-boundary" "leftarrow") +(gtk_accel_path "/Editor/tab-to-transient-backwards" "<%PRIMARY%>leftarrow") +(gtk_accel_path "/Editor/nudge-playhead-backward" "<%SECONDARY%>leftarrow") +(gtk_accel_path "/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow") -(gtk_accel_path "/Editor/scroll-forward" "rightarrow") -(gtk_accel_path "/Transport/Forward" "<%PRIMARY%>rightarrow") -(gtk_accel_path "/Editor/scroll-playhead-forward" "<%TERTIARY%>rightarrow") +(gtk_accel_path "/Editor/playhead-to-next-region-boundary" "rightarrow") +(gtk_accel_path "/Editor/tab-to-transient-forwards" "<%PRIMARY%>rightarrow") +(gtk_accel_path "/Editor/nudge-playhead-forward" "<%SECONDARY%>rightarrow") +(gtk_accel_path "/Editor/selected-marker-to-next-region-boundary" "<%PRIMARY%><%TERTIARY%>rightarrow") (gtk_accel_path "/Editor/scroll-tracks-down" "Page_Down") (gtk_accel_path "/Editor/scroll-tracks-up" "Page_Up") @@ -182,12 +183,9 @@ (gtk_accel_path "/Editor/cycle-snap-choice" "3") (gtk_accel_path "/Transport/ToggleAutoReturn" "4") (gtk_accel_path "/Transport/ToggleClick" "5") -(gtk_accel_path "/Editor/tab-to-transient-forwards" "7") -(gtk_accel_path "/Editor/tab-to-transient-backwards" "8") (gtk_accel_path "/Editor/set-tempo-from-region" "9") (gtk_accel_path "/Editor/set-tempo-from-edit-range" "0") - ;; ;; unbound actions ;; diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc index e995ff1a8e..79f6d5e8ee 100644 --- a/gtk2_ardour/new_session_dialog.cc +++ b/gtk2_ardour/new_session_dialog.cc @@ -952,7 +952,9 @@ NewSessionDialog::reset_template() void NewSessionDialog::reset_recent() { - std::vector session_directories; + /* Shamelessly ripped from ardour_ui.cc */ + std::vector *sessions; + std::vector::iterator i; RecentSessionsSorter cmp; recent_model->clear (); @@ -960,27 +962,24 @@ NewSessionDialog::reset_recent() ARDOUR::RecentSessions rs; ARDOUR::read_recent_sessions (rs); - // sort them alphabetically + /* sort them alphabetically */ sort (rs.begin(), rs.end(), cmp); + sessions = new std::vector; for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) { - session_directories.push_back ((*i).second); + sessions->push_back (new string ((*i).second)); } - for (vector::const_iterator i = session_directories.begin(); - i != session_directories.end(); ++i) - { - std::vector state_file_paths; + for (i = sessions->begin(); i != sessions->end(); ++i) { + std::vector* states; - const string fullpath = (*i).to_string(); - - // now get available states for this session - - get_state_files_in_directory (*i, state_file_paths); - - if (state_file_paths.empty()) { - // no state file? - continue; + std::vector item; + std::string fullpath = *(*i); + + /* remove any trailing / */ + + if (fullpath[fullpath.length()-1] == '/') { + fullpath = fullpath.substr (0, fullpath.length()-1); } /* check whether session still exists */ @@ -992,8 +991,8 @@ NewSessionDialog::reset_recent() /* now get available states for this session */ if ((states = ARDOUR::Session::possible_states (fullpath)) == 0) { - /* no state file? */ - continue; + /* no state file? */ + continue; } Gtk::TreeModel::Row row = *(recent_model->append()); @@ -1015,7 +1014,10 @@ NewSessionDialog::reset_recent() delete *i2; } } + + delete states; } + delete sessions; } void diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 0184e3a00a..988aa92e45 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -100,7 +101,7 @@ OptionEditor::OptionEditor (ARDOUR_UI& uip, PublicEditor& ed, Mixer_UI& mixui) /* kbd/mouse */ - keyboard_mouse_table (3, 4), + keyboard_mouse_table (4, 4), delete_button_adjustment (3, 1, 5), delete_button_spin (delete_button_adjustment), edit_button_adjustment (3, 1, 5), @@ -1082,14 +1083,14 @@ static const struct { #ifdef GTKOSX - /* Command = Mod1 - Option/Alt = Mod5 + /* Command = Meta + Option/Alt = Mod1 */ { "Shift", GDK_SHIFT_MASK }, - { "Command", GDK_MOD1_MASK }, + { "Command", GDK_META_MASK }, { "Control", GDK_CONTROL_MASK }, - { "Option", GDK_MOD5_MASK }, + { "Option", GDK_MOD1_MASK }, { "Command-Shift", GDK_MOD1_MASK|GDK_SHIFT_MASK }, { "Command-Option", GDK_MOD1_MASK|GDK_MOD5_MASK }, { "Shift-Option", GDK_SHIFT_MASK|GDK_MOD5_MASK }, @@ -1197,6 +1198,39 @@ OptionEditor::setup_keyboard_options () keyboard_mouse_table.attach (*label, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, FILL); keyboard_mouse_table.attach (snap_modifier_combo, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, FILL); + + vector strs; + + for (std::map::iterator bf = Keyboard::binding_files.begin(); bf != Keyboard::binding_files.end(); ++bf) { + strs.push_back (bf->first); + } + + set_popdown_strings (keyboard_layout_selector, strs); + keyboard_layout_selector.set_active_text (Keyboard::current_binding_name()); + keyboard_layout_selector.signal_changed().connect (mem_fun (*this, &OptionEditor::bindings_changed)); + + label = manage (new Label (_("Keyboard layout"))); + label->set_name ("OptionsLabel"); + label->set_alignment (1.0, 0.5); + + keyboard_mouse_table.attach (*label, 0, 1, 3, 4, Gtk::FILL|Gtk::EXPAND, FILL); + keyboard_mouse_table.attach (keyboard_layout_selector, 1, 2, 3, 4, Gtk::FILL|Gtk::EXPAND, FILL); +} + +void +OptionEditor::bindings_changed () +{ + string txt; + + txt = keyboard_layout_selector.get_active_text(); + + for (std::map::iterator i = Keyboard::binding_files.begin(); i != Keyboard::binding_files.end(); ++i) { + if (txt == i->first) { + if (Keyboard::load_keybindings (i->second)) { + Keyboard::save_keybindings (); + } + } + } } void diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h index 82bb4db79b..45fe092eab 100644 --- a/gtk2_ardour/option_editor.h +++ b/gtk2_ardour/option_editor.h @@ -1,3 +1,6 @@ +#ifndef __gtk_ardour_option_editor_h__ +#define __gtk_ardour_option_editor_h__ + /* Copyright (C) 2001 Paul Davis @@ -17,8 +20,7 @@ */ -#ifndef __gtk_ardour_option_editor_h__ -#define __gtk_ardour_option_editor_h__ +#include #include #include @@ -203,6 +205,7 @@ class OptionEditor : public ArdourDialog /* keyboard/mouse */ Gtk::Table keyboard_mouse_table; + Gtk::ComboBoxText keyboard_layout_selector; Gtk::ComboBoxText edit_modifier_combo; Gtk::ComboBoxText delete_modifier_combo; Gtk::ComboBoxText snap_modifier_combo; @@ -211,12 +214,15 @@ class OptionEditor : public ArdourDialog Gtk::Adjustment edit_button_adjustment; Gtk::SpinButton edit_button_spin; + std::map bindings_files; + void setup_keyboard_options (); void delete_modifier_chosen (); void edit_modifier_chosen (); void snap_modifier_chosen (); void edit_button_changed (); void delete_button_changed (); + void bindings_changed (); void fixup_combo_size (Gtk::ComboBoxText&, std::vector& strings); }; diff --git a/gtk2_ardour/opts.cc b/gtk2_ardour/opts.cc index f2f255c953..55bb58168d 100644 --- a/gtk2_ardour/opts.cc +++ b/gtk2_ardour/opts.cc @@ -78,7 +78,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) if (getenv ("ARDOUR_SAE")) { menus_file = "ardour-sae.menus"; - keybindings_path = "ardour-sae"; + keybindings_path = "SAE"; } if (execname == 0) { diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index dad6ba2c52..7f2955dfda 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -62,7 +62,6 @@ using namespace Gtk; using namespace sigc; PluginUIWindow::PluginUIWindow (boost::shared_ptr insert, nframes64_t sr, nframes64_t period, bool scrollable) - : ArdourDialog ("plugin ui") { bool have_gui = false; non_gtk_gui = false; @@ -77,10 +76,7 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr insert, nframes6 break; case ARDOUR::AudioUnit: - //have_gui = create_audiounit_editor (insert); - have_gui = true; - get_vbox()->pack_start (*label, false, false); - cerr << "#*#*#*#*#*#*#*#*## PACK " << label << " INTO PLUGIN UI\n"; + have_gui = create_audiounit_editor (insert); break; case ARDOUR::LADSPA: @@ -105,7 +101,7 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr insert, nframes6 GenericPluginUI* pu = new GenericPluginUI (insert, scrollable); _pluginui = pu; - get_vbox()->add (*pu); + add (*pu); set_wmclass (X_("ardour_plugin_editor"), "Ardour"); @@ -113,14 +109,13 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr insert, nframes6 signal_unmap_event().connect (mem_fun (*pu, &GenericPluginUI::stop_updating)); } - set_position (Gtk::WIN_POS_MOUSE); + // set_position (Gtk::WIN_POS_MOUSE); set_name ("PluginEditor"); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast (this)), false); insert->GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away)); -#if 0 gint h = _pluginui->get_preferred_height (); gint w = _pluginui->get_preferred_width (); @@ -134,7 +129,6 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr insert, nframes6 } set_default_size (w, h); -#endif } PluginUIWindow::~PluginUIWindow () @@ -146,23 +140,14 @@ PluginUIWindow::on_show () { cerr << "PluginWindow shown\n"; - ArdourDialog::on_show (); - Glib::ListHandle kids (get_vbox()->get_children()); - - cerr << "send show to " << kids.size() << " children of this plugin UI\n"; - - for (Glib::ListHandle::iterator x = kids.begin(); x != kids.end(); ++x) { - cerr << "\tSend show to " << (*x) << endl; - (*x)->show (); - } - cerr << "!! send done\n"; + Window::on_show (); } void PluginUIWindow::on_hide () { cerr << "PluginWindow hidden\n"; - ArdourDialog::on_hide (); + Window::on_hide (); } bool @@ -182,7 +167,7 @@ PluginUIWindow::create_vst_editor(boost::shared_ptr insert) VSTPluginUI* vpu = new VSTPluginUI (insert, vp); _pluginui = vpu; - get_vbox()->add (*vpu); + add (*vpu); vpu->package (*this); } @@ -199,8 +184,7 @@ PluginUIWindow::create_audiounit_editor (boost::shared_ptr insert) #else VBox* box; _pluginui = create_au_gui (insert, &box); - cerr << "#*#*#*#*#*#*#*#*## PACK " << box << " INTO PLUGIN UI\n"; - get_vbox()->add (*box); + add (*box); non_gtk_gui = true; extern sigc::signal ApplicationActivationChanged; @@ -214,12 +198,16 @@ void PluginUIWindow::app_activated (bool yn) { #if defined (HAVE_AUDIOUNITS) && defined(GTKOSX) - if (yn) { - if (_pluginui) { - _pluginui->activate (); - } - } cerr << "APP activated ? " << yn << endl; + if (_pluginui) { + if (yn) { + _pluginui->activate (); + present (); + } else { + hide (); + _pluginui->deactivate (); + } + } #endif } @@ -261,28 +249,43 @@ PlugUIBase::PlugUIBase (boost::shared_ptr pi) bypass_button (_("Bypass")), latency_gui (*pi, pi->session().frame_rate(), pi->session().get_block_size()) { - //combo.set_use_arrows_always(true); - set_popdown_strings (combo, plugin->get_presets()); - combo.set_size_request (100, -1); - combo.set_active_text (""); - combo.signal_changed().connect(mem_fun(*this, &PlugUIBase::setting_selected)); + //preset_combo.set_use_arrows_always(true); + set_popdown_strings (preset_combo, plugin->get_presets()); + preset_combo.set_size_request (100, -1); + preset_combo.set_active_text (""); + preset_combo.signal_changed().connect(mem_fun(*this, &PlugUIBase::setting_selected)); save_button.set_name ("PluginSaveButton"); save_button.signal_clicked().connect(mem_fun(*this, &PlugUIBase::save_plugin_setting)); + insert->ActiveChanged.connect (bind( + mem_fun(*this, &PlugUIBase::processor_active_changed), + boost::weak_ptr(insert))); + + bypass_button.set_active (!pi->active()); + bypass_button.set_name ("PluginBypassButton"); bypass_button.signal_toggled().connect (mem_fun(*this, &PlugUIBase::bypass_toggled)); } +void +PlugUIBase::processor_active_changed (boost::weak_ptr weak_p) +{ + ENSURE_GUI_THREAD(bind (mem_fun(*this, &PlugUIBase::processor_active_changed), weak_p)); + boost::shared_ptr p (weak_p); + if (p) { + bypass_button.set_active (!p->active()); + } +} + void PlugUIBase::setting_selected() { - if (combo.get_active_text().length() > 0) { - if (!plugin->load_preset(combo.get_active_text())) { - warning << string_compose(_("Plugin preset %1 not found"), combo.get_active_text()) << endmsg; + if (preset_combo.get_active_text().length() > 0) { + if (!plugin->load_preset(preset_combo.get_active_text())) { + warning << string_compose(_("Plugin preset %1 not found"), preset_combo.get_active_text()) << endmsg; } } - } void @@ -304,8 +307,8 @@ PlugUIBase::save_plugin_setting () if (name.length()) { if(plugin->save_preset(name)){ - set_popdown_strings (combo, plugin->get_presets()); - combo.set_active_text (name); + set_popdown_strings (preset_combo, plugin->get_presets()); + preset_combo.set_active_text (name); } } break; diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index 74f9c46424..72cfc465e6 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -82,7 +82,7 @@ class PlugUIBase : public virtual sigc::trackable protected: boost::shared_ptr insert; boost::shared_ptr plugin; - Gtk::ComboBoxText combo; + Gtk::ComboBoxText preset_combo; Gtk::Button save_button; Gtk::ToggleButton bypass_button; LatencyGUI latency_gui; @@ -90,6 +90,7 @@ class PlugUIBase : public virtual sigc::trackable void setting_selected(); void save_plugin_setting (void); void bypass_toggled(); + void processor_active_changed (boost::weak_ptr p); }; class GenericPluginUI : public PlugUIBase, public Gtk::VBox @@ -200,7 +201,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox void print_parameter (char *buf, uint32_t len, uint32_t param); }; -class PluginUIWindow : public ArdourDialog +class PluginUIWindow : public Gtk::Window { public: PluginUIWindow (boost::shared_ptr insert, nframes64_t sample_rate, nframes64_t period_size, bool scrollable = false); @@ -217,6 +218,7 @@ class PluginUIWindow : public ArdourDialog private: PlugUIBase* _pluginui; + Gtk::VBox vbox; bool non_gtk_gui; void app_activated (bool); void plugin_going_away (); diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index e012922e0f..9f6dff823b 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -400,6 +400,7 @@ ProcessorBox::processor_plugin_chosen (boost::shared_ptr plugin) weird_plugin_dialog (*plugin, err, _route); // XXX SHAREDPTR delete plugin here .. do we even need to care? } else { + processor->set_active(true); processor->ActiveChanged.connect (bind (mem_fun (*this, &ProcessorBox::show_processor_active), boost::weak_ptr(processor))); } } @@ -1137,13 +1138,20 @@ ProcessorBox::edit_processor (boost::shared_ptr processor) plugin_ui = reinterpret_cast (plugin_processor->get_gui()); } - if (plugin_ui->is_visible()) { - plugin_ui->get_window()->raise (); - } else { - plugin_ui->show_all (); - plugin_ui->present (); - } -#endif + plugin_ui = new PluginUIWindow (plugin_insert); + + // plugin_ui->set_keep_above (true); + + WindowTitle title(Glib::get_application_name()); + title += generate_redirect_title (plugin_insert); + plugin_ui->set_title (title.get_string()); + + plugin_insert->set_gui (plugin_ui); + + // change window title when route name is changed + _route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, boost::weak_ptr (plugin_insert))); +#endif + } else { warning << "Unsupported plugin sent to ProcessorBox::edit_processor()" << endmsg; return; diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 5081a207cf..0a4a3acc95 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -254,7 +254,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway virtual void restore_editing_space () = 0; virtual nframes64_t get_preferred_edit_position (bool ignore_playhead = false) = 0; virtual void toggle_meter_updating() = 0; - virtual void split_region_at_points (boost::shared_ptr, ARDOUR::AnalysisFeatureList&) = 0; + virtual void split_region_at_points (boost::shared_ptr, ARDOUR::AnalysisFeatureList&, bool can_ferret) = 0; + virtual void mouse_add_new_marker (nframes_t where, bool is_cd=false, bool is_xrun=false) = 0; #ifdef WITH_CMT virtual void add_imageframe_time_axis(const std::string & track_name, void*) = 0; diff --git a/gtk2_ardour/rhythm_ferret.cc b/gtk2_ardour/rhythm_ferret.cc index d8d2f3c28b..83852b33b3 100644 --- a/gtk2_ardour/rhythm_ferret.cc +++ b/gtk2_ardour/rhythm_ferret.cc @@ -271,7 +271,7 @@ RhythmFerret::do_split_action () (*i)->get_time_axis_view().hide_temporary_lines (); - editor.split_region_at_points ((*i)->region(), current_results); + editor.split_region_at_points ((*i)->region(), current_results, false); /* i is invalid at this point */ diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index bd6f8db95e..9e955e4345 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -79,10 +79,20 @@ using namespace ARDOUR; using namespace PBD; +using namespace Gtkmm2ext; using namespace Gtk; using namespace Editing; using namespace sigc; +using namespace std; +Glib::RefPtr RouteTimeAxisView::slider; + +int +RouteTimeAxisView::setup_slider_pix () +{ + slider = ::get_icon ("fader_belt_h"); + return 0; +} RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr rt, Canvas& canvas) : AxisView(sess), @@ -96,8 +106,15 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh automation_button (_("a")), visual_button (_("v")), lm (rt, sess), - underlay_xml_node (0) + underlay_xml_node (0), + gain_slider (0), + gain_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1) + { + if (slider == 0) { + setup_slider_pix (); + } + lm.set_no_show_all(); lm.setup_meters(50); _has_state = true; @@ -110,6 +127,8 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh destructive_track_mode_item = 0; normal_track_mode_item = 0; + gain_slider = manage (new HSliderController (slider, &gain_adjustment, *_route->gain_control().get(), false)); + ignore_toggle = false; edit_group_button.set_name ("TrackGroupButton"); @@ -151,7 +170,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press), false); rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release)); - controls_table.attach (*rec_enable_button, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); + controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record")); } @@ -161,10 +180,11 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh _route->input_changed.connect (mem_fun(*this, &RouteTimeAxisView::io_changed)); _route->output_changed.connect (mem_fun(*this, &RouteTimeAxisView::io_changed)); - controls_table.attach (*mute_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); - controls_table.attach (*solo_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); + controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); + controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); - controls_table.attach (edit_group_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); + controls_table.attach (edit_group_button, 7, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); + controls_table.attach (*gain_slider, 0, 5, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 0, 0); ARDOUR_UI::instance()->tooltips().set_tip(*solo_button,_("Solo")); ARDOUR_UI::instance()->tooltips().set_tip(*mute_button,_("Mute")); @@ -188,11 +208,11 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh } else { - controls_table.attach (automation_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND); + controls_table.attach (automation_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND); } if (is_track() && track()->mode() == ARDOUR::Normal) { - controls_table.attach (playlist_button, 4, 5, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND); + controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND); } y_position = -1; @@ -218,6 +238,15 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit)); ColorsChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler)); + + gain_slider->signal_button_press_event().connect (mem_fun(*this, &RouteTimeAxisView::start_gain_touch)); + gain_slider->signal_button_release_event().connect (mem_fun(*this, &RouteTimeAxisView::end_gain_touch)); + gain_slider->set_name ("TrackGainFader"); + + gain_adjustment.signal_value_changed().connect (mem_fun(*this, &RouteTimeAxisView::gain_adjusted)); + _route->gain_control()->Changed.connect (mem_fun(*this, &RouteTimeAxisView::gain_changed)); + + gain_slider->show_all(); } RouteTimeAxisView::~RouteTimeAxisView () @@ -2255,3 +2284,37 @@ RouteTimeAxisView::remove_underlay(StreamView* v) } } } + +gint +RouteTimeAxisView::start_gain_touch (GdkEventButton* ev) +{ + _route->gain_control()->list()->start_touch (); + return FALSE; +} + +gint +RouteTimeAxisView::end_gain_touch (GdkEventButton* ev) +{ + _route->gain_control()->list()->stop_touch (); + return FALSE; +} + +void +RouteTimeAxisView::gain_adjusted () +{ + _route->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this); +} + +void +RouteTimeAxisView::gain_changed () +{ + Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &RouteTimeAxisView::effective_gain_display)); +} + +void +RouteTimeAxisView::effective_gain_display () +{ + gfloat value = gain_to_slider_position (_route->effective_gain()); + gain_adjustment.set_value (value); +} + diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 6978524246..e318451832 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -27,8 +27,10 @@ #include #include #include +#include #include +#include #include #include @@ -132,6 +134,7 @@ public: void clear_meter (); void io_changed (ARDOUR::IOChange, void *); void meter_changed (void *); + void effective_gain_display (); protected: friend class StreamView; @@ -307,6 +310,16 @@ protected: UnderlayList _underlay_streams; typedef list UnderlayMirrorList; UnderlayMirrorList _underlay_mirrors; + + Gtkmm2ext::HSliderController *gain_slider; + Gtk::Adjustment gain_adjustment; + static Glib::RefPtr slider; + static int setup_slider_pix (); + void gain_adjusted(); + + gint start_gain_touch (GdkEventButton*); + gint end_gain_touch (GdkEventButton*); + void gain_changed (); }; #endif /* __ardour_route_time_axis_h__ */ diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index e901521e37..893ecc3d2c 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -5,6 +5,7 @@ #include #include +#include "gui_thread.h" #include "splash.h" #include "i18n.h" @@ -36,6 +37,7 @@ Splash::Splash () set_keep_above (true); set_position (WIN_POS_CENTER); darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); + darea.set_double_buffered (false); layout = create_pango_layout (""); string str = ""; @@ -50,7 +52,10 @@ Splash::Splash () add (darea); + set_default_size (pixbuf->get_width(), pixbuf->get_height()); the_splash = this; + + ARDOUR::BootMessage.connect (mem_fun (*this, &Splash::boot_message)); } void @@ -80,12 +85,17 @@ Splash::expose (GdkEventExpose* ev) { RefPtr window = darea.get_window(); + /* note: height & width need to be constrained to the pixbuf size + in case a WM provides us with a screwy allocation + */ + window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf, ev->area.x, ev->area.y, ev->area.x, ev->area.y, - ev->area.width, ev->area.height, + min ((pixbuf->get_width() - ev->area.x), ev->area.width), + min ((pixbuf->get_height() - ev->area.y), ev->area.height), Gdk::RGB_DITHER_NONE, 0, 0); - + Glib::RefPtr style = darea.get_style(); Glib::RefPtr white = style->get_white_gc(); @@ -94,6 +104,12 @@ Splash::expose (GdkEventExpose* ev) return true; } +void +Splash::boot_message (std::string msg) +{ + message (msg); +} + void Splash::message (const string& msg) { @@ -103,5 +119,10 @@ Splash::message (const string& msg) layout->set_markup (str); darea.queue_draw (); - get_window()->process_updates (true); + + Glib::RefPtr win = darea.get_window(); + if (win) { + win->process_updates (true); + gdk_flush (); + } } diff --git a/gtk2_ardour/splash.h b/gtk2_ardour/splash.h index 07532d9344..a034ddad86 100644 --- a/gtk2_ardour/splash.h +++ b/gtk2_ardour/splash.h @@ -50,6 +50,8 @@ class Splash : public Gtk::Window Glib::RefPtr pixbuf; Gtk::DrawingArea darea; Glib::RefPtr layout; + + void boot_message (std::string); }; #endif /* __ardour_gtk_splash_h__ */ diff --git a/gtk2_ardour/sync-menu.c b/gtk2_ardour/sync-menu.c deleted file mode 100644 index 60dff79e07..0000000000 --- a/gtk2_ardour/sync-menu.c +++ /dev/null @@ -1,921 +0,0 @@ -/* GTK+ Integration for the Mac OS X Menubar. - * - * Copyright (C) 2007 Pioneer Research Center USA, Inc. - * Copyright (C) 2007 Imendio AB - * - * For further information, see: - * http://developer.imendio.com/projects/gtk-macosx/menubar - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; version 2.1 - * of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include -#include - -#include - -#include "ige-mac-menu.h" - - -/* TODO - * - * - Sync adding/removing/reordering items - * - Create on demand? (can this be done with gtk+? ie fill in menu - items when the menu is opened) - * - Figure out what to do per app/window... - * - */ - -#define IGE_QUARTZ_MENU_CREATOR 'IGEC' -#define IGE_QUARTZ_ITEM_WIDGET 'IWID' - - -static void sync_menu_shell (GtkMenuShell *menu_shell, - MenuRef carbon_menu, - gboolean toplevel, - gboolean debug); - - -/* - * utility functions - */ - -static GtkWidget * -find_menu_label (GtkWidget *widget) -{ - GtkWidget *label = NULL; - - if (GTK_IS_LABEL (widget)) - return widget; - - if (GTK_IS_CONTAINER (widget)) - { - GList *children; - GList *l; - - children = gtk_container_get_children (GTK_CONTAINER (widget)); - - for (l = children; l; l = l->next) - { - label = find_menu_label (l->data); - if (label) - break; - } - - g_list_free (children); - } - - return label; -} - -static const gchar * -get_menu_label_text (GtkWidget *menu_item, - GtkWidget **label) -{ - GtkWidget *my_label; - - my_label = find_menu_label (menu_item); - if (label) - *label = my_label; - - if (my_label) - return gtk_label_get_text (GTK_LABEL (my_label)); - - return NULL; -} - -static gboolean -accel_find_func (GtkAccelKey *key, - GClosure *closure, - gpointer data) -{ - return (GClosure *) data == closure; -} - - -/* - * CarbonMenu functions - */ - -typedef struct -{ - MenuRef menu; -} CarbonMenu; - -static GQuark carbon_menu_quark = 0; - -static CarbonMenu * -carbon_menu_new (void) -{ - return g_slice_new0 (CarbonMenu); -} - -static void -carbon_menu_free (CarbonMenu *menu) -{ - g_slice_free (CarbonMenu, menu); -} - -static CarbonMenu * -carbon_menu_get (GtkWidget *widget) -{ - return g_object_get_qdata (G_OBJECT (widget), carbon_menu_quark); -} - -static void -carbon_menu_connect (GtkWidget *menu, - MenuRef menuRef) -{ - CarbonMenu *carbon_menu = carbon_menu_get (menu); - - if (!carbon_menu) - { - carbon_menu = carbon_menu_new (); - - g_object_set_qdata_full (G_OBJECT (menu), carbon_menu_quark, - carbon_menu, - (GDestroyNotify) carbon_menu_free); - } - - carbon_menu->menu = menuRef; -} - - -/* - * CarbonMenuItem functions - */ - -typedef struct -{ - MenuRef menu; - MenuItemIndex index; - MenuRef submenu; - GClosure *accel_closure; -} CarbonMenuItem; - -static GQuark carbon_menu_item_quark = 0; - -static CarbonMenuItem * -carbon_menu_item_new (void) -{ - return g_slice_new0 (CarbonMenuItem); -} - -static void -carbon_menu_item_free (CarbonMenuItem *menu_item) -{ - if (menu_item->accel_closure) - g_closure_unref (menu_item->accel_closure); - - g_slice_free (CarbonMenuItem, menu_item); -} - -static CarbonMenuItem * -carbon_menu_item_get (GtkWidget *widget) -{ - return g_object_get_qdata (G_OBJECT (widget), carbon_menu_item_quark); -} - -static void -carbon_menu_item_update_state (CarbonMenuItem *carbon_item, - GtkWidget *widget) -{ - gboolean sensitive; - gboolean visible; - UInt32 set_attrs = 0; - UInt32 clear_attrs = 0; - - g_object_get (widget, - "sensitive", &sensitive, - "visible", &visible, - NULL); - - if (!sensitive) - set_attrs |= kMenuItemAttrDisabled; - else - clear_attrs |= kMenuItemAttrDisabled; - - if (!visible) - set_attrs |= kMenuItemAttrHidden; - else - clear_attrs |= kMenuItemAttrHidden; - - ChangeMenuItemAttributes (carbon_item->menu, carbon_item->index, - set_attrs, clear_attrs); -} - -static void -carbon_menu_item_update_active (CarbonMenuItem *carbon_item, - GtkWidget *widget) -{ - gboolean active; - - g_object_get (widget, - "active", &active, - NULL); - - CheckMenuItem (carbon_item->menu, carbon_item->index, - active); -} - -static void -carbon_menu_item_update_submenu (CarbonMenuItem *carbon_item, - GtkWidget *widget) -{ - GtkWidget *submenu; - - submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget)); - - if (submenu) - { - const gchar *label_text; - CFStringRef cfstr = NULL; - - label_text = get_menu_label_text (widget, NULL); - if (label_text) - cfstr = CFStringCreateWithCString (NULL, label_text, - kCFStringEncodingUTF8); - - CreateNewMenu (0, 0, &carbon_item->submenu); - SetMenuTitleWithCFString (carbon_item->submenu, cfstr); - SetMenuItemHierarchicalMenu (carbon_item->menu, carbon_item->index, - carbon_item->submenu); - - sync_menu_shell (GTK_MENU_SHELL (submenu), carbon_item->submenu, FALSE, FALSE); - - if (cfstr) - CFRelease (cfstr); - } - else - { - SetMenuItemHierarchicalMenu (carbon_item->menu, carbon_item->index, - NULL); - carbon_item->submenu = NULL; - } -} - -static void -carbon_menu_item_update_label (CarbonMenuItem *carbon_item, - GtkWidget *widget) -{ - const gchar *label_text; - CFStringRef cfstr = NULL; - - label_text = get_menu_label_text (widget, NULL); - if (label_text) - cfstr = CFStringCreateWithCString (NULL, label_text, - kCFStringEncodingUTF8); - - SetMenuItemTextWithCFString (carbon_item->menu, carbon_item->index, - cfstr); - - if (cfstr) - CFRelease (cfstr); -} - -static void -carbon_menu_item_update_accelerator (CarbonMenuItem *carbon_item, - GtkWidget *widget) -{ - GtkWidget *label; - - get_menu_label_text (widget, &label); - - if (GTK_IS_ACCEL_LABEL (label) && - GTK_ACCEL_LABEL (label)->accel_closure) - { - GtkAccelKey *key; - - key = gtk_accel_group_find (GTK_ACCEL_LABEL (label)->accel_group, - accel_find_func, - GTK_ACCEL_LABEL (label)->accel_closure); - - if (key && - key->accel_key && - key->accel_flags & GTK_ACCEL_VISIBLE) - { - GdkDisplay *display = gtk_widget_get_display (widget); - GdkKeymap *keymap = gdk_keymap_get_for_display (display); - GdkKeymapKey *keys; - gint n_keys; - gint use_command; - - if (gdk_keymap_get_entries_for_keyval (keymap, key->accel_key, - &keys, &n_keys)) - { - UInt8 modifiers = 0; /* implies Command key */ - - SetMenuItemCommandKey (carbon_item->menu, carbon_item->index, - true, keys[0].keycode); - - g_free (keys); - - use_command = 0; - - if (key->accel_mods) - { - if (key->accel_mods & GDK_SHIFT_MASK) { - modifiers |= kMenuShiftModifier; - } - - if (key->accel_mods & (GDK_MOD1_MASK)) { - modifiers |= kMenuOptionModifier; - } - - if (key->accel_mods & GDK_CONTROL_MASK) { - modifiers |= kMenuControlModifier; - } - - if (key->accel_mods & GDK_MOD5_MASK) { - /* Mod5 is what ardour's binding file uses to mean "Command" - Nothing needs to be set in modifiers, but we need to notice - that there *is* an implicit modifier - */ - use_command = 1; - } - } - - if (!use_command) - modifiers |= kMenuNoCommandModifier; - - SetMenuItemModifiers (carbon_item->menu, carbon_item->index, - modifiers); - - return; - } - } - } - - /* otherwise, clear the menu shortcut */ - SetMenuItemModifiers (carbon_item->menu, carbon_item->index, - kMenuNoModifiers | kMenuNoCommandModifier); - ChangeMenuItemAttributes (carbon_item->menu, carbon_item->index, - 0, kMenuItemAttrUseVirtualKey); - SetMenuItemCommandKey (carbon_item->menu, carbon_item->index, - false, 0); -} - -static void -carbon_menu_item_accel_changed (GtkAccelGroup *accel_group, - guint keyval, - GdkModifierType modifier, - GClosure *accel_closure, - GtkWidget *widget) -{ - CarbonMenuItem *carbon_item = carbon_menu_item_get (widget); - GtkWidget *label; - - get_menu_label_text (widget, &label); - - if (GTK_IS_ACCEL_LABEL (label) && - GTK_ACCEL_LABEL (label)->accel_closure == accel_closure) - carbon_menu_item_update_accelerator (carbon_item, widget); -} - -static void -carbon_menu_item_update_accel_closure (CarbonMenuItem *carbon_item, - GtkWidget *widget) -{ - GtkAccelGroup *group; - GtkWidget *label; - - get_menu_label_text (widget, &label); - - if (carbon_item->accel_closure) - { - group = gtk_accel_group_from_accel_closure (carbon_item->accel_closure); - - g_signal_handlers_disconnect_by_func (group, - carbon_menu_item_accel_changed, - widget); - - g_closure_unref (carbon_item->accel_closure); - carbon_item->accel_closure = NULL; - } - - if (GTK_IS_ACCEL_LABEL (label)) - carbon_item->accel_closure = GTK_ACCEL_LABEL (label)->accel_closure; - - if (carbon_item->accel_closure) - { - g_closure_ref (carbon_item->accel_closure); - - group = gtk_accel_group_from_accel_closure (carbon_item->accel_closure); - - g_signal_connect_object (group, "accel-changed", - G_CALLBACK (carbon_menu_item_accel_changed), - widget, 0); - } - - carbon_menu_item_update_accelerator (carbon_item, widget); -} - -static void -carbon_menu_item_notify (GObject *object, - GParamSpec *pspec, - CarbonMenuItem *carbon_item) -{ - if (!strcmp (pspec->name, "sensitive") || - !strcmp (pspec->name, "visible")) - { - carbon_menu_item_update_state (carbon_item, GTK_WIDGET (object)); - } - else if (!strcmp (pspec->name, "active")) - { - carbon_menu_item_update_active (carbon_item, GTK_WIDGET (object)); - } - else if (!strcmp (pspec->name, "submenu")) - { - carbon_menu_item_update_submenu (carbon_item, GTK_WIDGET (object)); - } -} - -static void -carbon_menu_item_notify_label (GObject *object, - GParamSpec *pspec, - gpointer data) -{ - CarbonMenuItem *carbon_item = carbon_menu_item_get (GTK_WIDGET (object)); - - if (!strcmp (pspec->name, "label")) - { - carbon_menu_item_update_label (carbon_item, - GTK_WIDGET (object)); - } - else if (!strcmp (pspec->name, "accel-closure")) - { - carbon_menu_item_update_accel_closure (carbon_item, - GTK_WIDGET (object)); - } -} - -static CarbonMenuItem * -carbon_menu_item_connect (GtkWidget *menu_item, - GtkWidget *label, - MenuRef menu, - MenuItemIndex index) -{ - CarbonMenuItem *carbon_item = carbon_menu_item_get (menu_item); - - if (!carbon_item) - { - carbon_item = carbon_menu_item_new (); - - g_object_set_qdata_full (G_OBJECT (menu_item), carbon_menu_item_quark, - carbon_item, - (GDestroyNotify) carbon_menu_item_free); - - g_signal_connect (menu_item, "notify", - G_CALLBACK (carbon_menu_item_notify), - carbon_item); - - if (label) - g_signal_connect_swapped (label, "notify::label", - G_CALLBACK (carbon_menu_item_notify_label), - menu_item); - } - - carbon_item->menu = menu; - carbon_item->index = index; - - return carbon_item; -} - - -/* - * carbon event handler - */ - -static OSStatus -menu_event_handler_func (EventHandlerCallRef event_handler_call_ref, - EventRef event_ref, - void *data) -{ - UInt32 event_class = GetEventClass (event_ref); - UInt32 event_kind = GetEventKind (event_ref); - MenuRef menu_ref; - - switch (event_class) - { - case kEventClassCommand: - /* This is called when activating (is that the right GTK+ term?) - * a menu item. - */ - if (event_kind == kEventCommandProcess) - { - HICommand command; - OSStatus err; - - /*g_printerr ("Menu: kEventClassCommand/kEventCommandProcess\n");*/ - - err = GetEventParameter (event_ref, kEventParamDirectObject, - typeHICommand, 0, - sizeof (command), 0, &command); - - if (err == noErr) - { - GtkWidget *widget = NULL; - - /* Get any GtkWidget associated with the item. */ - err = GetMenuItemProperty (command.menu.menuRef, - command.menu.menuItemIndex, - IGE_QUARTZ_MENU_CREATOR, - IGE_QUARTZ_ITEM_WIDGET, - sizeof (widget), 0, &widget); - if (err == noErr && GTK_IS_WIDGET (widget)) - { - gtk_menu_item_activate (GTK_MENU_ITEM (widget)); - return noErr; - } - } - } - break; - - case kEventClassMenu: - GetEventParameter (event_ref, - kEventParamDirectObject, - typeMenuRef, - NULL, - sizeof (menu_ref), - NULL, - &menu_ref); - - switch (event_kind) - { - case kEventMenuTargetItem: - /* This is called when an item is selected (what is the - * GTK+ term? prelight?) - */ - /*g_printerr ("kEventClassMenu/kEventMenuTargetItem\n");*/ - break; - - case kEventMenuOpening: - /* Is it possible to dynamically build the menu here? We - * can at least set visibility/sensitivity. - */ - /*g_printerr ("kEventClassMenu/kEventMenuOpening\n");*/ - break; - - case kEventMenuClosed: - /*g_printerr ("kEventClassMenu/kEventMenuClosed\n");*/ - break; - - default: - break; - } - - break; - - default: - break; - } - - return CallNextEventHandler (event_handler_call_ref, event_ref); -} - -static void -setup_menu_event_handler (void) -{ - EventHandlerUPP menu_event_handler_upp; - EventHandlerRef menu_event_handler_ref; - const EventTypeSpec menu_events[] = { - { kEventClassCommand, kEventCommandProcess }, - { kEventClassMenu, kEventMenuTargetItem }, - { kEventClassMenu, kEventMenuOpening }, - { kEventClassMenu, kEventMenuClosed } - }; - - /* FIXME: We might have to install one per window? */ - - menu_event_handler_upp = NewEventHandlerUPP (menu_event_handler_func); - InstallEventHandler (GetApplicationEventTarget (), menu_event_handler_upp, - GetEventTypeCount (menu_events), menu_events, 0, - &menu_event_handler_ref); - -#if 0 - /* FIXME: Remove the handler with: */ - RemoveEventHandler(menu_event_handler_ref); - DisposeEventHandlerUPP(menu_event_handler_upp); -#endif -} - -static void -sync_menu_shell (GtkMenuShell *menu_shell, - MenuRef carbon_menu, - gboolean toplevel, - gboolean debug) -{ - GList *children; - GList *l; - MenuItemIndex carbon_index = 1; - - if (debug) - g_printerr ("%s: syncing shell %p\n", G_STRFUNC, menu_shell); - - carbon_menu_connect (GTK_WIDGET (menu_shell), carbon_menu); - - children = gtk_container_get_children (GTK_CONTAINER (menu_shell)); - - for (l = children; l; l = l->next) - { - GtkWidget *menu_item = l->data; - CarbonMenuItem *carbon_item; - - if (GTK_IS_TEAROFF_MENU_ITEM (menu_item)) - continue; - - if (toplevel && g_object_get_data (G_OBJECT (menu_item), - "gtk-empty-menu-item")) - continue; - - carbon_item = carbon_menu_item_get (menu_item); - - if (debug) - g_printerr ("%s: carbon_item %d for menu_item %d (%s, %s)\n", - G_STRFUNC, carbon_item ? carbon_item->index : -1, - carbon_index, get_menu_label_text (menu_item, NULL), - g_type_name (G_TYPE_FROM_INSTANCE (menu_item))); - - if (carbon_item && carbon_item->index != carbon_index) - { - if (debug) - g_printerr ("%s: -> not matching, deleting\n", G_STRFUNC); - - DeleteMenuItem (carbon_item->menu, carbon_index); - carbon_item = NULL; - } - - if (!carbon_item) - { - GtkWidget *label = NULL; - const gchar *label_text; - CFStringRef cfstr = NULL; - MenuItemAttributes attributes = 0; - - if (debug) - g_printerr ("%s: -> creating new\n", G_STRFUNC); - - label_text = get_menu_label_text (menu_item, &label); - if (label_text) - cfstr = CFStringCreateWithCString (NULL, label_text, - kCFStringEncodingUTF8); - - if (GTK_IS_SEPARATOR_MENU_ITEM (menu_item)) - attributes |= kMenuItemAttrSeparator; - - if (!GTK_WIDGET_IS_SENSITIVE (menu_item)) - attributes |= kMenuItemAttrDisabled; - - if (!GTK_WIDGET_VISIBLE (menu_item)) - attributes |= kMenuItemAttrHidden; - - InsertMenuItemTextWithCFString (carbon_menu, cfstr, - carbon_index - 1, - attributes, 0); - SetMenuItemProperty (carbon_menu, carbon_index, - IGE_QUARTZ_MENU_CREATOR, - IGE_QUARTZ_ITEM_WIDGET, - sizeof (menu_item), &menu_item); - - if (cfstr) - CFRelease (cfstr); - - carbon_item = carbon_menu_item_connect (menu_item, label, - carbon_menu, - carbon_index); - - if (GTK_IS_CHECK_MENU_ITEM (menu_item)) - carbon_menu_item_update_active (carbon_item, menu_item); - - carbon_menu_item_update_accel_closure (carbon_item, menu_item); - - if (gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item))) - carbon_menu_item_update_submenu (carbon_item, menu_item); - } - - carbon_index++; - } - - g_list_free (children); -} - - -static gulong emission_hook_id = 0; - -static gboolean -parent_set_emission_hook (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data) -{ - GtkWidget *instance = g_value_get_object (param_values); - - if (GTK_IS_MENU_ITEM (instance)) - { - GtkWidget *previous_parent = g_value_get_object (param_values + 1); - GtkWidget *menu_shell = NULL; - - if (GTK_IS_MENU_SHELL (previous_parent)) - { - menu_shell = previous_parent; - } - else if (GTK_IS_MENU_SHELL (instance->parent)) - { - menu_shell = instance->parent; - } - - if (menu_shell) - { - CarbonMenu *carbon_menu = carbon_menu_get (menu_shell); - - if (carbon_menu) - { -#if 0 - g_printerr ("%s: item %s %p (%s, %s)\n", G_STRFUNC, - previous_parent ? "removed from" : "added to", - menu_shell, - get_menu_label_text (instance, NULL), - g_type_name (G_TYPE_FROM_INSTANCE (instance))); -#endif - - sync_menu_shell (GTK_MENU_SHELL (menu_shell), - carbon_menu->menu, - carbon_menu->menu == (MenuRef) data, - FALSE); - } - } - } - - return TRUE; -} - -static void -parent_set_emission_hook_remove (GtkWidget *widget, - gpointer data) -{ - g_signal_remove_emission_hook (g_signal_lookup ("parent-set", - GTK_TYPE_WIDGET), - emission_hook_id); -} - - -/* - * public functions - */ - -void -ige_mac_menu_set_menu_bar (GtkMenuShell *menu_shell) -{ - MenuRef carbon_menubar; - - g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell)); - - if (carbon_menu_quark == 0) - carbon_menu_quark = g_quark_from_static_string ("CarbonMenu"); - - if (carbon_menu_item_quark == 0) - carbon_menu_item_quark = g_quark_from_static_string ("CarbonMenuItem"); - - CreateNewMenu (0 /*id*/, 0 /*options*/, &carbon_menubar); - SetRootMenu (carbon_menubar); - - setup_menu_event_handler (); - - emission_hook_id = - g_signal_add_emission_hook (g_signal_lookup ("parent-set", - GTK_TYPE_WIDGET), - 0, - parent_set_emission_hook, - carbon_menubar, NULL); - - g_signal_connect (menu_shell, "destroy", - G_CALLBACK (parent_set_emission_hook_remove), - NULL); - - sync_menu_shell (menu_shell, carbon_menubar, TRUE, FALSE); -} - -void -ige_mac_menu_set_quit_menu_item (GtkMenuItem *menu_item) -{ - MenuRef appmenu; - MenuItemIndex index; - - g_return_if_fail (GTK_IS_MENU_ITEM (menu_item)); - - if (GetIndMenuItemWithCommandID (NULL, kHICommandQuit, 1, - &appmenu, &index) == noErr) - { - SetMenuItemCommandID (appmenu, index, 0); - SetMenuItemProperty (appmenu, index, - IGE_QUARTZ_MENU_CREATOR, - IGE_QUARTZ_ITEM_WIDGET, - sizeof (menu_item), &menu_item); - - gtk_widget_hide (GTK_WIDGET (menu_item)); - } -} - - -struct _IgeMacMenuGroup -{ - GList *items; -}; - -static GList *app_menu_groups = NULL; - -IgeMacMenuGroup * -ige_mac_menu_add_app_menu_group (void) -{ - IgeMacMenuGroup *group = g_slice_new0 (IgeMacMenuGroup); - - app_menu_groups = g_list_append (app_menu_groups, group); - - return group; -} - -void -ige_mac_menu_add_app_menu_item (IgeMacMenuGroup *group, - GtkMenuItem *menu_item, - const gchar *label) -{ - MenuRef appmenu; - GList *list; - gint index = 0; - - g_return_if_fail (group != NULL); - g_return_if_fail (GTK_IS_MENU_ITEM (menu_item)); - - if (GetIndMenuItemWithCommandID (NULL, kHICommandHide, 1, - &appmenu, NULL) != noErr) - { - g_warning ("%s: retrieving app menu failed", - G_STRFUNC); - return; - } - - for (list = app_menu_groups; list; list = g_list_next (list)) - { - IgeMacMenuGroup *list_group = list->data; - - index += g_list_length (list_group->items); - - /* adjust index for the separator between groups, but not - * before the first group - */ - if (list_group->items && list->prev) - index++; - - if (group == list_group) - { - CFStringRef cfstr; - - /* add a separator before adding the first item, but not - * for the first group - */ - if (!group->items && list->prev) - { - InsertMenuItemTextWithCFString (appmenu, NULL, index, - kMenuItemAttrSeparator, 0); - index++; - } - - if (!label) - label = get_menu_label_text (GTK_WIDGET (menu_item), NULL); - - cfstr = CFStringCreateWithCString (NULL, label, - kCFStringEncodingUTF8); - - InsertMenuItemTextWithCFString (appmenu, cfstr, index, 0, 0); - SetMenuItemProperty (appmenu, index + 1, - IGE_QUARTZ_MENU_CREATOR, - IGE_QUARTZ_ITEM_WIDGET, - sizeof (menu_item), &menu_item); - - CFRelease (cfstr); - - gtk_widget_hide (GTK_WIDGET (menu_item)); - - group->items = g_list_append (group->items, menu_item); - - return; - } - } - - if (!list) - g_warning ("%s: app menu group %p does not exist", - G_STRFUNC, group); -} diff --git a/gtk2_ardour/sync-menu.h b/gtk2_ardour/sync-menu.h deleted file mode 100644 index 2be5e71d02..0000000000 --- a/gtk2_ardour/sync-menu.h +++ /dev/null @@ -1,44 +0,0 @@ -/* GTK+ Integration for the Mac OS X Menubar. - * - * Copyright (C) 2007 Pioneer Research Center USA, Inc. - * Copyright (C) 2007 Imendio AB - * - * For further information, see: - * http://developer.imendio.com/projects/gtk-macosx/menubar - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; version 2.1 - * of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __IGE_MAC_MENU_H__ -#define __IGE_MAC_MENU_H__ - -#include - -G_BEGIN_DECLS - -typedef struct _IgeMacMenuGroup IgeMacMenuGroup; - -void ige_mac_menu_set_menu_bar (GtkMenuShell *menu_shell); -void ige_mac_menu_set_quit_menu_item (GtkMenuItem *menu_item); - -IgeMacMenuGroup * ige_mac_menu_add_app_menu_group (void); -void ige_mac_menu_add_app_menu_item (IgeMacMenuGroup *group, - GtkMenuItem *menu_item, - const gchar *label); - -G_END_DECLS - -#endif /* __IGE_MAC_MENU_H__ */ diff --git a/gtk2_ardour/tape_region_view.cc b/gtk2_ardour/tape_region_view.cc index 2cb06af63d..9791d0a7aa 100644 --- a/gtk2_ardour/tape_region_view.cc +++ b/gtk2_ardour/tape_region_view.cc @@ -62,7 +62,11 @@ TapeAudioRegionView::TapeAudioRegionView (ArdourCanvas::Group *parent, RouteTime void TapeAudioRegionView::init (Gdk::Color& basic_color, bool wfw) { - AudioRegionView::init(basic_color, wfw); + /* never wait for data: always just create the waves, connect once and then + we'll update whenever we need to. + */ + + AudioRegionView::init(basic_color, false); /* every time the wave data changes and peaks are ready, redraw */ diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index f64ee3f4e9..cb335882e2 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -77,7 +77,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie height_style(Small), y_position(0), order(0), - controls_table (2, 7) + controls_table (2, 8) { if (need_size_info) { compute_controls_size_info (); @@ -136,7 +136,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie controls_table.set_col_spacings (0); controls_table.set_homogeneous (true); - controls_table.attach (name_hbox, 0, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 3, 0); + controls_table.attach (name_hbox, 0, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 3, 0); controls_table.show_all (); controls_table.set_no_show_all (); @@ -156,6 +156,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie //controls_frame.add (controls_hbox); //controls_frame.set_name ("TimeAxisViewControlsBaseUnselected"); + //controls_vbox.set_name ("TimeAxisViewControlsBaseUnselected"); //controls_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT); ColorsChanged.connect (mem_fun (*this, &TimeAxisView::color_handler)); @@ -364,6 +365,16 @@ TimeAxisView::step_height (bool bigger) } } +void +TimeAxisView::set_heights (TrackHeight h) +{ + TrackSelection& ts (editor.get_selection().tracks); + + for (TrackSelection::iterator i = ts.begin(); i != ts.end(); ++i) { + (*i)->set_height (h); + } +} + void TimeAxisView::set_height (TrackHeight h) { @@ -568,7 +579,7 @@ TimeAxisView::set_selected (bool yn) if (_selected) { controls_ebox.set_name (controls_base_selected_name); controls_hbox.set_name (controls_base_selected_name); - + controls_vbox.set_name (controls_base_selected_name); /* propagate any existing selection, if the mode is right */ if (editor.current_mouse_mode() == Editing::MouseRange && !editor.get_selection().time.empty()) { @@ -578,7 +589,7 @@ TimeAxisView::set_selected (bool yn) } else { controls_ebox.set_name (controls_base_unselected_name); controls_hbox.set_name (controls_base_unselected_name); - + controls_vbox.set_name (controls_base_unselected_name); hide_selection (); /* children will be set for the yn=true case. but when deselecting @@ -601,12 +612,12 @@ TimeAxisView::build_size_menu () size_menu->set_name ("ArdourContextMenu"); MenuList& items = size_menu->items(); - items.push_back (MenuElem (_("Largest"), bind (mem_fun (*this, &TimeAxisView::set_height), Largest))); - items.push_back (MenuElem (_("Large"), bind (mem_fun (*this, &TimeAxisView::set_height), Large))); - items.push_back (MenuElem (_("Larger"), bind (mem_fun (*this, &TimeAxisView::set_height), Larger))); - items.push_back (MenuElem (_("Normal"), bind (mem_fun (*this, &TimeAxisView::set_height), Normal))); - items.push_back (MenuElem (_("Smaller"), bind (mem_fun (*this, &TimeAxisView::set_height),Smaller))); - items.push_back (MenuElem (_("Small"), bind (mem_fun (*this, &TimeAxisView::set_height), Small))); + items.push_back (MenuElem (_("Largest"), bind (mem_fun (*this, &TimeAxisView::set_heights), Largest))); + items.push_back (MenuElem (_("Large"), bind (mem_fun (*this, &TimeAxisView::set_heights), Large))); + items.push_back (MenuElem (_("Larger"), bind (mem_fun (*this, &TimeAxisView::set_heights), Larger))); + items.push_back (MenuElem (_("Normal"), bind (mem_fun (*this, &TimeAxisView::set_heights), Normal))); + items.push_back (MenuElem (_("Smaller"), bind (mem_fun (*this, &TimeAxisView::set_heights),Smaller))); + items.push_back (MenuElem (_("Small"), bind (mem_fun (*this, &TimeAxisView::set_heights), Small))); } void diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 048c60dce6..ee03585992 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -321,6 +321,7 @@ class TimeAxisView : public virtual AxisView static void compute_controls_size_info (); static bool need_size_info; + void set_heights (TrackHeight); void set_height_pixels (uint32_t h); void color_handler (); list temp_lines; diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 3a61a8676a..5b67022ee0 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -463,41 +463,50 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) it does allow. */ + int fakekey = GDK_VoidSymbol; int ret = false; switch (ev->keyval) { case GDK_Tab: - ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_nabla, GdkModifierType(ev->state)); - break; - - // some X and/or GDK implementations do Shift-Tab -> GDK_ISO_Left_Tab - case GDK_ISO_Left_Tab: - ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_nabla, GdkModifierType(ev->state)); + fakekey = GDK_nabla; break; case GDK_Up: - ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_uparrow, GdkModifierType(ev->state)); + fakekey = GDK_uparrow; break; case GDK_Down: - ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_downarrow, GdkModifierType(ev->state)); + fakekey = GDK_downarrow; break; case GDK_Right: - ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_rightarrow, GdkModifierType(ev->state)); + fakekey = GDK_rightarrow; break; case GDK_Left: - ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_leftarrow, GdkModifierType(ev->state)); + fakekey = GDK_leftarrow; break; default: break; } - if (ret) { - return true; + if (fakekey != GDK_VoidSymbol) { + ret = gtk_accel_groups_activate(G_OBJECT(win), fakekey, GdkModifierType(ev->state)); + + if (ret) { + return true; + } + +#ifdef GTKOSX + int oldval = ev->keyval; + ev->keyval = fakekey; + if (gdk_quartz_possibly_forward ((GdkEvent*) ev)) { + return true; + } + ev->keyval = oldval; +#endif } } diff --git a/gtk2_ardour/vst_pluginui.cc b/gtk2_ardour/vst_pluginui.cc index 5072c42a8e..aba100a97c 100644 --- a/gtk2_ardour/vst_pluginui.cc +++ b/gtk2_ardour/vst_pluginui.cc @@ -38,7 +38,7 @@ VSTPluginUI::VSTPluginUI (boost::shared_ptr pi, boost::shared_ptr< preset_box.pack_end (bypass_button, false, false, 10); preset_box.pack_end (save_button, false, false); - preset_box.pack_end (combo, false, false); + preset_box.pack_end (preset_combo, false, false); bypass_button.set_active (!insert->active());