merge 3.0 from 2.0-ongoing@3243

git-svn-id: svn://localhost/ardour2/branches/3.0@3248 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-04-11 14:06:50 +00:00
parent 9aa8af5a28
commit cb41314642
100 changed files with 17534 additions and 4036 deletions

View file

@ -20,3 +20,8 @@ Brazilian Portuguese: Alexander da Franca Fernandes <alexander@nautae.eti.br>
Russian: Igor Blinov <pitstop@nm.ru>
Spanish: Alex Krohn <alexkrohn@fastmail.fm>
Swedish: Petter Sundlöf <petter.sundlof@gmail.com>
Polish: Piotr Zaryk <pzaryk@gmail.com>

View file

@ -1,5 +1,9 @@
# -*- python -*-
#
# and there we have it, or do we?
#
import os
import sys
import re
@ -34,11 +38,13 @@ opts.AddOptions(
BoolOption('NATIVE_OSX_KEYS', 'Build key bindings file that matches OS X conventions', 0),
BoolOption('OLDFONTS', 'Old school font sizes', 0),
BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0),
BoolOption('STL_DEBUG', 'Set to build with Standard Template Library Debugging', 0),
PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'),
EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'tiger', 'panther', 'leopard', 'none' ), ignorecase=2),
BoolOption('DMALLOC', 'Compile and link using the dmalloc library', 0),
BoolOption('EXTRA_WARN', 'Compile with -Wextra, -ansi, and -pedantic. Might break compilation. For pedants', 0),
BoolOption('FFT_ANALYSIS', 'Include FFT analysis window', 1),
BoolOption('FREESOUND', 'Include Freesound database lookup', 0),
BoolOption('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1),
BoolOption('LIBLO', 'Compile with support for liblo library', 1),
BoolOption('NLS', 'Set to turn on i18n support', 1),
@ -48,7 +54,7 @@ opts.AddOptions(
BoolOption('UNIVERSAL', 'Compile as universal binary. Requires that external libraries are already universal.', 0),
BoolOption('VERSIONED', 'Add revision information to ardour/gtk executable name inside the build directory', 0),
BoolOption('VST', 'Compile with support for VST', 0),
BoolOption('LV2', 'Compile with support for LV2 (if slv2 is available)', 1),
BoolOption('LV2', 'Compile with support for LV2 (if slv2 is available)', 0),
BoolOption('GPROFILE', 'Compile with support for gprofile (Developers only)', 0),
BoolOption('FREEDESKTOP', 'Install MIME type, icons and .desktop file as per the freedesktop.org spec (requires xdg-utils and shared-mime-info). "scons uninstall" removes associations in desktop database', 0),
BoolOption('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 1)
@ -531,6 +537,24 @@ if env['FFT_ANALYSIS']:
sys.exit (1)
conf.Finish()
if env['FREESOUND']:
#
# Check for curl header as well as the library
#
libraries['curl'] = LibraryInfo()
conf = Configure(libraries['curl'])
if conf.CheckHeader ('curl/curl.h') == False:
print ('Ardour cannot be compiled without the curl headers, which do not seem to be installed')
sys.exit (1)
else:
libraries['curl'].ParseConfig('pkg-config --cflags --libs libcurl')
conf.Finish()
else:
print 'FREESOUND support is not enabled. Build with \'scons FREESOUND=1\' to enable.'
if env['LV2']:
conf = env.Configure(custom_tests = { 'CheckPKGExists' : CheckPKGExists })
@ -766,10 +790,14 @@ else:
env.Append(CCFLAGS=" ".join (opt_flags))
env.Append(LINKFLAGS=" ".join (opt_flags))
if env['STL_DEBUG'] == 1:
env.Append(CXXFLAGS="-D_GLIBCXX_DEBUG")
if env['UNIVERSAL'] == 1:
env.Append(CCFLAGS="-arch i386 -arch ppc")
env.Append(LINKFLAGS="-arch i386 -arch ppc")
#
# warnings flags
#

View file

@ -0,0 +1,346 @@
; ardour GtkAccelMap rc-file -*- scheme -*-
; this file is an automated accelerator map dump
;
; (gtk_accel_path "<Actions>/RegionList/RegionListSort" "")
(gtk_accel_path "<Actions>/Common/Quit" "<%PRIMARY%>q")
(gtk_accel_path "<Actions>/Common/Save" "<%PRIMARY%>s")
; (gtk_accel_path "<Actions>/Editor/Pullup" "")
; (gtk_accel_path "<Actions>/Editor/zoom-to-session" "")
; (gtk_accel_path "<Actions>/JACK/JACKReconnect" "")
; (gtk_accel_path "<Actions>/Editor/Autoconnect" "")
; (gtk_accel_path "<Actions>/Editor/Edit" "")
(gtk_accel_path "<Actions>/Editor/cycle-edit-point" "grave")
(gtk_accel_path "<Actions>/Editor/cycle-edit-point-with-marker" "<%SECONDARY%>grave")
(gtk_accel_path "<Actions>/Editor/toggle-edit-mode" "1")
(gtk_accel_path "<Actions>/Editor/cycle-snap-mode" "2")
(gtk_accel_path "<Actions>/Editor/cycle-snap-choice" "3")
; (gtk_accel_path "<Actions>/redirectmenu/copy" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFaster" "")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>space")
(gtk_accel_path "<Actions>/Transport/record-roll" "<%TERTIARY%>space")
(gtk_accel_path "<Actions>/Transport/Record" "<%TERTIARY%>r")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionLength" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffSlowest" "")
; (gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-sync" "")
; (gtk_accel_path "<Actions>/redirectmenu/deactivate_all" "")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionPosition" "")
; (gtk_accel_path "<Actions>/Editor/ZoomFocus" "")
(gtk_accel_path "<Actions>/Editor/addExistingAudioFiles" "<%SECONDARY%>i")
; (gtk_accel_path "<Actions>/options/MeterFalloffSlow" "")
; (gtk_accel_path "<Actions>/RegionList/rlHide" "")
; (gtk_accel_path "<Actions>/Main/Metering" "")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "rightarrow")
(gtk_accel_path "<Actions>/Editor/selected-marker-to-next-region-boundary" "<%PRIMARY%><%TERTIARY%>rightarrow")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-playhead" "")
; (gtk_accel_path "<Actions>/Editor/center-edit-cursor" "")
; (gtk_accel_path "<Actions>/Editor/Monitoring" "")
; (gtk_accel_path "<Actions>/redirectmenu/deactivate" "")
; (gtk_accel_path "<Actions>/options/LatchedRecordEnable" "")
; (gtk_accel_path "<Actions>/Transport/TogglePunchIn" "")
; (gtk_accel_path "<Actions>/ShuttleActions/SetShuttleUnitsPercentage" "")
; (gtk_accel_path "<Actions>/Main/Close" "")
; (gtk_accel_path "<Actions>/Main/New" "")
(gtk_accel_path "<Actions>/Editor/nudge-next-backward" "<%PRIMARY%>KP_Subtract")
; (gtk_accel_path "<Actions>/Editor/EditSelectRangeOptions" "")
; (gtk_accel_path "<Actions>/Transport/ToggleTimeMaster" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-thirds" "")
(gtk_accel_path "<Actions>/Editor/align-regions-start-relative" "<%TERTIARY%>a")
; (gtk_accel_path "<Actions>/Main/Export" "")
(gtk_accel_path "<Actions>/Editor/jump-forward-to-mark" "<%PRIMARY%>KP_Right")
; (gtk_accel_path "<Actions>/Editor/Smpte30" "")
; (gtk_accel_path "<Actions>/Editor/playhead-to-range-start" "")
; (gtk_accel_path "<Actions>/Editor/Subframes" "")
; (gtk_accel_path "<Actions>/Editor/Smpte2997drop" "")
(gtk_accel_path "<Actions>/Main/AddTrackBus" "<%PRIMARY%><%SECONDARY%>n")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<%LEVEL4%>a")
; (gtk_accel_path "<Actions>/JACK/JACKDisconnect" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFast" "")
; (gtk_accel_path "<Actions>/options/FileDataFormatFloat" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-region-end" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-sync" "semicolon")
; (gtk_accel_path "<Actions>/options/StopRecordingOnXrun" "")
; (gtk_accel_path "<Actions>/RegionList/SortDescending" "")
; (gtk_accel_path "<Actions>/options/DoNotRunPluginsWhileRecording" "")
; (gtk_accel_path "<Actions>/Editor/PullupNone" "")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-range" "r")
(gtk_accel_path "<Actions>/Editor/jump-backward-to-mark" "<%PRIMARY%>KP_Left")
; (gtk_accel_path "<Actions>/Main/AudioFileFormatData" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFastest" "")
(gtk_accel_path "<Actions>/Editor/play-selected-regions" "w")
(gtk_accel_path "<Actions>/Editor/play-edit-range" "<%SECONDARY%>w")
(gtk_accel_path "<Actions>/Transport/Forward" "<%PRIMARY%>rightarrow")
; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-seconds" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-frame" "")
; (gtk_accel_path "<Actions>/Main/ExportSelection" "")
; (gtk_accel_path "<Actions>/options/StopPluginsWithTransport" "")
(gtk_accel_path "<Actions>/Editor/editor-paste" "<%PRIMARY%>v")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down")
(gtk_accel_path "<Actions>/Editor/select-next-route" "downarrow")
(gtk_accel_path "<Actions>/Editor/select-prev-route" "uparrow")
; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-minutes" "")
; (gtk_accel_path "<Actions>/Main/FlushWastebasket" "")
(gtk_accel_path "<Actions>/Editor/normalize-region" "n")
(gtk_accel_path "<Actions>/Editor/nudge-forward" "h")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionEndinFile" "")
; (gtk_accel_path "<Actions>/Editor/ToggleMeasureVisibility" "")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-center" "")
(gtk_accel_path "<Actions>/Editor/nudge-backward" "g")
; (gtk_accel_path "<Actions>/options/LatchedSolo" "")
; (gtk_accel_path "<Actions>/options/MeterHoldOff" "")
; (gtk_accel_path "<Actions>/options/OutputAutoConnectMaster" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency64" "")
(gtk_accel_path "<Actions>/Editor/undo" "<%PRIMARY%>z")
(gtk_accel_path "<Actions>/Editor/insert-region" "i")
; (gtk_accel_path "<Actions>/Editor/center-playhead" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-region-start" "")
; (gtk_accel_path "<Actions>/Editor/View" "")
; (gtk_accel_path "<Actions>/Editor/Layering" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency4096" "")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-up" "Page_Up")
(gtk_accel_path "<Actions>/Editor/set-edit-point" "g")
; (gtk_accel_path "<Actions>/Editor/Smpte30drop" "")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-edit" "")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow")
(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow")
; (gtk_accel_path "<Actions>/Editor/EditCursorMovementOptions" "")
; (gtk_accel_path "<Actions>/redirectmenu/activate_all" "")
; (gtk_accel_path "<Actions>/redirectmenu/paste" "")
; (gtk_accel_path "<Actions>/Editor/Smpte25" "")
; (gtk_accel_path "<Actions>/options/RegionEquivalentsOverlap" "")
; (gtk_accel_path "<Actions>/Main/MeteringFallOffRate" "")
; (gtk_accel_path "<Actions>/options/UseHardwareMonitoring" "")
; (gtk_accel_path "<Actions>/Editor/Smpte24" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-mark" "")
; (gtk_accel_path "<Actions>/Editor/CrossfadesShort" "")
; (gtk_accel_path "<Actions>/Editor/Smpte5994" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency8192" "")
; (gtk_accel_path "<Actions>/Editor/toggle-xfades-visible" "")
(gtk_accel_path "<Actions>/Editor/extend-range-to-end-of-region" "rightanglebracket")
(gtk_accel_path "<Actions>/Editor/start-range" "F1")
; (gtk_accel_path "<Actions>/ShuttleActions/SetShuttleUnitsSemitones" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency128" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-beat" "")
; (gtk_accel_path "<Actions>/Editor/RegionEditOps" "")
; (gtk_accel_path "<Actions>/Editor/snap-magnetic" "")
; (gtk_accel_path "<Actions>/Editor/playhead-to-range-end" "")
(gtk_accel_path "<Actions>/Editor/scroll-playhead-forward" "<%TERTIARY%>rightarrow")
(gtk_accel_path "<Actions>/Editor/align-regions-sync-relative" "<%SECONDARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-sync" "less")
; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
(gtk_accel_path "<Actions>/Editor/crop" "c")
; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceSubMenu" "")
; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "")
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
(gtk_accel_path "<Actions>/Transport/GotoStart" "Home")
(gtk_accel_path "<Actions>/Editor/select-all-before-edit-cursor" "<%TERTIARY%>Home")
(gtk_accel_path "<Actions>/Editor/scroll-playhead-backward" "<%TERTIARY%>leftarrow")
(gtk_accel_path "<Actions>/Editor/split-region" "z")
; (gtk_accel_path "<Actions>/Transport/ToggleAutoInput" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-thirtyseconds" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-minutes" "")
; (gtk_accel_path "<Actions>/Main/Windows" "")
; (gtk_accel_path "<Actions>/Main/CleanupUnused" "")
; (gtk_accel_path "<Actions>/redirectmenu/deselectall" "")
; (gtk_accel_path "<Actions>/options/SoloViaBus" "")
; (gtk_accel_path "<Actions>/RegionList/rlAudition" "")
(gtk_accel_path "<Actions>/Editor/set-region-sync-position" "u")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4Plus1" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-region-boundary" "")
; (gtk_accel_path "<Actions>/JACK/JACK" "")
(gtk_accel_path "<Actions>/Editor/editor-cut" "<%PRIMARY%>x")
(gtk_accel_path "<Actions>/Editor/editor-separate" "F4")
; (gtk_accel_path "<Actions>/RegionList/SortAscending" "")
; (gtk_accel_path "<Actions>/Main/Help" "")
; (gtk_accel_path "<Actions>/options/UseExternalMonitoring" "")
; (gtk_accel_path "<Actions>/Editor/Smpte23976" "")
(gtk_accel_path "<Actions>/Common/goto-editor" "<%WINDOW%>e")
(gtk_accel_path "<Actions>/Editor/select-all" "F14")
(gtk_accel_path "<Actions>/Editor/invert-selection" "F15")
(gtk_accel_path "<Actions>/Editor/nudge-next-forward" "<%PRIMARY%>KP_Add")
; (gtk_accel_path "<Actions>/options/ShowSoloMutes" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-eighths" "")
(gtk_accel_path "<Actions>/Editor/select-all-after-playhead" "<%TERTIARY%><%PRIMARY%>p")
(gtk_accel_path "<Actions>/Common/ToggleMaximalEditor" "F11")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileLength" "")
; (gtk_accel_path "<Actions>/Editor/Timecode" "")
; (gtk_accel_path "<Actions>/Transport/PlaySelection" "")
; (gtk_accel_path "<Actions>/Editor/PullupMinus4Minus1" "")
(gtk_accel_path "<Actions>/Editor/select-all-after-edit-cursor" "<%TERTIARY%><%PRIMARY%>e")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileName" "")
(gtk_accel_path "<Actions>/Editor/finish-range" "F2")
(gtk_accel_path "<Actions>/Editor/select-range-between-cursors" "F16")
(gtk_accel_path "<Actions>/Transport/Loop" "l")
; (gtk_accel_path "<Actions>/Editor/CrossfadesFull" "")
(gtk_accel_path "<Actions>/Editor/finish-add-range" "<%TERTIARY%><%PRIMARY%>KP_Up")
; (gtk_accel_path "<Actions>/options/SendMTC" "")
; (gtk_accel_path "<Actions>/Transport/TogglePunchOut" "")
(gtk_accel_path "<Actions>/Editor/select-all-in-loop-range" "<%PRIMARY%>l")
(gtk_accel_path "<Actions>/Editor/show-editor-mixer" "<%TERTIARY%>e")
; (gtk_accel_path "<Actions>/options/SoloInPlace" "")
; (gtk_accel_path "<Actions>/Main/Options" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffMedium" "")
(gtk_accel_path "<Actions>/Editor/toggle-follow-playhead" "f")
; (gtk_accel_path "<Actions>/Main/SaveTemplate" "")
(gtk_accel_path "<Actions>/Transport/TransitionToRoll" "<%PRIMARY%>uparrow")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionStartinFile" "")
; (gtk_accel_path "<Actions>/options/GainReduceFastTransport" "")
; (gtk_accel_path "<Actions>/Common/ToggleInspector" "")
; (gtk_accel_path "<Actions>/Transport/ToggleAutoPlay" "")
; (gtk_accel_path "<Actions>/Editor/playhead-to-next-region-sync" "")
(gtk_accel_path "<Actions>/Editor/edit-to-playhead" "<%SECONDARY%>Return")
; (gtk_accel_path "<Actions>/Editor/LayerMoveAddHigher" "")
; (gtk_accel_path "<Actions>/Editor/Smpte60" "")
; (gtk_accel_path "<Actions>/Main/Open" "")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-left" "")
; (gtk_accel_path "<Actions>/Main/TransportOptions" "")
; (gtk_accel_path "<Actions>/Main/ControlSurfaces" "")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatBWF" "")
; (gtk_accel_path "<Actions>/Transport/ToggleAutoReturn" "")
; (gtk_accel_path "<Actions>/Editor/Smpte2997" "")
; (gtk_accel_path "<Actions>/Editor/ToggleWaveformVisibility" "")
(gtk_accel_path "<Actions>/Editor/redo" "<%PRIMARY%>r")
; (gtk_accel_path "<Actions>/Main/ExportSession" "")
; (gtk_accel_path "<Actions>/options/InputAutoConnectPhysical" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-edit-cursor" "")
(gtk_accel_path "<Actions>/Editor/temporal-zoom-in" "t")
; (gtk_accel_path "<Actions>/JACK/Latency" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-end" "<%TERTIARY%>F2")
; (gtk_accel_path "<Actions>/redirectmenu/rename" "")
; (gtk_accel_path "<Actions>/RegionList/rlShowAuto" "")
(gtk_accel_path "<Actions>/Editor/select-all-before-playhead" "<%PRIMARY%>p")
; (gtk_accel_path "<Actions>/Main/Session" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-start" "<%TERTIARY%>F1")
; (gtk_accel_path "<Actions>/Main/AudioFileFormat" "")
; (gtk_accel_path "<Actions>/Transport/Transport" "")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-timefx" "t")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionName" "")
; (gtk_accel_path "<Actions>/Main/KeyMouse Actions" "")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g")
; (gtk_accel_path "<Actions>/Snap/snap-to-frame" "")
; (gtk_accel_path "<Actions>/Editor/SnapTo" "")
(gtk_accel_path "<Actions>/Transport/TransitionToReverse" "<%PRIMARY%>downarrow")
; (gtk_accel_path "<Actions>/Editor/Crossfades" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4" "")
; (gtk_accel_path "<Actions>/Main/MeteringHoldTime" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus1" "")
; (gtk_accel_path "<Actions>/Editor/Smpte24976" "")
; (gtk_accel_path "<Actions>/options/FileDataFormat24bit" "")
; (gtk_accel_path "<Actions>/Editor/SnapMode" "")
(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%WINDOW%>o")
; (gtk_accel_path "<Actions>/Editor/PullupMinus4" "")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<%WINDOW%>m")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileCreationDate" "")
; (gtk_accel_path "<Actions>/redirectmenu/activate" "")
(gtk_accel_path "<Actions>/Editor/extend-range-to-start-of-region" "leftanglebracket")
; (gtk_accel_path "<Actions>/Editor/PullupMinus1" "")
; (gtk_accel_path "<Actions>/Editor/snap-normal" "")
(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<%WINDOW%>b")
(gtk_accel_path "<Actions>/Common/ToggleKeyEditor" "<%WINDOW%>k")
; (gtk_accel_path "<Actions>/Snap/snap-to-asixteenthbeat" "")
(gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<%PRIMARY%>d")
; (gtk_accel_path "<Actions>/redirectmenu/edit" "")
(gtk_accel_path "<Actions>/Editor/duplicate-region" "d")
(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%SECONDARY%>d")
; (gtk_accel_path "<Actions>/JACK/JACKLatency2048" "")
; (gtk_accel_path "<Actions>/Editor/ToggleWaveformsWhileRecording" "")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-right" "")
(gtk_accel_path "<Actions>/Editor/remove-last-capture" "<%PRIMARY%>Delete")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatWAVE" "")
(gtk_accel_path "<Actions>/Transport/GotoZero" "KP_0")
(gtk_accel_path "<Actions>/Editor/select-all-after-edit-cursor" "<%TERTIARY%>End")
; (gtk_accel_path "<Actions>/redirectmenu/cut" "")
; (gtk_accel_path "<Actions>/redirectmenu/newinsert" "")
; (gtk_accel_path "<Actions>/options/UseMMC" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffOff" "")
;(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-object" "o")
; (gtk_accel_path "<Actions>/Editor/PullupMinus4Plus1" "")
; (gtk_accel_path "<Actions>/Editor/MeterHold" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-cd-frame" "")
; (gtk_accel_path "<Actions>/options/StopTransportAtEndOfSession" "")
; (gtk_accel_path "<Actions>/Main/Cleanup" "")
; (gtk_accel_path "<Actions>/Main/Snapshot" "")
; (gtk_accel_path "<Actions>/Transport/ToggleVideoSync" "")
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFilesystem" "")
(gtk_accel_path "<Actions>/Common/ToggleColorManager" "<%WINDOW%>c")
; (gtk_accel_path "<Actions>/Common/About" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency32" "")
(gtk_accel_path "<Actions>/Editor/playhead-to-edit" "Return")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatWAVE64" "")
(gtk_accel_path "<Actions>/Editor/brush-at-mouse" "F3")
; (gtk_accel_path "<Actions>/RegionList/rlShowAll" "")
(gtk_accel_path "<Actions>/Transport/Rewind" "<%PRIMARY%>leftarrow")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionTimestamp" "")
; (gtk_accel_path "<Actions>/options/VerifyRemoveLastCapture" "")
; (gtk_accel_path "<Actions>/options/OutputAutoConnectPhysical" "")
; (gtk_accel_path "<Actions>/options/SendMMC" "")
; (gtk_accel_path "<Actions>/Editor/toggle-auto-xfades" "")
; (gtk_accel_path "<Actions>/Main/AudioFileFormatHeader" "")
; (gtk_accel_path "<Actions>/options/MeterHoldShort" "")
; (gtk_accel_path "<Actions>/options/MeterHoldMedium" "")
(gtk_accel_path "<Actions>/Editor/select-all-before-edit-cursor" "<%PRIMARY%>e")
; (gtk_accel_path "<Actions>/Editor/Subframes80" "")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatCAF" "")
(gtk_accel_path "<Actions>/Common/ToggleLocations" "<%WINDOW%>l")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurface" "")
(gtk_accel_path "<Actions>/Editor/editor-delete" "BackSpace")
; (gtk_accel_path "<Actions>/JACK/JACKLatency256" "")
(gtk_accel_path "<Actions>/Editor/select-all-between-cursors" "F16")
; (gtk_accel_path "<Actions>/Editor/LayerAddHigher" "")
; (gtk_accel_path "<Actions>/Editor/Solo" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency1024" "")
; (gtk_accel_path "<Actions>/Main/ExportRangeMarkers" "")
(gtk_accel_path "<Actions>/Editor/set-playhead" "p")
; (gtk_accel_path "<Actions>/Editor/toggle-xfades-active" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-bar" "")
; (gtk_accel_path "<Actions>/Editor/LayerLaterHigher" "")
; (gtk_accel_path "<Actions>/redirectmenu/selectall" "")
(gtk_accel_path "<Actions>/Editor/editor-copy" "<%PRIMARY%>c")
; (gtk_accel_path "<Actions>/Snap/snap-to-quarters" "")
(gtk_accel_path "<Actions>/Editor/temporal-zoom-out" "r")
; (gtk_accel_path "<Actions>/options/UseSoftwareMonitoring" "")
; (gtk_accel_path "<Actions>/Editor/Subframes100" "")
(gtk_accel_path "<Actions>/Editor/mute-unmute-region" "<%SECONDARY%>m")
(gtk_accel_path "<Actions>/Editor/add-location-from-playhead" "m")
; (gtk_accel_path "<Actions>/options/OutputAutoConnectManual" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-region-sync" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "apostrophe")
; (gtk_accel_path "<Actions>/redirectmenu/clear" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceFeedback" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4Minus1" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency512" "")
; (gtk_accel_path "<Actions>/Main/Recent" "")
; (gtk_accel_path "<Actions>/redirectmenu/newplugin" "")
; (gtk_accel_path "<Actions>/options/InputAutoConnectManual" "")
; (gtk_accel_path "<Actions>/options/MeterHoldLong" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-seconds" "")
(gtk_accel_path "<Actions>/Editor/set-fade-in-length" "q")
(gtk_accel_path "<Actions>/Editor/toggle-fade-in-active" "<%SECONDARY%>q")
(gtk_accel_path "<Actions>/Editor/set-fade-out-length" "e")
(gtk_accel_path "<Actions>/Editor/toggle-fade-out-active" "<%SECONDARY%>e")
(gtk_accel_path "<Actions>/Editor/trim-from-start" "<%TERTIARY%>braceleft")
(gtk_accel_path "<Actions>/Editor/trim-to-end" "<%TERTIARY%>braceright")
(gtk_accel_path "<Actions>/Editor/trim-front" "a")
(gtk_accel_path "<Actions>/Editor/trim-back" "s")
(gtk_accel_path "<Actions>/Editor/goto-mark-1" "KP_1")
(gtk_accel_path "<Actions>/Editor/goto-mark-2" "KP_2")
(gtk_accel_path "<Actions>/Editor/goto-mark-3" "KP_3")
(gtk_accel_path "<Actions>/Editor/goto-mark-4" "KP_4")
(gtk_accel_path "<Actions>/Editor/goto-mark-5" "KP_5")
(gtk_accel_path "<Actions>/Editor/goto-mark-6" "KP_6")
(gtk_accel_path "<Actions>/Editor/goto-mark-7" "KP_7")
(gtk_accel_path "<Actions>/Editor/goto-mark-8" "KP_8")
(gtk_accel_path "<Actions>/Editor/goto-mark-9" "KP_9")
(gtk_accel_path "<Actions>/Transport/ToggleClick" "5")
(gtk_accel_path "<Actions>/Transport/ToggleAutoReturn" "4")
(gtk_accel_path "<Actions>/Transport/focus-on-clock" "KP_Divide")
(gtk_accel_path "<Actions>/Editor/set-loop-from-edit-range" "bracketright")
(gtk_accel_path "<Actions>/Editor/set-punch-from-edit-range" "bracketleft")
(gtk_accel_path "<Actions>/Editor/set-loop-from-region" "<%PRIMARY%><%SECONDARY%>bracketright")
(gtk_accel_path "<Actions>/Editor/loop-region" "<%PRIMARY%>bracketright")
(gtk_accel_path "<Actions>/Editor/toggle-zoom" "o")
(gtk_accel_path "<Actions>/Editor/zoom-to-region" "y")
(gtk_accel_path "<Actions>/Editor/pitch-shift-region" "F5")
(gtk_accel_path "<Actions>/Editor/play-from-edit-point-and-return" "<%LEVEL4%>space")

View file

@ -81,6 +81,10 @@ if gtkardour['FFT_ANALYSIS']:
gtkardour.Merge ([libraries['fftw3f']])
gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
if gtkardour['FREESOUND']:
gtkardour.Merge ([libraries['curl']])
gtkardour.Append(CCFLAGS='-DFREESOUND')
if gtkardour['RUBBERBAND']:
gtkardour.Merge ([ libraries['rubberband'] ])
else:
@ -238,6 +242,10 @@ fft_graph.cc
fft_result.cc
""")
freesound_files=Split("""
sfdb_freesound_mootcher.cc
""")
pixmap_files = glob.glob('pixmaps/*.xpm')
icon_files = glob.glob ('icons/*.png')
@ -298,6 +306,9 @@ else:
if env['FFT_ANALYSIS']:
extra_sources += fft_analysis_files
if env['FREESOUND']:
extra_sources += freesound_files
intl_files += extra_sources
gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
@ -485,7 +496,10 @@ if env['FREEDESKTOP']:
env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '48x48', 'apps', 'ardour2.png'), 'icons/ardour_icon_48px.png'))
# Install the mime type xml file and its icon #
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'mime', 'packages'), 'ardour2.xml'))
env.Alias('install', env.Install(os.path.join(desktop_icon_install_prefix, '48x48', 'mimetypes'), 'icons/application-x-ardour2.png'))
env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '16x16', 'mimetypes', 'application-x-ardour2.png'), 'icons/application-x-ardour_16px.png'))
env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '22x22', 'mimetypes', 'application-x-ardour2.png'), 'icons/application-x-ardour_22px.png'))
env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '32x32', 'mimetypes', 'application-x-ardour2.png'), 'icons/application-x-ardour_32px.png'))
env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '48x48', 'mimetypes', 'application-x-ardour2.png'), 'icons/application-x-ardour_48px.png'))
env.Alias('install', env.Command (os.path.join(install_prefix, 'share', 'mime'), [], 'update-mime-database $TARGET'))
# Update the icon cache #
env.Alias('install', env.Command (desktop_icon_install_prefix, [], 'touch --no-create $TARGET'))
@ -502,6 +516,9 @@ if env['FREEDESKTOP']:
Delete (desktop_icon_install_prefix + '/22x22/apps/ardour2.png'),
Delete (desktop_icon_install_prefix + '/32x32/apps/ardour2.png'),
Delete (desktop_icon_install_prefix + '/48x48/apps/ardour2.png'),
Delete (desktop_icon_install_prefix + '/16x16/mimetypes/application-x-ardour2.png'),
Delete (desktop_icon_install_prefix + '/22x22/mimetypes/application-x-ardour2.png'),
Delete (desktop_icon_install_prefix + '/32x32/mimetypes/application-x-ardour2.png'),
Delete (desktop_icon_install_prefix + '/48x48/mimetypes/application-x-ardour2.png'),
Action ('update-mime-database ' + install_prefix + '/share/mime'),
Action ('gtk-update-icon-cache ' + desktop_icon_install_prefix),
@ -517,9 +534,10 @@ env.Alias ('tarball', env.Distribute (env['DISTTREE'],
'ardev', 'ardbg',
'ardour3_ui_dark.rc.in', 'ardour3_ui_light.rc.in', 'splash.png',
'ardour.menus', 'ardour-sae.menus',
'ardour.bindings.in',
'ardour-sae-ansi.bindings.in',
'ardour-sae-de.bindings.in',
'mnemonic-us.bindings.in',
'ergonomic-us.bindings.in',
'SAE-us.bindings.in',
'SAE-de.bindings.in',
'ardour3_ui_default.conf',
'editor_xpms',
'ardour2.xml',
@ -534,6 +552,7 @@ env.Alias ('tarball', env.Distribute (env['DISTTREE'],
gtkosx_files +
x11_files +
fft_analysis_files +
freesound_files +
glob.glob('po/*.po') + glob.glob('*.h')))
# generate a prototype full-featured ardour_ui.rc file

View file

@ -172,6 +172,8 @@ static const char* translators[] = {
N_("Spanish:\n\t Alex Krohn <alexkrohn@fastmail.fm>\n"),
N_("Russian:\n\t Igor Blinov <pitstop@nm.ru>\n"),
N_("Greek:\n\t Klearchos Gourgourinis <muadib@in.gr>\n"),
N_("Swedish:\n\t Petter Sundlöf <petter.sundlof@gmail.com>\n"),
N_("Polish:\n\t Piotr Zaryk <pzaryk@gmail.com>\n"),
0
};

View file

@ -53,6 +53,7 @@ vector<RefPtr<Gtk::Action> > ActionManager::point_selection_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::time_selection_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::line_selection_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::playlist_selection_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::mouse_edit_point_requires_canvas_actions;
vector<RefPtr<Gtk::Action> > ActionManager::range_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::jack_sensitive_actions;

View file

@ -51,6 +51,7 @@ class ActionManager
static std::vector<Glib::RefPtr<Gtk::Action> > time_selection_sensitive_actions;
static std::vector<Glib::RefPtr<Gtk::Action> > line_selection_sensitive_actions;
static std::vector<Glib::RefPtr<Gtk::Action> > playlist_selection_sensitive_actions;
static std::vector<Glib::RefPtr<Gtk::Action> > mouse_edit_point_requires_canvas_actions;
static std::vector<Glib::RefPtr<Gtk::Action> > range_sensitive_actions;
static std::vector<Glib::RefPtr<Gtk::Action> > transport_sensitive_actions;

View file

@ -56,7 +56,6 @@
<menuitem action='TransitionToRoll'/>
<menuitem action='TransitionToReverse'/>
<separator/>
<menuitem action='set-playhead'/>
@ -115,9 +114,6 @@
<menuitem action='ToggleAutoPlay'/>
<menuitem action='ToggleAutoReturn'/>
<menuitem action='ToggleClick'/>
<separator/>
<menu action='LocateToMarker'>
</menu>
</menu>
<menu action='Edit'>

View file

@ -28,181 +28,228 @@
<separator/>
<menuitem action='Quit'/>
</menu>
<menu name='Transport' action='Transport'>
<menuitem action='ToggleRoll'/>
<menuitem action='play-from-edit-point-and-return'/>
<menuitem action='play-edit-range'/>
<menu action="PlayMenu">
<menuitem action='play-selected-regions'/>
<menuitem action='play-edit-range'/>
<menuitem action='play-from-edit-point-and-return'/>
<menuitem action='Loop'/>
</menu>
<menuitem action='record-roll'/>
<menuitem action='Record'/>
<menuitem action='ToggleRollForgetCapture'/>
<menuitem action='Loop'/>
<menuitem action='loop-region'/>
<menuitem action='PlaySelection'/>
<menuitem action='play-edit-range'/>
<menu action="SetLoopMenu">
<menuitem action='set-loop-from-edit-range'/>
<menuitem action='set-loop-from-region'/>
</menu>
<menu action="SetPunchMenu">
<menuitem action='set-punch-from-edit-range'/>
<menuitem action='set-punch-from-region'/>
</menu>
<separator/>
<menuitem action='Forward'/>
<menuitem action='Rewind'/>
<menuitem action='GotoZero'/>
<menuitem action='GotoStart'/>
<menuitem action='GotoEnd'/>
<separator/>
<menuitem action='tab-to-transient-forwards'/>
<menuitem action='tab-to-transient-backwards'/>
<menuitem action='nudge-playhead-forward'/>
<menuitem action='nudge-playhead-backward'/>
<separator/>
<menuitem action='Record'/>
<separator/>
<menuitem action='TransitionToRoll'/>
<menuitem action='TransitionToReverse'/>
<separator/>
<menuitem action='jump-forward-to-mark'/>
<menuitem action='jump-backward-to-mark'/>
<menuitem action='add-location-from-playhead'/>
<separator/>
<menuitem action='playhead-to-next-region-boundary'/>
<menuitem action='playhead-to-previous-region-boundary'/>
<menuitem action='playhead-to-next-region-sync'/>
<menuitem action='playhead-to-previous-region-sync'/>
<menuitem action='center-playhead'/>
<menuitem action='playhead-to-edit'/>
<separator/>
<menuitem action='playhead-to-range-start'/>
<menuitem action='playhead-to-range-end'/>
<menuitem action='focus-on-clock'/>
<menu action='LocateToMarker'>
<menuitem action='goto-mark-1'/>
<menuitem action='goto-mark-2'/>
<menuitem action='goto-mark-3'/>
<menuitem action='goto-mark-4'/>
<menuitem action='goto-mark-5'/>
<menuitem action='goto-mark-6'/>
<menuitem action='goto-mark-7'/>
<menuitem action='goto-mark-8'/>
<menuitem action='goto-mark-9'/>
<separator/>
<menu action="MovePlayHeadMenu">
<menuitem action='set-playhead'/>
<menuitem action='playhead-to-edit'/>
<menuitem action='center-playhead'/>
<separator/>
<menuitem action='nudge-playhead-forward'/>
<menuitem action='nudge-playhead-backward'/>
<separator/>
<menuitem action='tab-to-transient-forwards'/>
<menuitem action='tab-to-transient-backwards'/>
<separator/>
<menuitem action='playhead-forward-to-grid'/>
<menuitem action='playhead-backward-to-grid'/>
<separator/>
<menuitem action='playhead-to-next-region-boundary'/>
<menuitem action='playhead-to-previous-region-boundary'/>
<menuitem action='playhead-to-next-region-sync'/>
<menuitem action='playhead-to-previous-region-sync'/>
<separator/>
<menuitem action='jump-forward-to-mark'/>
<menuitem action='jump-backward-to-mark'/>
<separator/>
<menuitem action='GotoZero'/>
<menuitem action='GotoStart'/>
<menuitem action='GotoEnd'/>
</menu>
<menu action='TransportOptions'>
<menuitem action='ToggleTimeMaster'/>
<menuitem action='TogglePunchIn'/>
<menuitem action='TogglePunchOut'/>
<menuitem action='ToggleAutoInput'/>
<menuitem action='ToggleAutoPlay'/>
<menuitem action='ToggleAutoReturn'/>
<menuitem action='ToggleClick'/>
<menuitem action='toggle-follow-playhead'/>
<menuitem action='ToggleVideoSync'/>
</menu>
<menuitem action='set-loop-from-edit-range'/>
<menuitem action='set-loop-from-region'/>
<menuitem action='set-punch-from-edit-range'/>
<menuitem action='set-punch-from-region'/>
<menu action="MoveActiveMarkMenu">
<menuitem action='selected-marker-to-next-region-boundary'/>
<menuitem action='selected-marker-to-previous-region-boundary'/>
<menuitem action='edit-cursor-to-next-region-sync'/>
<menuitem action='edit-cursor-to-previous-region-sync'/>
<separator/>
<menuitem action='edit-to-playhead'/>
<menuitem action='set-edit-point'/>
</menu>
<menu action="MarkerMenu">
<menuitem action='add-location-from-playhead'/>
<separator/>
<menuitem action='goto-mark-1'/>
<menuitem action='goto-mark-2'/>
<menuitem action='goto-mark-3'/>
<menuitem action='goto-mark-4'/>
<menuitem action='goto-mark-5'/>
<menuitem action='goto-mark-6'/>
<menuitem action='goto-mark-7'/>
<menuitem action='goto-mark-8'/>
<menuitem action='goto-mark-9'/>
</menu>
<separator/>
<menuitem action='ToggleTimeMaster'/>
<menuitem action='TogglePunch'/>
<menuitem action='TogglePunchIn'/>
<menuitem action='TogglePunchOut'/>
<menuitem action='ToggleAutoInput'/>
<menuitem action='ToggleAutoPlay'/>
<menuitem action='ToggleAutoReturn'/>
<menuitem action='ToggleClick'/>
<menuitem action='toggle-follow-playhead'/>
<separator/>
</menu>
<menu name='Edit' action='Edit'>
<menuitem action='undo'/>
<menuitem action='redo'/>
<menuitem action='editor-cut'/>
<menuitem action='editor-delete'/>
<menuitem action='editor-copy'/>
<menuitem action='editor-paste'/>
<separator/>
<menuitem action='editor-separate'/>
<menuitem action='editor-crop'/>
<menuitem action='split-region'/>
<separator/>
<menuitem action='remove-last-capture'/>
<separator/>
<menu action='EditCursorMovementOptions'>
<menuitem action='edit-cursor-to-next-region-start'/>
<menuitem action='edit-cursor-to-next-region-end'/>
<menuitem action='edit-cursor-to-previous-region-start'/>
<menuitem action='edit-cursor-to-previous-region-end'/>
<menuitem action='edit-cursor-to-next-region-sync'/>
<menuitem action='edit-cursor-to-previous-region-sync'/>
<menuitem action='center-edit-cursor'/>
<menuitem action='edit-to-playhead'/>
<menuitem action='edit-cursor-to-range-start'/>
<menuitem action='edit-cursor-to-range-end'/>
</menu>
<menuitem action='set-tempo-from-region'/>
<menuitem action='set-tempo-from-edit-range'/>
<menu action='KeyMouseActions'>
<menuitem action='play-selected-regions'/>
<menuitem action='brush-at-mouse'/>
<menuitem action='set-edit-point'/>
<menuitem action='mute-unmute-region'/>
<menuitem action='set-playhead'/>
<menuitem action='set-region-sync-position'/>
<separator/>
<menuitem action='set-mouse-mode-object'/>
<menuitem action='set-mouse-mode-range'/>
<menuitem action='set-mouse-mode-gain'/>
<menuitem action='set-mouse-mode-zoom'/>
<menuitem action='set-mouse-mode-timefx'/>
<menuitem action='set-mouse-mode-note'/>
<separator/>
<menuitem action='cycle-edit-point'/>
<menuitem action='cycle-edit-point-with-marker'/>
<menuitem action='toggle-edit-mode'/>
<separator/>
<menuitem action='boost-region-gain'/>
<menuitem action='cut-region-gain'/>
</menu>
</menu>
<menu name='Select' action='Select'>
<menu action="SelectMenu">
<menuitem action='select-all'/>
<menuitem action='deselect-all'/>
<menuitem action='invert-selection'/>
<menuitem action='select-all-after-edit-cursor'/>
<menuitem action='select-all-before-edit-cursor'/>
<menuitem action='select-all-between-cursors'/>
<menuitem action='select-all-within-cursors'/>
<menuitem action='select-all-in-punch-range'/>
<menuitem action='select-all-in-loop-range'/>
<separator/>
<menuitem action='select-range-between-cursors'/>
<menuitem action='extend-range-to-start-of-region'/>
<menuitem action='extend-range-to-end-of-region'/>
<menuitem action='start-range'/>
<menuitem action='finish-range'/>
<menuitem action='finish-add-range'/>
<separator/>
<menuitem action='select-all'/>
<menuitem action='deselect-all'/>
<menuitem action='invert-selection'/>
<menuitem action='select-all-after-edit-cursor'/>
<menuitem action='select-all-before-edit-cursor'/>
<menuitem action='select-all-after-playhead'/>
<menuitem action='select-all-before-playhead'/>
<menuitem action='select-all-between-cursors'/>
<menuitem action='select-all-within-cursors'/>
<menuitem action='select-all-in-punch-range'/>
<menuitem action='select-all-in-loop-range'/>
<separator/>
<menuitem action='select-next-route'/>
<menuitem action='select-prev-route'/>
</menu>
<menu action='RegionMenu'>
<menuitem action='split-region-at-transients'/>
<menuitem action='crop'/>
<menuitem action='duplicate-region'/>
<menuitem action='multi-duplicate-region'/>
<menuitem action='insert-region'/>
<menuitem action='normalize-region'/>
<separator/>
<menuitem action="nudge-forward"/>
<menuitem action="nudge-backward"/>
<menuitem action='split-region'/>
<menuitem action='set-region-sync-position'/>
<separator/>
</menu>
<separator/>
<menuitem action='editor-delete'/>
<menuitem action='editor-crop'/>
<menuitem action='split-region'/>
<menu action="SeparateMenu">
<menuitem action='editor-separate'/>
<menuitem action='separate-from-loop'/>
<menuitem action='separate-from-punch'/>
<separator/>
<menuitem action='split-region-at-transients'/>
</menu>
<menu action="AlignMenu">
<menuitem action='align-regions-start'/>
<menuitem action='align-regions-start-relative'/>
<menuitem action='align-regions-end'/>
<menuitem action='align-regions-end-relative'/>
<menuitem action='align-regions-sync'/>
<menuitem action='align-regions-sync-relative'/>
<separator/>
<menuitem action='set-fade-in-length'/>
<menuitem action='set-fade-out-length'/>
<menuitem action='toggle-fade-in-active'/>
<menuitem action='toggle-fade-out-active'/>
<separator/>
<menuitem action='trim-back'/>
</menu>
<menu action="NudgeRegionMenu">
<menuitem action="nudge-forward"/>
<menuitem action="nudge-backward"/>
</menu>
<menu action="TrimMenu">
<menuitem action='trim-front'/>
<menuitem action='trim-from-start'/>
<menuitem action='trim-to-end'/>
<menuitem action='trim-back'/>
<menuitem action='crop'/>
<menuitem action='trim-region-to-loop'/>
<menuitem action='trim-region-to-punch'/>
</menu>
<menu action="FadeMenu">
<menuitem action='set-fade-in-length'/>
<menuitem action='toggle-fade-in-active'/>
<menuitem action='set-fade-out-length'/>
<menuitem action='toggle-fade-out-active'/>
</menu>
<separator/>
<menuitem action='remove-last-capture'/>
<separator/>
<menu action='KeyMouseActions'>
<menuitem action='select-next-route'/>
<menuitem action='select-prev-route'/>
<menuitem action='brush-at-mouse'/>
<separator/>
<menuitem action='pitch-shift-region'/>
<menuitem action='set-mouse-mode-object'/>
<menuitem action='set-mouse-mode-range'/>
<menuitem action='set-mouse-mode-gain'/>
<menuitem action='set-mouse-mode-zoom'/>
<menuitem action='set-mouse-mode-timefx'/>
<separator/>
<menuitem action='cycle-edit-point'/>
<menuitem action='cycle-edit-point-with-marker'/>
<menuitem action='toggle-edit-mode'/>
<separator/>
<menuitem action='boost-region-gain'/>
<menuitem action='cut-region-gain'/>
<separator/>
<menuitem action='break-drag'/>
</menu>
</menu>
<menu action='RegionMenu'>
<menuitem action='insert-region'/>
<menuitem action='rename-region'/>
<menuitem action='raise-region'/>
<menuitem action='lower-region'/>
<menuitem action='naturalize-region'/>
<menuitem action='lock-region'/>
<menuitem action='set-region-sync-position'/>
<menuitem action='remove-region-sync'/>
<menuitem action='mute-unmute-region'/>
<separator/>
<menuitem action='reverse-region'/>
<menuitem action='monoize-region'/>
<menuitem action='normalize-region'/>
<menuitem action='boost-region-gain'/>
<menuitem action='cut-region-gain'/>
<menuitem action='pitch-shift-region'/>
<separator/>
<menuitem action='duplicate-region'/>
<menuitem action='multi-duplicate-region'/>
<menuitem action='region-fill-track'/>
</menu>
<menu action='TrackMenu'>
<menuitem action='AddTrackBus'/>
<menuitem action='insert-time'/>
<menu action='TrackHeightMenu'>
<menuitem action='track-height-largest'/>
<menuitem action='track-height-large'/>
<menuitem action='track-height-larger'/>
<menuitem action='track-height-normal'/>
<menuitem action='track-height-smaller'/>
<menuitem action='track-height-small'/>
</menu>
<menu action='WaveformMenu'>
<menuitem action='toggle-waveform-visible'/>
<menuitem action='linear-waveforms'/>
<menuitem action='logarithmic-waveforms'/>
</menu>
<menuitem action='toggle-track-active'/>
<menuitem action='remove-track'/>
</menu>
<menu name='View' action = 'View'>
<menu name='ZoomFocus' action='ZoomFocus'>
<menuitem action='zoom-focus-left'/>
@ -255,34 +302,50 @@
<menuitem action='MeterHoldMedium'/>
<menuitem action='MeterHoldLong'/>
</menu>
<menu action="PrimaryClockMenu">
<menuitem action="primary-clock-bbt"/>
<menuitem action="primary-clock-minsec"/>
<menuitem action="primary-clock-samples"/>
<menuitem action="primary-clock-off"/>
</menu>
<menu action="SecondaryClockMenu">
<menuitem action="secondary-clock-bbt"/>
<menuitem action="secondary-clock-minsec"/>
<menuitem action="secondary-clock-samples"/>
<menuitem action="secondary-clock-off"/>
</menu>
<menu action="RulerMenu">
<menuitem action="toggle-minsec-ruler"/>
<menuitem action="toggle-samples-ruler"/>
<menuitem action="toggle-bbt-ruler"/>
<separator/>
<menuitem action="toggle-meter-ruler"/>
<menuitem action="toggle-tempo-ruler"/>
<menuitem action="toggle-loop-punch-ruler"/>
<menuitem action="toggle-cd-marker-ruler"/>
<menuitem action="toggle-marker-ruler"/>
</menu>
<menu action="ZoomMenu">
<menuitem action='temporal-zoom-in'/>
<menuitem action='temporal-zoom-out'/>
<menuitem action='zoom-to-session'/>
<menuitem action='zoom-to-region'/>
<menuitem action='toggle-zoom'/>
</menu>
<menu action="ScrollMenu">
<menuitem action='scroll-tracks-down'/>
<menuitem action='scroll-tracks-up'/>
<menuitem action='scroll-forward'/>
<menuitem action='scroll-backward'/>
</menu>
<separator/>
<menuitem action='temporal-zoom-in'/>
<menuitem action='temporal-zoom-out'/>
<menuitem action='zoom-to-session'/>
<menuitem action='zoom-to-region'/>
<menuitem action='toggle-zoom'/>
<menuitem action='scroll-tracks-down'/>
<menuitem action='scroll-tracks-up'/>
<menuitem action='scroll-tracks-down'/>
<menuitem action='step-tracks-up'/>
<menuitem action='step-tracks-down'/>
<separator/>
<menuitem action='scroll-forward'/>
<menuitem action='scroll-backward'/>
<separator/>
<menuitem action='scroll-playhead-forward'/>
<menuitem action='scroll-playhead-backward'/>
<separator/>
<menuitem action='ToggleMaximalEditor'/>
<menuitem action='show-editor-mixer'/>
<menuitem action='ToggleMeasureVisibility'/>
<menuitem action='toggle-waveform-visible'/>
<menuitem action='ToggleWaveformsWhileRecording'/>
<menuitem action='ToggleMeasureVisibility'/>
<separator/>
<menuitem action='show-editor-mixer'/>
<menuitem action='show-editor-list'/>
<menuitem action='SyncEditorAndMixerTrackOrder'/>
</menu>
</menu>
<menu name='JACK' action='JACK'>
<menuitem action='JACKDisconnect'/>
<menuitem action='JACKReconnect'/>
@ -309,7 +372,6 @@
<menuitem action='ToggleKeyEditor'/>
<menuitem action='ToggleThemeManager'/>
<menuitem action='ToggleBigClock'/>
<menuitem action='ToggleBundleManager'/>
<menuitem action='toggle-rhythm-ferret'/>
<separator/>
</menu>
@ -327,6 +389,15 @@
<menuitem action='FileHeaderFormatCAF'/>
</menu>
</menu>
<menu action='SyncMenu'>
<menuitem action='SendMTC'/>
<menuitem action='SendMMC'/>
<menuitem action='UseMMC'/>
</menu>
<menu action="TempoMenu">
<menuitem action='set-tempo-from-region'/>
<menuitem action='set-tempo-from-edit-range'/>
</menu>
<menu action='Timecode'>
<menuitem action='Smpte23976'/>
<menuitem action='Smpte24'/>
@ -367,11 +438,13 @@
<menuitem action='RemoteUserDefined'/>
<menuitem action='RemoteMixerDefined'/>
<menuitem action='RemoteEditorDefined'/>
<separator/>
<menuitem action='AutoRebinding'/>
</menu>
<menu action='Monitoring'>
<menuitem action='UseHardwareMonitoring'/>
<menuitem action='UseSoftwareMonitoring'/>
<menuitem action='UseExternalMonitoring'/>
<menuitem action='UseSoftwareMonitoring'/>
<menuitem action='UseHardwareMonitoring'/>
<separator/>
<menuitem action='ToggleTapeMachineMode'/>
</menu>
@ -420,32 +493,27 @@
<menuitem action='DenormalFTZDAZ'/>
</menu>
<separator/>
<menuitem action='SendMTC'/>
<menuitem action='SendMMC'/>
<menuitem action='UseMMC'/>
<separator/>
<menuitem action='UseOSC'/>
<menuitem action='StopPluginsWithTransport'/>
<menuitem action='DoNotRunPluginsWhileRecording'/>
<menuitem action='LatchedRecordEnable'/>
<menuitem action='RegionEquivalentsOverlap'/>
<separator/>
<menuitem action='PeriodicSafetyBackups'/>
<menuitem action='VerifyRemoveLastCapture'/>
<menuitem action='StopRecordingOnXrun'/>
<menuitem action='CreateXrunMarker'/>
<menuitem action='StopTransportAtEndOfSession'/>
<menuitem action='GainReduceFastTransport'/>
<menuitem action='PrimaryClockDeltaEditCursor'/>
<menuitem action='SecondaryClockDeltaEditCursor'/>
<menuitem action='ShowTrackMeters'/>
<menuitem action='OnlyCopyImportedFiles'/>
<menuitem action='ShowTrackMeters'/>
<menuitem action='DefaultNarrowMS'/>
<menuitem action='link-region-and-track-selection'/>
<menuitem action='RubberbandingSnapsToGrid'/>
<separator/>
<menu action='MiscOptions'>
<menuitem action='UseOSC'/>
<menuitem action='StopPluginsWithTransport'/>
<menuitem action='DoNotRunPluginsWhileRecording'/>
<menuitem action='LatchedRecordEnable'/>
<menuitem action='RegionEquivalentsOverlap'/>
<menuitem action='PeriodicSafetyBackups'/>
<menuitem action='VerifyRemoveLastCapture'/>
<menuitem action='StopRecordingOnXrun'/>
<menuitem action='CreateXrunMarker'/>
<menuitem action='StopTransportAtEndOfSession'/>
<menuitem action='GainReduceFastTransport'/>
<menuitem action='PrimaryClockDeltaEditCursor'/>
<menuitem action='SecondaryClockDeltaEditCursor'/>
<menuitem action='OnlyCopyImportedFiles'/>
<menuitem action='ShowTrackMeters'/>
<menuitem action='DefaultNarrowMS'/>
<menuitem action='link-region-and-track-selection'/>
<menuitem action='RubberbandingSnapsToGrid'/>
<menuitem action='AutoAnalyseAudio'/>
</menu>
</menu>
<menu name='Help' action='Help'>
<menuitem action='About'/>
@ -467,7 +535,7 @@
<menuitem action="toggle-loop-punch-ruler"/>
</popup>
<popup name='processormenu'>
<popup name='redirectmenu'>
<menuitem action='newplugin'/>
<menuitem action='newinsert'/>
<menuitem action='newsend'/>

View file

@ -226,6 +226,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
ARDOUR::Diskstream::DiskOverrun.connect (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
ARDOUR::Diskstream::DiskUnderrun.connect (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
/* handle dialog requests */
ARDOUR::Session::Dialog.connect (mem_fun(*this, &ARDOUR_UI::session_dialog));
/* handle pending state with a dialog */
ARDOUR::Session::AskAboutPendingState.connect (mem_fun(*this, &ARDOUR_UI::pending_state_dialog));
@ -1452,6 +1456,7 @@ ARDOUR_UI::remove_last_capture()
void
ARDOUR_UI::transport_record (bool roll)
{
if (session) {
switch (session->record_status()) {
case Session::Disabled:
@ -1477,6 +1482,7 @@ ARDOUR_UI::transport_record (bool roll)
session->disable_record (false, true);
}
}
//cerr << "ARDOUR_UI::transport_record () called roll = " << roll << " session->record_status() = " << session->record_status() << endl;
}
void
@ -1490,6 +1496,8 @@ ARDOUR_UI::transport_roll ()
rolling = session->transport_rolling ();
//cerr << "ARDOUR_UI::transport_roll () called session->record_status() = " << session->record_status() << endl;
if (session->get_play_loop()) {
session->request_play_loop (false);
auto_loop_button.set_visual_state (1);
@ -3083,6 +3091,24 @@ ARDOUR_UI::disk_speed_dialog_gone (int ignored_response, MessageDialog* msg)
delete msg;
}
void
ARDOUR_UI::session_dialog (std::string msg)
{
ENSURE_GUI_THREAD (bind (mem_fun(*this, &ARDOUR_UI::session_dialog), msg));
MessageDialog* d;
if (editor) {
d = new MessageDialog (*editor, msg, false, MESSAGE_INFO, BUTTONS_OK, true);
} else {
d = new MessageDialog (msg, false, MESSAGE_INFO, BUTTONS_OK, true);
}
d->show_all ();
d->run ();
delete d;
}
int
ARDOUR_UI::pending_state_dialog ()
{

View file

@ -686,6 +686,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void disk_overrun_handler ();
void disk_underrun_handler ();
void session_dialog (std::string);
int pending_state_dialog ();
int sr_mismatch_dialog (nframes_t, nframes_t);
@ -741,6 +742,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void toggle_only_copy_imported_files ();
void toggle_use_narrow_ms();
void toggle_rubberbanding_snaps_to_grid ();
void toggle_auto_analyse_audio ();
void toggle_TapeMachineMode();
void mtc_port_changed ();

View file

@ -37,6 +37,7 @@
#include "engine_dialog.h"
#include "editor.h"
#include "actions.h"
#include "mixer_ui.h"
#ifdef GTKOSX
#include <gtkmm2ext/sync-menu.h>
@ -93,8 +94,8 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (main_actions, X_("Help"), _("Help"));
ActionManager::register_action (main_actions, X_("KeyMouseActions"), _("Misc. Shortcuts"));
ActionManager::register_action (main_actions, X_("AudioFileFormat"), _("Audio File Format"));
ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("Header"));
ActionManager::register_action (main_actions, X_("AudioFileFormatData"), _("Data"));
ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("File Type"));
ActionManager::register_action (main_actions, X_("AudioFileFormatData"), _("Sample Format"));
ActionManager::register_action (main_actions, X_("ControlSurfaces"), _("Control Surfaces"));
ActionManager::register_action (main_actions, X_("Plugins"), _("Plugins"));
ActionManager::register_action (main_actions, X_("Metering"), _("Metering"));
@ -454,6 +455,7 @@ ARDOUR_UI::install_actions ()
ActionManager::register_toggle_action (option_actions, X_("ShowTrackMeters"), _("Enable Editor Meters"), mem_fun (*this, &ARDOUR_UI::toggle_ShowTrackMeters));
ActionManager::register_toggle_action (option_actions, X_("OnlyCopyImportedFiles"), _("Always copy imported files"), mem_fun (*this, &ARDOUR_UI::toggle_only_copy_imported_files));
ActionManager::register_toggle_action (option_actions, X_("RubberbandingSnapsToGrid"), _("Rubberbanding Snaps to Grid"), mem_fun (*this, &ARDOUR_UI::toggle_rubberbanding_snaps_to_grid));
ActionManager::register_toggle_action (option_actions, X_("AutoAnalyseAudio"), _("Auto-analyse new audio"), mem_fun (*this, &ARDOUR_UI::toggle_auto_analyse_audio));
ActionManager::register_toggle_action (option_actions, X_("DefaultNarrowMS"), _("Use narrow mixer strips"), mem_fun (*this, &ARDOUR_UI::toggle_use_narrow_ms));
@ -538,15 +540,24 @@ ARDOUR_UI::install_actions ()
RadioAction::Group file_data_group;
act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormatFloat"), X_("32-bit floating point"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatFloat));
act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormat24bit"), X_("24-bit signed integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt24));
act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormat16bit"), X_("16-bit signed integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt16));
act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormat24bit"), X_("24-bit integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt24));
act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormat16bit"), X_("16-bit integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt16));
RadioAction::Group monitoring_group;
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseHardwareMonitoring"), _("Hardware monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), HardwareMonitoring));
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseSoftwareMonitoring"), _("Software monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), SoftwareMonitoring));
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseExternalMonitoring"), _("External monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), ExternalMonitoring));
/* it would be nice not to even show this item, but that messes up the
menus which are not dynamically modified at runtime. so we make it
sensitive only if it makes sense.
*/
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseHardwareMonitoring"), _("JACK does monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), HardwareMonitoring));
if (engine->can_request_hardware_monitoring()) {
act->set_sensitive (false);
}
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseSoftwareMonitoring"), _("Ardour does monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), SoftwareMonitoring));
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseExternalMonitoring"), _("Audio Hardware does monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), ExternalMonitoring));
RadioAction::Group solo_group;
@ -580,6 +591,10 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteEditorDefined"), _("Remote ID follows order of Editor"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), EditorOrdered)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("AutoRebinding"), _("Auto Rebind Controls"), mem_fun (*(this->mixer), &Mixer_UI::toggle_auto_rebinding));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::add_action_group (shuttle_actions);
ActionManager::add_action_group (option_actions);
ActionManager::add_action_group (jack_actions);

View file

@ -587,6 +587,12 @@ ARDOUR_UI::toggle_rubberbanding_snaps_to_grid ()
ActionManager::toggle_config_state ("options", "RubberbandingSnapsToGrid", &Configuration::set_rubberbanding_snaps_to_grid, &Configuration::get_rubberbanding_snaps_to_grid);
}
void
ARDOUR_UI::toggle_auto_analyse_audio ()
{
ActionManager::toggle_config_state ("options", "AutoAnalyseAudio", &Configuration::set_auto_analyse_audio, &Configuration::get_auto_analyse_audio);
}
void
ARDOUR_UI::mtc_port_changed ()
{
@ -1061,13 +1067,11 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
} else if (PARAM_IS ("send-mtc")) {
ActionManager::map_some_state ("options", "SendMTC", &Configuration::get_send_mtc);
cerr << "Send MMC = " << Config->get_send_mmc() << endl;
} else if (PARAM_IS ("send-mmc")) {
ActionManager::map_some_state ("options", "SendMMC", &Configuration::get_send_mmc);
cerr << "Send MMC = " << Config->get_send_mmc() << endl;
} else if (PARAM_IS ("use-osc")) {
@ -1083,7 +1087,6 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
} else if (PARAM_IS ("mmc-control")) {
ActionManager::map_some_state ("options", "UseMMC", &Configuration::get_mmc_control);
cerr << "Use MMC = " << Config->get_mmc_control() << endl;
} else if (PARAM_IS ("midi-feedback")) {
ActionManager::map_some_state ("options", "SendMIDIfeedback", &Configuration::get_midi_feedback);

View file

@ -39,9 +39,9 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
bool start_updating(GdkEventAny*);
bool stop_updating(GdkEventAny*);
virtual void activate ();
virtual void deactivate ();
void activate ();
void deactivate ();
void lower_box_realized ();
void on_realize ();
void on_show ();
@ -57,7 +57,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
boost::shared_ptr<ARDOUR::AUPlugin> au;
int prefheight;
int prefwidth;
Gtk::HBox top_box;
Gtk::EventBox low_box;
Gtk::VBox vpacker;
@ -81,6 +81,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
WindowRef carbon_window;
EventHandlerRef carbon_event_handler;
bool _activating_from_app;
NSView* packView;
bool test_cocoa_view_support ();
bool test_carbon_view_support ();

View file

@ -83,6 +83,7 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
cocoa_parent = 0;
cocoa_window = 0;
au_view = 0;
packView = 0;
/* prefer cocoa, fall back to cocoa, but use carbon if its there */
@ -108,6 +109,9 @@ AUPluginUI::~AUPluginUI ()
DisposeWindow (carbon_window);
}
if (packView && packView != au_view) {
[packView release];
}
}
bool
@ -260,6 +264,49 @@ AUPluginUI::create_cocoa_view ()
[(AUGenericView *)au_view setShowsExpertParameters:YES];
}
NSRect packFrame;
// Get the size of the new AU View's frame
packFrame = [au_view frame];
packFrame.origin.x = 0;
packFrame.origin.y = 0;
if (packFrame.size.width > 500 || packFrame.size.height > 500) {
/* its too big - use a scrollview */
NSRect frameRect = [[cocoa_window contentView] frame];
scroll_view = [[[NSScrollView alloc] initWithFrame:frameRect] autorelease];
[scroll_view setDrawsBackground:NO];
[scroll_view setHasHorizontalScroller:YES];
[scroll_view setHasVerticalScroller:YES];
packFrame.size = [NSScrollView frameSizeForContentSize:packFrame.size
hasHorizontalScroller:[scroll_view hasHorizontalScroller]
hasVerticalScroller:[scroll_view hasVerticalScroller]
borderType:[scroll_view borderType]];
// Create a new frame with same origin as current
// frame but size equal to the size of the new view
NSRect newFrame;
newFrame.origin = [scroll_view frame].origin;
newFrame.size = packFrame.size;
// Set the new frame and document views on the scroll view
[scroll_view setFrame:newFrame];
[scroll_view setDocumentView:au_view];
packView = scroll_view;
} else {
packView = au_view;
}
prefwidth = packFrame.size.width;
prefheight = packFrame.size.height;
return 0;
}
@ -353,7 +400,7 @@ AUPluginUI::activate ()
void
AUPluginUI::deactivate ()
{
return;
return;
cerr << "APP DEactivated, for " << insert->name() << endl;
_activating_from_app = true;
ActivateWindow (carbon_window, FALSE);
@ -465,7 +512,6 @@ int
AUPluginUI::parent_cocoa_window ()
{
NSWindow* win = get_nswindow ();
NSView* packView = 0;
NSRect packFrame;
if (!win) {
@ -481,40 +527,6 @@ AUPluginUI::parent_cocoa_window ()
// Get the size of the new AU View's frame
packFrame = [au_view frame];
packFrame.origin.x = 0;
packFrame.origin.y = 0;
if (packFrame.size.width > 500 || packFrame.size.height > 500) {
/* its too big - use a scrollview */
NSRect frameRect = [[cocoa_window contentView] frame];
scroll_view = [[[NSScrollView alloc] initWithFrame:frameRect] autorelease];
[scroll_view setDrawsBackground:NO];
[scroll_view setHasHorizontalScroller:YES];
[scroll_view setHasVerticalScroller:YES];
packFrame.size = [NSScrollView frameSizeForContentSize:packFrame.size
hasHorizontalScroller:[scroll_view hasHorizontalScroller]
hasVerticalScroller:[scroll_view hasVerticalScroller]
borderType:[scroll_view borderType]];
// Create a new frame with same origin as current
// frame but size equal to the size of the new view
NSRect newFrame;
newFrame.origin = [scroll_view frame].origin;
newFrame.size = packFrame.size;
// Set the new frame and document views on the scroll view
[scroll_view setFrame:newFrame];
[scroll_view setDocumentView:au_view];
packView = scroll_view;
} else {
packView = au_view;
}
NSView* view = gdk_quartz_window_get_nsview (low_box.get_window()->gobj());
@ -559,17 +571,6 @@ AUPluginUI::on_hide ()
bool
AUPluginUI::on_map_event (GdkEventAny* ev)
{
cerr << "AU plugin map event\n";
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;
}

View file

@ -83,7 +83,8 @@ AudioClock::AudioClock (std::string clock_name, bool transient, std::string widg
key_entry_state = 0;
ops_menu = 0;
dragging = false;
bbt_reference_time = -1;
if (with_info) {
frames_upper_info_label = manage (new Label);
frames_lower_info_label = manage (new Label);
@ -632,6 +633,15 @@ AudioClock::set_bbt (nframes_t when, bool force)
BBT_Time bbt;
session->tempo_map().bbt_time (when, bbt);
/* handle a common case */
if (is_duration && when == 0) {
bbt.bars = 0;
bbt.beats = 0;
}
sprintf (buf, "%03" PRIu32, bbt.bars);
bars_label.set_text (buf);
sprintf (buf, "%02" PRIu32, bbt.beats);
@ -640,7 +650,16 @@ AudioClock::set_bbt (nframes_t when, bool force)
ticks_label.set_text (buf);
if (bbt_upper_info_label) {
TempoMap::Metric m (session->tempo_map().metric_at (when));
nframes64_t pos;
if (bbt_reference_time < 0) {
pos = when;
} else {
pos = bbt_reference_time;
}
TempoMap::Metric m (session->tempo_map().metric_at (pos));
sprintf (buf, "%-5.2f", m.tempo().beats_per_minute());
if (bbt_lower_info_label->get_text() != buf) {
bbt_lower_info_label->set_text (buf);
@ -1994,3 +2013,9 @@ AudioClock::set_size_requests ()
}
}
void
AudioClock::set_bbt_reference (nframes64_t pos)
{
bbt_reference_time = pos;
}

View file

@ -50,7 +50,8 @@ class AudioClock : public Gtk::HBox
void set (nframes_t, bool force = false, nframes_t offset = 0, char which = 0);
void set_mode (Mode);
void set_bbt_reference (nframes64_t);
void set_widget_name (std::string);
std::string name() const { return _name; }
@ -154,6 +155,7 @@ class AudioClock : public Gtk::HBox
Gtk::EventBox clock_base;
Gtk::Frame clock_frame;
nframes64_t bbt_reference_time;
nframes_t last_when;
bool last_pdelta;
bool last_sdelta;

View file

@ -117,6 +117,28 @@ AudioRegionView::AudioRegionView (const AudioRegionView& other)
init (c, false);
}
AudioRegionView::AudioRegionView (const AudioRegionView& other, boost::shared_ptr<AudioRegion> other_region)
: RegionView (other, boost::shared_ptr<Region> (other_region))
, zero_line(0)
, fade_in_shape(0)
, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
, gain_line(0)
, _amplitude_above_axis(1.0)
, _flags(0)
, fade_color(0)
{
Gdk::Color c;
int r,g,b,a;
UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
c.set_rgb_p (r/255.0, g/255.0, b/255.0);
init (c, true);
}
void
AudioRegionView::init (Gdk::Color& basic_color, bool wfd)
{

View file

@ -55,6 +55,7 @@ class AudioRegionView : public RegionView
Gdk::Color& basic_color);
AudioRegionView (const AudioRegionView& other);
AudioRegionView (const AudioRegionView& other, boost::shared_ptr<ARDOUR::AudioRegion>);
~AudioRegionView ();
@ -134,7 +135,6 @@ class AudioRegionView : public RegionView
double _amplitude_above_axis;
double _y_position;
double _height;
uint32_t _flags;
uint32_t fade_color;

View file

@ -1115,42 +1115,43 @@ CrossfadeEditor::peaks_ready (boost::shared_ptr<AudioRegion> r, WhichFade which)
}
void
CrossfadeEditor::audition_both ()
CrossfadeEditor::audition (Audition which)
{
AudioPlaylist& pl (session.the_auditioner()->prepare_playlist());
nframes_t preroll;
nframes_t postroll;
nframes_t length;
nframes_t left_start_offset;
nframes_t right_length;
nframes_t left_length;
if (preroll_button.get_active()) {
if (which != Right && preroll_button.get_active()) {
preroll = session.frame_rate() * 2; //2 second hardcoded preroll for now
} else {
preroll = 0;
}
if (postroll_button.get_active()) {
if (which != Left && postroll_button.get_active()) {
postroll = session.frame_rate() * 2; //2 second hardcoded postroll for now
} else {
postroll = 0;
}
if ((left_start_offset = xfade->out()->length() - xfade->length()) >= preroll) {
left_start_offset -= preroll;
}
length = 0;
if ((left_length = xfade->length()) < xfade->out()->length() - left_start_offset) {
length += postroll;
}
// Is there enough data for the whole preroll?
left_length = xfade->length();
if ((left_start_offset = xfade->out()->length() - xfade->length()) > preroll) {
left_start_offset -= preroll;
} else {
preroll = left_start_offset;
left_start_offset = 0;
}
left_length += preroll;
// Is there enough data for the whole postroll?
right_length = xfade->length();
if (xfade->in()->length() - right_length < postroll) {
if ((xfade->in()->length() - right_length) > postroll) {
right_length += postroll;
} else {
right_length = xfade->in()->length();
}
boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), left_start_offset, left_length, "xfade out",
@ -1158,16 +1159,33 @@ CrossfadeEditor::audition_both ()
boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, right_length, "xfade in",
0, Region::DefaultFlags, false)));
//apply a 20ms declicking fade at the start and end of auditioning
left->set_fade_in_active(true);
left->set_fade_in_length(session.frame_rate() / 50);
right->set_fade_out_active(true);
right->set_fade_out_length(session.frame_rate() / 50);
pl.add_region (left, 0);
pl.add_region (right, 1+preroll);
pl.add_region (right, 1 + preroll);
if (which == Left) {
right->set_scale_amplitude (0.0);
} else if (which == Right) {
left->set_scale_amplitude (0.0);
}
/* there is only one ... */
pl.foreach_crossfade (this, &CrossfadeEditor::setup);
session.audition_playlist ();
}
void
CrossfadeEditor::audition_both ()
{
audition (Both);
}
void
CrossfadeEditor::audition_left_dry ()
{
@ -1180,25 +1198,7 @@ CrossfadeEditor::audition_left_dry ()
void
CrossfadeEditor::audition_left ()
{
AudioPlaylist& pl (session.the_auditioner()->prepare_playlist());
boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), xfade->out()->length() - xfade->length(), xfade->length(), "xfade left",
0, Region::DefaultFlags, false)));
boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, xfade->length(), "xfade in",
0, Region::DefaultFlags, false)));
pl.add_region (left, 0);
pl.add_region (right, 1);
right->set_muted (true);
/* there is only one ... */
pl.foreach_crossfade (this, &CrossfadeEditor::setup);
session.audition_playlist ();
/* memory leak for regions */
audition (Left);
}
void
@ -1212,23 +1212,7 @@ CrossfadeEditor::audition_right_dry ()
void
CrossfadeEditor::audition_right ()
{
AudioPlaylist& pl (session.the_auditioner()->prepare_playlist());
boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), xfade->out()->length() - xfade->length(), xfade->length(), "xfade out",
0, Region::DefaultFlags, false)));
boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), 0, xfade->length(), "xfade out",
0, Region::DefaultFlags, false)));
pl.add_region (left, 0);
pl.add_region (right, 1);
left->set_muted (true);
/* there is only one ... */
pl.foreach_crossfade (this, &CrossfadeEditor::setup);
session.audition_playlist ();
audition (Right);
}
void

View file

@ -187,13 +187,20 @@ class CrossfadeEditor : public ArdourDialog
void setup (boost::shared_ptr<ARDOUR::Crossfade>);
void cancel_audition ();
void audition_state_changed (bool);
enum Audition {
Both,
Left,
Right
};
void audition_toggled ();
void audition_right_toggled ();
void audition_right_dry_toggled ();
void audition_left_toggled ();
void audition_left_dry_toggled ();
void audition (Audition);
void audition_both ();
void audition_left_dry ();
void audition_left ();

View file

@ -44,6 +44,7 @@ struct DragInfo {
nframes64_t grab_frame;
nframes64_t last_pointer_frame;
nframes64_t current_pointer_frame;
double original_x, original_y;
double grab_x, grab_y;
double cumulative_x_drag;
double cumulative_y_drag;
@ -53,7 +54,8 @@ struct DragInfo {
double last_pointer_y;
void (Editor::*motion_callback)(ArdourCanvas::Item*, GdkEvent*);
void (Editor::*finished_callback)(ArdourCanvas::Item*, GdkEvent*);
TimeAxisView* last_trackview;
TimeAxisView* source_trackview;
TimeAxisView* dest_trackview;
bool x_constrained;
bool y_constrained;
bool copy;

View file

@ -39,6 +39,7 @@
#define EDITPOINT(a) /*empty*/
#define WAVEFORMSCALE(a) /*empty*/
#define WAVEFORMSHAPE(a) /*empty*/
#define INSERTTIMEOPT(a) /*empty*/
namespace Editing {
@ -202,6 +203,18 @@ enum WaveformShape {
#undef WAVEFORMSHAPE
#define WAVEFORMSHAPE(a) /*empty*/
// INSERTTIMEOPT
#undef INSERTTIMEOPT
#define INSERTTIMEOPT(a) a,
enum InsertTimeOption {
#include "editing_syms.h"
};
#undef INSERTTIMEOPT
#define INSERTTIMEOPT(a) /*empty*/
/////////////////////
// These don't need their state saved. yet...
enum CutCopyOp {

View file

@ -109,3 +109,6 @@ WAVEFORMSHAPE(Traditional)
WAVEFORMSHAPE(Rectified)
INSERTTIMEOPT(LeaveIntersected)
INSERTTIMEOPT(MoveIntersected)
INSERTTIMEOPT(SplitIntersected)

View file

@ -281,6 +281,8 @@ Editor::Editor ()
bbt_beat_subdivision = 4;
canvas_width = 0;
canvas_height = 0;
last_autoscroll_x = 0;
last_autoscroll_y = 0;
autoscroll_active = false;
autoscroll_timeout_tag = -1;
interthread_progress_window = 0;
@ -1840,8 +1842,9 @@ Editor::add_region_context_items (StreamView* sv, boost::shared_ptr<Region> regi
items.push_back (MenuElem (_("Bounce"), mem_fun(*this, &Editor::bounce_region_selection)));
#ifdef FFT_ANALYSIS
if (ar)
items.push_back (MenuElem (_("Analyze region"), mem_fun(*this, &Editor::analyze_region_selection)));
if (ar) {
items.push_back (MenuElem (_("Spectral Analysis"), mem_fun(*this, &Editor::analyze_region_selection)));
}
#endif
items.push_back (SeparatorElem());
@ -2020,7 +2023,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
#ifdef FFT_ANALYSIS
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Analyze range"), mem_fun(*this, &Editor::analyze_range_selection)));
items.push_back (MenuElem (_("Spectral Analysis"), mem_fun(*this, &Editor::analyze_range_selection)));
#endif
items.push_back (SeparatorElem());
@ -2305,6 +2308,15 @@ Editor::set_edit_point_preference (EditPoint ep, bool force)
Glib::RefPtr<RadioAction>::cast_dynamic(act)->set_active (true);
}
nframes64_t foo;
bool in_track_canvas;
if (!mouse_frame (foo, in_track_canvas)) {
in_track_canvas = false;
}
reset_canvas_action_sensitivity (in_track_canvas);
instant_save ();
}

View file

@ -1086,6 +1086,9 @@ class Editor : public PublicEditor
void adjust_region_scale_amplitude (bool up);
void quantize_region ();
void do_insert_time ();
void insert_time (nframes64_t pos, nframes64_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue);
void tab_to_transient (bool forward);
void use_region_as_bar ();
@ -1273,6 +1276,7 @@ class Editor : public PublicEditor
int scrubbing_direction;
int scrub_reversals;
int scrub_reverse_distance;
void scrub ();
void keyboard_selection_begin ();
void keyboard_selection_finish (bool add);
@ -1299,6 +1303,8 @@ class Editor : public PublicEditor
void start_grab (GdkEvent*, Gdk::Cursor* cursor = 0);
bool end_grab (ArdourCanvas::Item*, GdkEvent*);
void swap_grab (ArdourCanvas::Item*, Gdk::Cursor* cursor, uint32_t time);
void break_drag ();
void finalize_drag ();
Gtk::Menu fade_context_menu;
void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
@ -1843,15 +1849,19 @@ public:
bool autoscroll_active;
int autoscroll_timeout_tag;
int autoscroll_direction;
int autoscroll_x;
int autoscroll_y;
int last_autoscroll_x;
int last_autoscroll_y;
uint32_t autoscroll_cnt;
nframes_t autoscroll_distance;
nframes_t autoscroll_x_distance;
double autoscroll_y_distance;
static gint _autoscroll_canvas (void *);
bool autoscroll_canvas ();
void start_canvas_autoscroll (int direction);
void start_canvas_autoscroll (int x, int y);
void stop_canvas_autoscroll ();
void maybe_autoscroll (GdkEvent*);
void maybe_autoscroll (GdkEventMotion*);
/* trimming */
enum TrimOp {
@ -2169,13 +2179,15 @@ public:
void ensure_entered_track_selected (bool op_acts_on_objects = false);
bool clear_entered_track;
gint left_track_canvas (GdkEventCrossing*);
bool left_track_canvas (GdkEventCrossing*);
bool entered_track_canvas (GdkEventCrossing*);
void set_entered_track (TimeAxisView*);
void set_entered_regionview (RegionView*);
gint left_automation_track ();
bool _new_regionviews_show_envelope;
void reset_canvas_action_sensitivity (bool);
void toggle_gain_envelope_visibility ();
void toggle_gain_envelope_active ();
void reset_region_gain_envelopes ();

View file

@ -61,6 +61,7 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, X_("MarkerMenu"), _("Markers"));
ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff"));
ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold"));
ActionManager::register_action (editor_actions, X_("MiscOptions"), _("Misc Options"));
ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring"));
ActionManager::register_action (editor_actions, X_("MoveActiveMarkMenu"), _("Active Mark"));
ActionManager::register_action (editor_actions, X_("MovePlayHeadMenu"), _("Playhead"));
@ -98,6 +99,7 @@ Editor::register_actions ()
/* add named actions for the editor */
ActionManager::register_toggle_action (editor_actions, "link-region-and-track-selection", _("Link Region/Track Selection"), mem_fun (*this, &Editor::toggle_link_region_and_track_selection));
ActionManager::register_action (editor_actions, "break-drag", _("Break drag"), mem_fun (*this, &Editor::break_drag));
act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled));
ActionManager::session_sensitive_actions.push_back (act);
@ -177,16 +179,12 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-after-playhead", _("Select All After Playhead"), bind (mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, true));
act = ActionManager::register_action (editor_actions, "select-all-between-cursors", _("Select All Overlapping Edit Range"), bind (mem_fun(*this, &Editor::select_all_selectables_between), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-before-playhead", _("Select All Before Playhead"), bind (mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-between-cursors", _("Select All Between Playhead & Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_between), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-within-cursors", _("Select All Within Playhead & Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_between), true));
act = ActionManager::register_action (editor_actions, "select-all-within-cursors", _("Select All Inside Edit Range"), bind (mem_fun(*this, &Editor::select_all_selectables_between), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-range-between-cursors", _("Select Range Between Playhead & Edit Point"), mem_fun(*this, &Editor::select_range_between));
act = ActionManager::register_action (editor_actions, "select-range-between-cursors", _("Select Edit Range"), mem_fun(*this, &Editor::select_range_between));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-in-punch-range", _("Select All in Punch Range"), mem_fun(*this, &Editor::select_all_selectables_using_punch));
@ -365,7 +363,7 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "set-playhead", _("Playhead to Mouse"), mem_fun(*this, &Editor::set_playhead_cursor));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-edit-point", _("Edit Point to Mouse"), mem_fun(*this, &Editor::set_edit_point));
act = ActionManager::register_action (editor_actions, "set-edit-point", _("Active Marker to Mouse"), mem_fun(*this, &Editor::set_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
@ -447,16 +445,16 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut));
ActionManager::session_sensitive_actions.push_back (act);
/* Note: for now, editor-delete does the exact same thing as editor-cut */
@ -472,6 +470,7 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "set-tempo-from-region", _("Set Tempo from Region=Bar"), mem_fun(*this, &Editor::use_region_as_bar));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-tempo-from-edit-range", _("Set Tempo from Edit Range=Bar"), mem_fun(*this, &Editor::use_range_as_bar));
ActionManager::session_sensitive_actions.push_back (act);
@ -511,6 +510,10 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "remove-last-capture", _("Remove Last Capture"), (mem_fun(*this, &Editor::remove_last_capture)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "insert-time", _("Insert Time"), (mem_fun(*this, &Editor::do_insert_time)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "toggle-track-active", _("Toggle Active"), (mem_fun(*this, &Editor::toggle_tracks_active)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
@ -521,20 +524,20 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "track-height-largest", _("Largest"), (mem_fun(*this, &Editor::set_track_height_largest)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "track-height-larger", _("Larger"), (mem_fun(*this, &Editor::set_track_height_large)));
act = ActionManager::register_action (editor_actions, "track-height-larger", _("Larger"), (mem_fun(*this, &Editor::set_track_height_larger)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "track-height-large", _("Large"), (mem_fun(*this, &Editor::set_track_height_larger)));
act = ActionManager::register_action (editor_actions, "track-height-large", _("Large"), (mem_fun(*this, &Editor::set_track_height_large)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "track-height-normal", _("Normal"), (mem_fun(*this, &Editor::set_track_height_normal)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "track-height-small", _("Small"), (mem_fun(*this, &Editor::set_track_height_smaller)));
act = ActionManager::register_action (editor_actions, "track-height-small", _("Small"), (mem_fun(*this, &Editor::set_track_height_small)));
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "track-height-smaller", _("Smaller"), (mem_fun(*this, &Editor::set_track_height_small)));
act = ActionManager::register_action (editor_actions, "track-height-smaller", _("Smaller"), (mem_fun(*this, &Editor::set_track_height_smaller)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
@ -690,9 +693,8 @@ Editor::register_actions ()
/* the next two are duplicate items with different names for use in two different contexts */
ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Import Existing Media"), mem_fun (*this, &Editor::external_audio_dialog));
act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Add External Media"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
act = ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Import"), mem_fun (*this, &Editor::external_audio_dialog));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::register_toggle_action (editor_actions, X_("toggle-waveform-visible"), _("Show Waveforms"), mem_fun (*this, &Editor::toggle_waveform_visibility));
@ -1668,3 +1670,16 @@ Editor::reset_focus ()
{
track_canvas->grab_focus();
}
void
Editor::reset_canvas_action_sensitivity (bool onoff)
{
if (_edit_point != EditAtMouse) {
onoff = true;
}
for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) {
(*x)->set_sensitive (onoff);
}
}

View file

@ -225,7 +225,7 @@ Editor::check_whether_and_how_to_import(string path, bool all_or_nothing)
//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?");
message = string_compose(_("A source file %1 already exists. This operation will not update that source but import the file %2 as a new source, please confirm."), wave_name, wave_name);
}
MessageDialog dialog(message, false,Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true);

View file

@ -127,6 +127,7 @@ Editor::initialize_canvas ()
track_canvas->set_name ("EditorMainCanvas");
track_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK);
track_canvas->signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
track_canvas->signal_enter_notify_event().connect (mem_fun(*this, &Editor::entered_track_canvas));
track_canvas->set_flags (CAN_FOCUS);
/* set up drag-n-drop */
@ -189,17 +190,15 @@ Editor::initialize_canvas ()
cd_marker_group = new ArdourCanvas::Group (*time_canvas->root(), 0.0, timebar_height * 5.0);
tempo_bar = new ArdourCanvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
tempo_bar->property_outline_what() = (0x1 | 0x8);
tempo_bar->property_outline_pixels() = 1;
meter_bar = new ArdourCanvas::SimpleRect (*meter_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
meter_bar->property_outline_what() = (0x1 | 0x8);
meter_bar->property_outline_pixels() = 1;
marker_bar = new ArdourCanvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
marker_bar->property_outline_what() = (0x1 | 0x8);
marker_bar->property_outline_pixels() = 1;
@ -209,20 +208,18 @@ Editor::initialize_canvas ()
range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
range_marker_bar->property_outline_what() = (0x1 | 0x8);
range_marker_bar->property_outline_pixels() = 1;
range_marker_bar->property_outline_pixels() = 0;
transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
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->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 ();
transport_bar_drag_rect = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
transport_bar_drag_rect->property_outline_pixels() = 0;
@ -588,47 +585,52 @@ Editor::drop_routes (const Glib::RefPtr<Gdk::DragContext>& context,
}
void
Editor::maybe_autoscroll (GdkEvent* event)
Editor::maybe_autoscroll (GdkEventMotion* event)
{
nframes_t rightmost_frame = leftmost_frame + current_page_frames();
nframes_t frame = drag_info.current_pointer_frame;
bool startit = false;
double vertical_pos = vertical_adjustment.get_value();
static int last_autoscroll_direction = 0;
autoscroll_y = 0;
autoscroll_x = 0;
if (event->y < vertical_pos) {
autoscroll_y = -1;
startit = true;
}
if (event->y > vertical_pos + canvas_height) {
autoscroll_y = 1;
startit = true;
}
if (frame > rightmost_frame) {
if (rightmost_frame < max_frames) {
autoscroll_direction = 1;
autoscroll_x = 1;
startit = true;
}
} else if (frame < leftmost_frame) {
if (leftmost_frame > 0) {
autoscroll_direction = -1;
autoscroll_x = -1;
startit = true;
}
} else {
if (drag_info.last_pointer_frame > drag_info.current_pointer_frame) {
autoscroll_direction = -1;
} else {
autoscroll_direction = 1;
}
}
if ((autoscroll_direction != last_autoscroll_direction) || (leftmost_frame < frame < rightmost_frame)) {
if ((autoscroll_x != last_autoscroll_x) || (autoscroll_y != last_autoscroll_y) || (autoscroll_x == 0 && autoscroll_y == 0)) {
stop_canvas_autoscroll ();
}
if (startit && autoscroll_timeout_tag < 0) {
start_canvas_autoscroll (autoscroll_direction);
start_canvas_autoscroll (autoscroll_x, autoscroll_y);
}
last_autoscroll_direction = autoscroll_direction;
last_autoscroll_x = autoscroll_x;
last_autoscroll_y = autoscroll_y;
}
gint
@ -644,21 +646,64 @@ Editor::autoscroll_canvas ()
nframes_t limit = max_frames - current_page_frames();
GdkEventMotion ev;
nframes_t target_frame;
double new_pixel;
double target_pixel;
if (autoscroll_direction < 0) {
if (leftmost_frame < autoscroll_distance) {
if (autoscroll_x < 0) {
if (leftmost_frame < autoscroll_x_distance) {
new_frame = 0;
} else {
new_frame = leftmost_frame - autoscroll_distance;
new_frame = leftmost_frame - autoscroll_x_distance;
}
target_frame = drag_info.current_pointer_frame - autoscroll_distance;
} else {
if (leftmost_frame > limit - autoscroll_distance) {
target_frame = drag_info.current_pointer_frame - autoscroll_x_distance;
} else if (autoscroll_x > 0) {
if (leftmost_frame > limit - autoscroll_x_distance) {
new_frame = limit;
} else {
new_frame = leftmost_frame + autoscroll_distance;
new_frame = leftmost_frame + autoscroll_x_distance;
}
target_frame = drag_info.current_pointer_frame + autoscroll_distance;
target_frame = drag_info.current_pointer_frame + autoscroll_x_distance;
} else {
target_frame = drag_info.current_pointer_frame;
new_frame = leftmost_frame;
}
double vertical_pos = vertical_adjustment.get_value();
if (autoscroll_y < 0) {
if (vertical_pos < autoscroll_y_distance) {
new_pixel = 0;
} else {
new_pixel = vertical_pos - autoscroll_y_distance;
}
target_pixel = drag_info.current_pointer_y - autoscroll_y_distance;
target_pixel = max (target_pixel, 0.0);
} else if (autoscroll_y > 0) {
double top_of_bottom_of_canvas = full_canvas_height - canvas_height;
if (vertical_pos > full_canvas_height - autoscroll_y_distance) {
new_pixel = full_canvas_height;
} else {
new_pixel = vertical_pos + autoscroll_y_distance;
}
new_pixel = min (top_of_bottom_of_canvas, new_pixel);
target_pixel = drag_info.current_pointer_y + autoscroll_y_distance;
/* don't move to the full canvas height because the item will be invisible
(its top edge will line up with the bottom of the visible canvas.
*/
target_pixel = min (target_pixel, full_canvas_height - 10);
} else {
target_pixel = drag_info.current_pointer_y;
new_pixel = vertical_pos;
}
/* now fake a motion event to get the object that is being dragged to move too */
@ -666,10 +711,10 @@ Editor::autoscroll_canvas ()
ev.type = GDK_MOTION_NOTIFY;
ev.state &= Gdk::BUTTON1_MASK;
ev.x = frame_to_unit (target_frame);
ev.y = drag_info.current_pointer_y;
ev.y = target_pixel;
motion_handler (drag_info.item, (GdkEvent*) &ev, drag_info.item_type, true);
if (new_frame == 0 || new_frame == limit) {
if ((new_frame == 0 || new_frame == limit) && (new_pixel == 0 || new_pixel == DBL_MAX)) {
/* we are done */
return false;
}
@ -689,29 +734,54 @@ Editor::autoscroll_canvas ()
reset_x_origin (new_frame);
}
if (autoscroll_cnt == 50) { /* 0.5 seconds */
/* after about a while, speed up a bit by changing the timeout interval */
vertical_adjustment.set_value (new_pixel);
autoscroll_distance = (nframes_t) floor (current_page_frames()/30.0f);
} else if (autoscroll_cnt == 150) { /* 1.0 seconds */
if (autoscroll_x_distance != 0) {
autoscroll_distance = (nframes_t) floor (current_page_frames()/20.0f);
if (autoscroll_cnt == 50) { /* 0.5 seconds */
/* after about a while, speed up a bit by changing the timeout interval */
autoscroll_x_distance = (nframes_t) floor (current_page_frames()/30.0f);
} else if (autoscroll_cnt == 150) { /* 1.0 seconds */
autoscroll_x_distance = (nframes_t) floor (current_page_frames()/20.0f);
} else if (autoscroll_cnt == 300) { /* 1.5 seconds */
/* after about another while, speed up by increasing the shift per callback */
autoscroll_x_distance = (nframes_t) floor (current_page_frames()/10.0f);
}
}
} else if (autoscroll_cnt == 300) { /* 1.5 seconds */
if (autoscroll_y_distance != 0) {
/* after about another while, speed up by increasing the shift per callback */
autoscroll_distance = (nframes_t) floor (current_page_frames()/10.0f);
}
if (autoscroll_cnt == 50) { /* 0.5 seconds */
/* after about a while, speed up a bit by changing the timeout interval */
autoscroll_y_distance = 10;
} else if (autoscroll_cnt == 150) { /* 1.0 seconds */
autoscroll_y_distance = 20;
} else if (autoscroll_cnt == 300) { /* 1.5 seconds */
/* after about another while, speed up by increasing the shift per callback */
autoscroll_y_distance = 40;
}
}
return true;
}
void
Editor::start_canvas_autoscroll (int dir)
Editor::start_canvas_autoscroll (int dx, int dy)
{
if (!session || autoscroll_active) {
return;
@ -720,8 +790,10 @@ Editor::start_canvas_autoscroll (int dir)
stop_canvas_autoscroll ();
autoscroll_active = true;
autoscroll_direction = dir;
autoscroll_distance = (nframes_t) floor (current_page_frames()/50.0);
autoscroll_x = dx;
autoscroll_y = dy;
autoscroll_x_distance = (nframes_t) floor (current_page_frames()/50.0);
autoscroll_y_distance = fabs (dy * 5); /* pixels */
autoscroll_cnt = 0;
/* do it right now, which will start the repeated callbacks */
@ -740,11 +812,19 @@ Editor::stop_canvas_autoscroll ()
autoscroll_active = false;
}
gint
bool
Editor::left_track_canvas (GdkEventCrossing *ev)
{
set_entered_track (0);
set_entered_regionview (0);
reset_canvas_action_sensitivity (false);
return false;
}
bool
Editor::entered_track_canvas (GdkEventCrossing *ev)
{
reset_canvas_action_sensitivity (true);
return FALSE;
}

View file

@ -430,7 +430,8 @@ Editor::start_imageframe_grab(ArdourCanvas::Item* item, GdkEvent* event)
drag_info.finished_callback = &Editor::timeaxis_item_drag_finished_callback;
drag_info.last_frame_position = ifv->get_position() ;
drag_info.last_trackview = &ifv->get_time_axis_view() ;
drag_info.source_trackview = &ifv->get_time_axis_view() ;
drag_info.dest_trackview = drag_info.source_trackview;
/* this is subtle. raising the regionview itself won't help,
because raise_to_top() just puts the item on the top of
@ -442,7 +443,7 @@ Editor::start_imageframe_grab(ArdourCanvas::Item* item, GdkEvent* event)
*/
drag_info.item->raise_to_top();
drag_info.last_trackview->canvas_display->raise_to_top();
drag_info.source_trackview->canvas_display->raise_to_top();
//time_line_group->raise_to_top();
cursor_group->raise_to_top ();
@ -463,7 +464,8 @@ Editor::start_markerview_grab(ArdourCanvas::Item* item, GdkEvent* event)
drag_info.finished_callback = &Editor::timeaxis_item_drag_finished_callback;
drag_info.last_frame_position = mv->get_position() ;
drag_info.last_trackview = &mv->get_time_axis_view() ;
drag_info.source_trackview = &mv->get_time_axis_view() ;
drag_info.dest_trackview = drag_info.source_trackview;
/* this is subtle. raising the regionview itself won't help,
because raise_to_top() just puts the item on the top of
@ -475,7 +477,7 @@ Editor::start_markerview_grab(ArdourCanvas::Item* item, GdkEvent* event)
*/
drag_info.item->raise_to_top();
drag_info.last_trackview->canvas_display->raise_to_top();
drag_info.source_trackview->canvas_display->raise_to_top();
//time_line_group->raise_to_top();
cursor_group->raise_to_top ();

View file

@ -328,7 +328,9 @@ Editor::refresh_location_display_internal (Locations::LocationList& locations)
i = tmp;
}
update_punch_range_view (false);
update_loop_range_view (false);
}
void

View file

@ -84,6 +84,10 @@ Editor::mouse_frame (nframes64_t& where, bool& in_track_canvas) const
Gdk::ModifierType mask;
Glib::RefPtr<Gdk::Window> canvas_window = const_cast<Editor*>(this)->track_canvas->get_window();
Glib::RefPtr<const Gdk::Window> pointer_window;
if (!canvas_window) {
return false;
}
pointer_window = canvas_window->get_pointer (x, y, mask);
@ -1605,6 +1609,85 @@ Editor::left_automation_track ()
return false;
}
void
Editor::scrub ()
{
double delta;
if (scrubbing_direction == 0) {
/* first move */
session->request_locate (drag_info.current_pointer_frame, false);
session->request_transport_speed (0.1);
scrubbing_direction = 1;
} else {
if (last_scrub_x > drag_info.current_pointer_x) {
/* pointer moved to the left */
if (scrubbing_direction > 0) {
/* we reversed direction to go backwards */
scrub_reversals++;
scrub_reverse_distance += (int) (last_scrub_x - drag_info.current_pointer_x);
} else {
/* still moving to the left (backwards) */
scrub_reversals = 0;
scrub_reverse_distance = 0;
delta = 0.01 * (last_scrub_x - drag_info.current_pointer_x);
session->request_transport_speed (session->transport_speed() - delta);
}
} else {
/* pointer moved to the right */
if (scrubbing_direction < 0) {
/* we reversed direction to go forward */
scrub_reversals++;
scrub_reverse_distance += (int) (drag_info.current_pointer_x - last_scrub_x);
} else {
/* still moving to the right */
scrub_reversals = 0;
scrub_reverse_distance = 0;
delta = 0.01 * (drag_info.current_pointer_x - last_scrub_x);
session->request_transport_speed (session->transport_speed() + delta);
}
}
/* if there have been more than 2 opposite motion moves detected, or one that moves
back more than 10 pixels, reverse direction
*/
if (scrub_reversals >= 2 || scrub_reverse_distance > 10) {
if (scrubbing_direction > 0) {
/* was forwards, go backwards */
session->request_transport_speed (-0.1);
scrubbing_direction = -1;
} else {
/* was backwards, go forwards */
session->request_transport_speed (0.1);
scrubbing_direction = 1;
}
scrub_reverse_distance = 0;
scrub_reversals = 0;
}
}
last_scrub_x = drag_info.current_pointer_x;
}
bool
Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type, bool from_autoscroll)
{
@ -1621,7 +1704,7 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item
*/
track_canvas->get_pointer (x, y);
}
}
if (current_stepping_trackview) {
/* don't keep the persistent stepped trackview if the mouse moves */
@ -1640,85 +1723,13 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item
drag_info.current_pointer_frame = event_frame (event, &drag_info.current_pointer_x,
&drag_info.current_pointer_y);
switch (mouse_mode) {
case MouseAudition:
if (_scrubbing) {
double delta;
if (scrubbing_direction == 0) {
/* first move */
session->request_locate (drag_info.current_pointer_frame, false);
session->request_transport_speed (0.1);
scrubbing_direction = 1;
} else {
if (last_scrub_x > drag_info.current_pointer_x) {
/* pointer moved to the left */
if (scrubbing_direction > 0) {
/* we reversed direction to go backwards */
scrub_reversals++;
scrub_reverse_distance += (int) (last_scrub_x - drag_info.current_pointer_x);
} else {
/* still moving to the left (backwards) */
scrub_reversals = 0;
scrub_reverse_distance = 0;
delta = 0.01 * (last_scrub_x - drag_info.current_pointer_x);
session->request_transport_speed (session->transport_speed() - delta);
}
} else {
/* pointer moved to the right */
if (scrubbing_direction < 0) {
/* we reversed direction to go forward */
scrub_reversals++;
scrub_reverse_distance += (int) (drag_info.current_pointer_x - last_scrub_x);
} else {
/* still moving to the right */
scrub_reversals = 0;
scrub_reverse_distance = 0;
delta = 0.01 * (drag_info.current_pointer_x - last_scrub_x);
session->request_transport_speed (session->transport_speed() + delta);
}
}
/* if there have been more than 2 opposite motion moves detected, or one that moves
back more than 10 pixels, reverse direction
*/
if (scrub_reversals >= 2 || scrub_reverse_distance > 10) {
if (scrubbing_direction > 0) {
/* was forwards, go backwards */
session->request_transport_speed (-0.1);
scrubbing_direction = -1;
} else {
/* was backwards, go forwards */
session->request_transport_speed (0.1);
scrubbing_direction = 1;
}
scrub_reverse_distance = 0;
scrub_reversals = 0;
}
}
last_scrub_x = drag_info.current_pointer_x;
scrub ();
}
break;
default:
break;
@ -1772,7 +1783,7 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item
if (drag_info.item && (event->motion.state & Gdk::BUTTON1_MASK ||
(event->motion.state & Gdk::BUTTON2_MASK))) {
if (!from_autoscroll) {
maybe_autoscroll (event);
maybe_autoscroll (&event->motion);
}
(this->*(drag_info.motion_callback)) (item, event);
goto handled;
@ -1792,7 +1803,7 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item
if (drag_info.item && (event->motion.state & GDK_BUTTON1_MASK ||
(event->motion.state & GDK_BUTTON2_MASK))) {
if (!from_autoscroll) {
maybe_autoscroll (event);
maybe_autoscroll (&event->motion);
}
(this->*(drag_info.motion_callback)) (item, event);
goto handled;
@ -1813,6 +1824,48 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item
return false;
}
void
Editor::break_drag ()
{
stop_canvas_autoscroll ();
hide_verbose_canvas_cursor ();
if (drag_info.item) {
drag_info.item->ungrab (0);
/* put it back where it came from */
double cxw, cyw;
cxw = 0;
cyw = 0;
drag_info.item->i2w (cxw, cyw);
drag_info.item->move (drag_info.original_x - cxw, drag_info.original_y - cyw);
}
finalize_drag ();
}
void
Editor::finalize_drag ()
{
drag_info.item = 0;
drag_info.copy = false;
drag_info.motion_callback = 0;
drag_info.finished_callback = 0;
drag_info.dest_trackview = 0;
drag_info.source_trackview = 0;
drag_info.last_frame_position = 0;
drag_info.grab_frame = 0;
drag_info.last_pointer_frame = 0;
drag_info.current_pointer_frame = 0;
drag_info.brushing = false;
if (drag_info.copied_location) {
delete drag_info.copied_location;
drag_info.copied_location = 0;
}
}
void
Editor::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
{
@ -1857,6 +1910,10 @@ Editor::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
drag_info.brushing = false;
drag_info.copied_location = 0;
drag_info.original_x = 0;
drag_info.original_y = 0;
drag_info.item->i2w (drag_info.original_x, drag_info.original_y);
drag_info.item->grab (Gdk::POINTER_MOTION_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK,
*cursor,
event->button.time);
@ -1915,21 +1972,7 @@ Editor::end_grab (ArdourCanvas::Item* item, GdkEvent* event)
hide_verbose_canvas_cursor();
drag_info.item = 0;
drag_info.copy = false;
drag_info.motion_callback = 0;
drag_info.finished_callback = 0;
drag_info.last_trackview = 0;
drag_info.last_frame_position = 0;
drag_info.grab_frame = 0;
drag_info.last_pointer_frame = 0;
drag_info.current_pointer_frame = 0;
drag_info.brushing = false;
if (drag_info.copied_location) {
delete drag_info.copied_location;
drag_info.copied_location = 0;
}
finalize_drag ();
return did_drag;
}
@ -2415,8 +2458,8 @@ void
Editor::marker_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
if (drag_info.first_move) {
marker_drag_motion_callback (item, event);
/* just a click, do nothing but whatever selection occured */
return;
}
_dragging_edit_point = false;
@ -3016,7 +3059,8 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event)
drag_info.last_frame_position = (nframes_t) (clicked_regionview->region()->position() / speed);
drag_info.pointer_frame_offset = drag_info.grab_frame - drag_info.last_frame_position;
drag_info.last_trackview = &clicked_regionview->get_time_axis_view();
drag_info.source_trackview = &clicked_regionview->get_time_axis_view();
drag_info.dest_trackview = drag_info.source_trackview;
// we want a move threshold
drag_info.want_move_threshold = true;
@ -3031,7 +3075,8 @@ Editor::start_create_region_grab (ArdourCanvas::Item* item, GdkEvent* event)
drag_info.copy = false;
drag_info.item = item;
drag_info.data = clicked_axisview;
drag_info.last_trackview = clicked_axisview;
drag_info.source_trackview = clicked_axisview;
drag_info.dest_trackview = drag_info.source_trackview;
drag_info.motion_callback = &Editor::create_region_drag_motion_callback;
drag_info.finished_callback = &Editor::create_region_drag_finished_callback;
@ -3059,7 +3104,8 @@ Editor::start_region_copy_grab (ArdourCanvas::Item* item, GdkEvent* event)
speed = rtv->get_diskstream()->speed();
}
drag_info.last_trackview = &clicked_regionview->get_time_axis_view();
drag_info.source_trackview = &clicked_regionview->get_time_axis_view();
drag_info.dest_trackview = drag_info.source_trackview;
drag_info.last_frame_position = (nframes_t) (clicked_regionview->region()->position() / speed);
drag_info.pointer_frame_offset = drag_info.grab_frame - drag_info.last_frame_position;
// we want a move threshold
@ -3094,7 +3140,8 @@ Editor::start_region_brush_grab (ArdourCanvas::Item* item, GdkEvent* event)
drag_info.last_frame_position = (nframes_t) (clicked_regionview->region()->position() / speed);
drag_info.pointer_frame_offset = drag_info.grab_frame - drag_info.last_frame_position;
drag_info.last_trackview = &clicked_regionview->get_time_axis_view();
drag_info.source_trackview = &clicked_regionview->get_time_axis_view();
drag_info.dest_trackview = drag_info.source_trackview;
// we want a move threshold
drag_info.want_move_threshold = true;
drag_info.brushing = true;
@ -3109,7 +3156,7 @@ Editor::possibly_copy_regions_during_grab (GdkEvent* event)
drag_info.want_move_threshold = false; // don't copy again
/* duplicate the region(s) */
/* duplicate the regionview(s) and region(s) */
vector<RegionView*> new_regionviews;
@ -3117,7 +3164,7 @@ Editor::possibly_copy_regions_during_grab (GdkEvent* event)
RegionView* rv;
RegionView* nrv;
rv = (*i);
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(rv);
@ -3130,9 +3177,12 @@ Editor::possibly_copy_regions_during_grab (GdkEvent* event)
} else {
continue;
}
const boost::shared_ptr<const Region> original = arv->region();
boost::shared_ptr<Region> region_copy = RegionFactory::create (original);
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (region_copy);
nrv->get_canvas_group()->show ();
new_regionviews.push_back (nrv);
}
@ -3140,10 +3190,16 @@ Editor::possibly_copy_regions_during_grab (GdkEvent* event)
return;
}
/* reset selection to new regionviews */
/* reset selection to new regionviews. This will not set selection visual status for
these regionviews since they don't belong to a track, so do that by hand too.
*/
selection->set (new_regionviews);
for (vector<RegionView*>::iterator i = new_regionviews.begin(); i != new_regionviews.end(); ++i) {
(*i)->set_selected (true);
}
/* reset drag_info data to reflect the fact that we are dragging the copies */
drag_info.data = new_regionviews.front();
@ -3267,7 +3323,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
return;
}
original_pointer_order = drag_info.last_trackview->order;
original_pointer_order = drag_info.dest_trackview->order;
/************************************************************
Y-Delta Computation
@ -3279,7 +3335,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
goto y_axis_done;
}
if ((pointer_y_span = (drag_info.last_trackview->order - tv->order)) != 0) {
if ((pointer_y_span = (drag_info.dest_trackview->order - tv->order)) != 0) {
int32_t children = 0, numtracks = 0;
// XXX hard coding track limit, oh my, so very very bad
@ -3323,16 +3379,16 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
/* find the actual span according to the canvas */
canvas_pointer_y_span = pointer_y_span;
if (drag_info.last_trackview->order >= tv->order) {
if (drag_info.dest_trackview->order >= tv->order) {
int32_t y;
for (y = tv->order; y < drag_info.last_trackview->order; y++) {
for (y = tv->order; y < drag_info.dest_trackview->order; y++) {
if (height_list[y] == 0 ) {
canvas_pointer_y_span--;
}
}
} else {
int32_t y;
for (y = drag_info.last_trackview->order;y <= tv->order; y++) {
for (y = drag_info.dest_trackview->order;y <= tv->order; y++) {
if ( height_list[y] == 0 ) {
canvas_pointer_y_span++;
}
@ -3344,6 +3400,10 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
double ix1, ix2, iy1, iy2;
int32_t n = 0;
if (rv2->region()->locked()) {
continue;
}
rv2->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
rv2->get_canvas_group()->i2w (ix1, iy1);
TimeAxisView* tvp2 = trackview_by_y_position (iy1);
@ -3415,13 +3475,13 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
}
}
} else if (drag_info.last_trackview == tv) {
} else if (drag_info.dest_trackview == tv) {
clamp_y_axis = true;
}
y_axis_done:
if (!clamp_y_axis) {
drag_info.last_trackview = tv;
drag_info.dest_trackview = tv;
}
/************************************************************
@ -3471,8 +3531,20 @@ 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 );
bool x_move_allowed = ( !drag_info.x_constrained && (Config->get_edit_mode() != Lock)) || ( drag_info.x_constrained && (Config->get_edit_mode() == Lock)) ;
bool x_move_allowed;
if (Config->get_edit_mode() == Lock) {
if (drag_info.copy) {
x_move_allowed = !drag_info.x_constrained;
} else {
/* in locked edit mode, reverse the usual meaning of x_constrained */
x_move_allowed = drag_info.x_constrained;
}
} else {
x_move_allowed = !drag_info.x_constrained;
}
if ( pending_region_position != drag_info.last_frame_position && x_move_allowed ) {
/* now compute the canvas unit distance we need to move the regionview
@ -3554,6 +3626,10 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
double ix1, ix2, iy1, iy2;
int32_t temp_pointer_y_span = pointer_y_span;
if (rv->region()->locked()) {
continue;
}
/* get item BBox, which will be relative to parent. so we have
to query on a child, then convert to world coordinates using
the parent.
@ -3591,6 +3667,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
y_delta -= (*j);
temp_pointer_y_span--;
}
while (temp_pointer_y_span < 0) {
y_delta += (*j);
if (x != original_pointer_order) {
@ -3621,7 +3698,8 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
x++;
}
}
/* prevent the regionview from being moved to before
the zero position on the canvas.
*/
@ -3678,18 +3756,15 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
void
Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
nframes_t where;
RegionView* rvdi = reinterpret_cast<RegionView *> (drag_info.data);
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
bool nocommit = true;
double speed;
RouteTimeAxisView* rtv;
bool regionview_y_movement;
bool regionview_x_movement;
vector<RegionView*> copies;
list <boost::shared_ptr<Playlist > > used_playlists;
list <sigc::connection > used_connections;
bool preserve_selection = false;
RouteTimeAxisView* source_tv;
boost::shared_ptr<Diskstream> ds;
boost::shared_ptr<Playlist> from_playlist;
vector<RegionView*> new_selection;
typedef set<boost::shared_ptr<Playlist> > PlaylistSet;
PlaylistSet modified_playlists;
pair<PlaylistSet::iterator,bool> insert_result;
/* first_move is set to false if the regionview has been moved in the
motion handler.
@ -3725,22 +3800,16 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
goto out;
}
/* adjust for track speed */
speed = 1.0;
rtv = dynamic_cast<RouteTimeAxisView*> (drag_info.last_trackview);
if (rtv && rtv->get_diskstream()) {
speed = rtv->get_diskstream()->speed();
}
regionview_x_movement = (drag_info.last_frame_position != (nframes_t) (rvdi->region()->position()/speed));
regionview_y_movement = (drag_info.last_trackview != &rvdi->get_time_axis_view());
//printf ("last_frame: %s position is %lu %g\n", rv->get_time_axis_view().name().c_str(), drag_info.last_frame_position, speed);
//printf ("last_rackview: %s \n", drag_info.last_trackview->name().c_str());
char* op_string;
/* reverse this here so that we have the correct logic to finalize
the drag.
*/
if (Config->get_edit_mode() == Lock && !drag_info.copy) {
drag_info.x_constrained = !drag_info.x_constrained;
}
if (drag_info.copy) {
if (drag_info.x_constrained) {
op_string = _("fixed time region copy");
@ -3757,94 +3826,125 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
begin_reversible_command (op_string);
if (regionview_y_movement) {
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) {
RegionView* rv = (*i);
double ix1, ix2, iy1, iy2;
rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
rv->get_canvas_group()->i2w (ix1, iy1);
TimeAxisView* dest_tv = trackview_by_y_position (iy1);
RouteTimeAxisView* dest_rtv = dynamic_cast<RouteTimeAxisView*>(dest_tv);
double speed;
bool changed_tracks;
bool changed_position;
nframes_t where;
/* moved to a different track. */
if (rv->region()->locked()) {
++i;
continue;
}
/* adjust for track speed */
speed = 1.0;
vector<RegionView*> new_selection;
if (dest_rtv && dest_rtv->get_diskstream()) {
speed = dest_rtv->get_diskstream()->speed();
}
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) {
RegionView* rv = (*i);
changed_position = (drag_info.last_frame_position != (nframes_t) (rv->region()->position()/speed));
changed_tracks = (dest_tv != &rv->get_time_axis_view());
double ix1, ix2, iy1, iy2;
rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
rv->get_canvas_group()->i2w (ix1, iy1);
RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*>(trackview_by_y_position (iy1));
boost::shared_ptr<Playlist> from_playlist = rv->region()->playlist();
boost::shared_ptr<Playlist> to_playlist = rtv2->playlist();
if (changed_position && !drag_info.x_constrained) {
where = (nframes_t) (unit_to_frame (ix1) * speed);
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region()));
if (! to_playlist->frozen()) {
/*
we haven't seen this playlist before.
we want to freeze it because we don't want to relayer per-region.
its much better to do that just once if the playlist is large.
*/
/*
connect so the selection is changed when the new regionview finally appears (after thaw).
keep track of it so we can disconnect later.
*/
sigc::connection c = rtv2->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_and_select_new_region_view));
used_connections.push_back (c);
/* undo */
session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0));
/* remember used playlists so we can thaw them later */
used_playlists.push_back(to_playlist);
to_playlist->freeze();
}
} else {
where = rv->region()->position();
}
/* undo the previous hide_dependent_views so that xfades don't
disappear on copying regions
*/
/* undo the previous hide_dependent_views so that xfades don't
disappear on copying regions
*/
rv->get_time_axis_view().reveal_dependent_views (*rv);
boost::shared_ptr<Region> new_region;
rv->get_time_axis_view().reveal_dependent_views (*rv);
if (drag_info.copy) {
/* we already made a copy */
new_region = rv->region();
} else {
new_region = RegionFactory::create (rv->region());
}
if (!drag_info.copy) {
/* the region that used to be in the old playlist is not
moved to the new one - we make a copy of it. as a result,
any existing editor for the region should no longer be
visible.
*/
rv->hide_region_editor();
rv->fake_set_opaque (false);
if (changed_tracks || drag_info.copy) {
session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0));
from_playlist->remove_region ((rv->region()));
session->add_command (new MementoCommand<Playlist>(*from_playlist, 0, &from_playlist->get_state()));
} else {
/* the regionview we dragged around is a temporary copy, queue it for deletion */
copies.push_back (rv);
}
boost::shared_ptr<Playlist> to_playlist = dest_rtv->playlist();
latest_regionviews.clear ();
sigc::connection c = rtv2->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0));
sigc::connection c = dest_rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
insert_result = modified_playlists.insert (to_playlist);
if (insert_result.second) {
session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0));
}
to_playlist->add_region (new_region, where);
session->add_command (new MementoCommand<Playlist>(*to_playlist, 0, &to_playlist->get_state()));
c.disconnect ();
if (!latest_regionviews.empty()) {
new_selection.insert (new_selection.end(), latest_regionviews.begin(), latest_regionviews.end());
// XXX why just the first one ? we only expect one
dest_rtv->reveal_dependent_views (*latest_regionviews.front());
new_selection.push_back (latest_regionviews.front());
}
} else {
/* just change the model */
boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
insert_result = modified_playlists.insert (playlist);
if (insert_result.second) {
session->add_command (new MementoCommand<Playlist>(*playlist, &playlist->get_state(), 0));
}
rv->region()->set_position (where, (void*) this);
}
if (changed_tracks && !drag_info.copy) {
/* get the playlist where this drag started. we can't use rv->region()->playlist()
because we may have copied the region and it has not been attached to a playlist.
*/
assert ((source_tv = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view())));
assert ((ds = source_tv->get_diskstream()));
assert ((from_playlist = ds->playlist()));
/* moved to a different audio track, without copying */
/* the region that used to be in the old playlist is not
moved to the new one - we use a copy of it. as a result,
any existing editor for the region should no longer be
visible.
*/
rv->hide_region_editor();
rv->fake_set_opaque (false);
/* remove the region from the old playlist */
insert_result = modified_playlists.insert (from_playlist);
if (insert_result.second) {
session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0));
}
from_playlist->remove_region ((rv->region()));
/* OK, this is where it gets tricky. If the playlist was being used by >1 tracks, and the region
was selected in all of them, then removing it from the playlist will have removed all
was selected in all of them, then removing it from a playlist will have removed all
trace of it from the selection (i.e. there were N regions selected, we removed 1,
but since its the same playlist for N tracks, all N tracks updated themselves, removed the
corresponding regionview, and the selection is now empty).
@ -3858,131 +3958,44 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
EXCEPT .... if we are doing a copy drag, then the selection hasn't been modified and
we can just iterate.
*/
if (drag_info.copy) {
++i;
} else {
if (selection->regions.empty()) {
break;
} else {
/*
XXX see above .. but we just froze the playlists.. we have to keep iterating, right?
*/
//i = selection->regions.by_layer().begin();
++i;
}
if (selection->regions.empty()) {
break;
} else {
i = selection->regions.by_layer().begin();
}
} else {
++i;
}
} else {
/* motion within a single track */
list<RegionView*> regions = selection->regions.by_layer();
for (list<RegionView*>::iterator i = regions.begin(); i != regions.end(); ++i) {
RegionView* rv = (*i);
boost::shared_ptr<Playlist> to_playlist = (*i)->region()->playlist();
RouteTimeAxisView* from_rtv = dynamic_cast<RouteTimeAxisView*> (&(rv->get_time_axis_view()));
if (!rv->region()->can_move()) {
continue;
}
if (regionview_x_movement) {
double ownspeed = 1.0;
if (from_rtv && from_rtv->get_diskstream()) {
ownspeed = from_rtv->get_diskstream()->speed();
}
/* base the new region position on the current position of the regionview.*/
double ix1, ix2, iy1, iy2;
rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
rv->get_canvas_group()->i2w (ix1, iy1);
where = (nframes_t) (unit_to_frame (ix1) * ownspeed);
} else {
where = rv->region()->position();
}
if (! to_playlist->frozen()) {
sigc::connection c = from_rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_and_select_new_region_view));
used_connections.push_back (c);
/* add the undo */
session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0));
used_playlists.push_back(to_playlist);
to_playlist->freeze();
}
if (drag_info.copy) {
boost::shared_ptr<Region> newregion;
boost::shared_ptr<Region> ar;
boost::shared_ptr<Region> mr;
if ((ar = boost::dynamic_pointer_cast<AudioRegion>(rv->region())) != 0) {
newregion = RegionFactory::create (ar);
} else if ((mr = boost::dynamic_pointer_cast<MidiRegion>(rv->region())) != 0) {
newregion = RegionFactory::create (mr);
}
/* add it */
latest_regionviews.clear ();
sigc::connection c = rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
to_playlist->add_region (newregion, (nframes_t) (where * rtv->get_diskstream()->speed()));
c.disconnect ();
if (!latest_regionviews.empty()) {
// XXX why just the first one ? we only expect one
rtv->reveal_dependent_views (*latest_regionviews.front());
selection->add (latest_regionviews);
}
} else {
/* just change the model */
rv->region()->set_position (where, (void*) this);
preserve_selection = true;
}
if (drag_info.copy) {
copies.push_back (rv);
}
}
if (! preserve_selection) {
//selection->clear_regions();
}
while (used_playlists.size() > 0) {
list <boost::shared_ptr<Playlist > >::iterator i = used_playlists.begin();
(*i)->thaw();
if (used_connections.size()) {
sigc::connection c = used_connections.front();
c.disconnect();
used_connections.pop_front();
}
/* add the redo */
session->add_command (new MementoCommand<Playlist>(*(*i), 0, &(*i)->get_state()));
used_playlists.pop_front();
}
out:
if (new_selection.empty()) {
if (drag_info.copy) {
/* the region(view)s that are selected and being dragged around
are copies and do not belong to any track. remove them
from the selection right here.
*/
selection->clear_regions();
}
} else {
/* this will clear any existing selection that would have been
cleared in the other clause above
*/
selection->set (new_selection);
}
out:
if (!nocommit) {
for (set<boost::shared_ptr<Playlist> >::iterator p = modified_playlists.begin(); p != modified_playlists.end(); ++p) {
session->add_command (new MementoCommand<Playlist>(*(*p), 0, &(*p)->get_state()));
}
commit_reversible_command ();
}
@ -3990,7 +4003,6 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
delete *x;
}
}
void
Editor::create_region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
@ -4008,7 +4020,7 @@ Editor::create_region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent*
void
Editor::create_region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*> (drag_info.last_trackview);
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*> (drag_info.dest_trackview);
if (!mtv)
return;
@ -4298,7 +4310,8 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event)
start_grab (event);
drag_info.last_trackview = clicked_axisview;
drag_info.source_trackview = clicked_routeview;
drag_info.dest_trackview = drag_info.source_trackview;
drag_info.last_frame_position = latest_regionviews.front()->region()->position();
drag_info.pointer_frame_offset = drag_info.grab_frame - drag_info.last_frame_position;
@ -4484,7 +4497,7 @@ Editor::drag_selection (ArdourCanvas::Item* item, GdkEvent* event)
}
if (event->button.x >= horizontal_adjustment.get_value() + canvas_width) {
start_canvas_autoscroll (1);
start_canvas_autoscroll (1, 0);
}
if (start != end) {
@ -5060,7 +5073,7 @@ Editor::drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
}
if (event->button.x >= horizontal_adjustment.get_value() + canvas_width) {
start_canvas_autoscroll (1);
start_canvas_autoscroll (1, 0);
}
if (start != end) {

View file

@ -2805,6 +2805,7 @@ Editor::separate_region_from_selection ()
to allow discontiguous operation, since get_edit_op_range() currently
returns a single range.
*/
if (mouse_mode == MouseRange && !selection->time.empty()) {
separate_regions_between (selection->time);
@ -5707,4 +5708,118 @@ Editor::set_waveform_scale (WaveformScale ws)
}
}
}
void
Editor::do_insert_time ()
{
if (selection->tracks.empty()) {
return;
}
nframes64_t pos = get_preferred_edit_position ();
ArdourDialog d (*this, _("Insert Time"));
VButtonBox button_box;
VBox option_box;
RadioButtonGroup group;
RadioButton leave_button (group, _("Stay in position"));
RadioButton move_button (group, _("Move"));
RadioButton split_button (group, _("Split & Later Section Moves"));
Label intersect_option_label (_("Intersected regions should:"));
ToggleButton glue_button (_("Move Glued Regions"));
AudioClock clock ("insertTimeClock", true, X_("InsertTimeClock"), true, true, true);
HBox clock_box;
clock.set (0);
clock.set_session (session);
clock.set_bbt_reference (pos);
clock_box.pack_start (clock, false, true);
option_box.set_spacing (6);
option_box.pack_start (intersect_option_label, false, false);
option_box.pack_start (button_box, false, false);
option_box.pack_start (glue_button, false, false);
button_box.pack_start (leave_button, false, false);
button_box.pack_start (move_button, false, false);
button_box.pack_start (split_button, false, false);
d.get_vbox()->set_border_width (12);
d.get_vbox()->pack_start (clock_box, false, false);
d.get_vbox()->pack_start (option_box, false, false);
leave_button.show ();
move_button.show ();
split_button.show ();
intersect_option_label.show ();
option_box.show ();
button_box.show ();
glue_button.show ();
clock.show_all();
clock_box.show ();
d.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
d.add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
d.show ();
int response = d.run ();
if (response != RESPONSE_OK) {
return;
}
nframes_t distance = clock.current_duration (pos);
if (distance == 0) {
return;
}
InsertTimeOption opt;
if (leave_button.get_active()) {
opt = LeaveIntersected;
} else if (move_button.get_active()) {
opt = MoveIntersected;
} else {
opt = SplitIntersected;
}
insert_time (pos, distance, opt, glue_button.get_active());
}
void
Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt, bool ignore_music_glue)
{
bool commit = false;
if (Config->get_edit_mode() == Lock) {
return;
}
begin_reversible_command (_("insert time"));
for (TrackSelection::iterator x = selection->tracks.begin(); x != selection->tracks.end(); ++x) {
boost::shared_ptr<Playlist> pl = (*x)->playlist();
if (!pl) {
continue;
}
XMLNode &before = pl->get_state();
if (opt == SplitIntersected) {
pl->split (pos);
}
pl->shift (pos, frames, (opt == MoveIntersected), ignore_music_glue);
XMLNode &after = pl->get_state();
session->add_command (new MementoCommand<Playlist> (*pl, &before, &after));
commit = true;
}
if (commit) {
commit_reversible_command ();
}
}

View file

@ -290,11 +290,11 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev)
if (autoscroll_timeout_tag < 0) {
if (frame > rightmost_frame) {
if (rightmost_frame < max_frames) {
start_canvas_autoscroll (1);
start_canvas_autoscroll (1, 0);
}
} else if (frame < leftmost_frame) {
if (leftmost_frame > 0) {
start_canvas_autoscroll (-1);
start_canvas_autoscroll (-1, 0);
}
}
} else {
@ -690,7 +690,6 @@ Editor::update_ruler_visibility ()
range_marker_group->move (0.0, tbpos - old_unit_pos);
}
range_marker_group->show();
cerr << "range_marker_group now at " << range_marker_group->property_y() << endl;
tbpos += timebar_height;
visible_timebars++;
} else {

View file

@ -202,21 +202,7 @@ Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no
break;
case Selection::Set:
if (selection->selected (&view) && selection->tracks.size() > 1) {
/* reset track selection if there is only 1 other track
selected OR if no_remove is not set (its there to
prevent deselecting a multi-track selection
when clicking on an already selected track
for some reason.
*/
if (selection->tracks.empty()) {
selection->set (&view);
} else if (selection->tracks.size() == 1 || !no_remove) {
selection->set (&view);
}
}
selection->set (&view);
break;
case Selection::Extend:

View file

@ -77,8 +77,7 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
// 0.781787 is the value needed for gain to be set to 0.
gain_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1),
gain_automation_style_button (""),
gain_automation_state_button (""),
regular_meter_width(5)
gain_automation_state_button ("")
{
if (slider == 0) {
@ -95,6 +94,8 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
*_io->gain_control().get(),
false));
level_meter = new LevelMeter(_io, _session);
gain_slider->signal_button_press_event().connect (mem_fun(*this, &GainMeter::start_gain_touch));
gain_slider->signal_button_release_event().connect (mem_fun(*this, &GainMeter::end_gain_touch));
gain_slider->set_name ("GainFader");
@ -122,8 +123,6 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
meter_metric_area.set_name ("MeterMetricsStrip");
set_size_request_to_display_given_text (meter_metric_area, "-50", 0, 0);
meter_packer.set_spacing (2);
gain_automation_style_button.set_name ("MixerAutomationModeButton");
gain_automation_state_button.set_name ("MixerAutomationPlaybackButton");
@ -161,7 +160,7 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
*/
gain_display_box.pack_end (peak_display, true, true);
hbox.pack_end (meter_packer, true, true);
hbox.pack_end (*level_meter, true, true);
using namespace Menu_Helpers;
@ -206,8 +205,6 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
peak_display.signal_button_release_event().connect (mem_fun(*this, &GainMeter::peak_button_release), false);
gain_display.signal_key_press_event().connect (mem_fun(*this, &GainMeter::gain_key_press), false);
Config->ParameterChanged.connect (mem_fun (*this, &GainMeter::parameter_changed));
gain_changed ();
show_gain ();
@ -228,7 +225,7 @@ void
GainMeter::set_width (Width w, int len)
{
_width = w;
setup_meters (len);
level_meter->setup_meters (len);
}
Glib::RefPtr<Gdk::Pixmap>
@ -330,84 +327,21 @@ GainMeter::~GainMeter ()
delete meter_menu;
}
for (vector<MeterInfo>::iterator i = meters.begin(); i != meters.end(); i++) {
if ((*i).meter) {
delete (*i).meter;
}
if (level_meter) {
delete level_meter;
}
}
void
GainMeter::update_meters ()
{
vector<MeterInfo>::iterator i;
uint32_t n;
float peak, mpeak;
char buf[32];
for (n = 0, i = meters.begin(); i != meters.end(); ++i, ++n) {
if ((*i).packed) {
peak = _io->peak_meter().peak_power (n);
(*i).meter->set (log_meter (peak));
mpeak = _io->peak_meter().max_peak_power(n);
if (mpeak > max_peak) {
max_peak = mpeak;
/* set peak display */
if (max_peak <= -200.0f) {
peak_display.set_label (_("-inf"));
} else {
snprintf (buf, sizeof(buf), "%.1f", max_peak);
peak_display.set_label (buf);
}
if (max_peak >= 0.0f) {
peak_display.set_name ("MixerStripPeakDisplayPeak");
}
}
}
}
}
void
GainMeter::parameter_changed(const char* parameter_name)
{
#define PARAM_IS(x) (!strcmp (parameter_name, (x)))
ENSURE_GUI_THREAD (bind (mem_fun(*this, &GainMeter::parameter_changed), parameter_name));
if (PARAM_IS ("meter-hold")) {
vector<MeterInfo>::iterator i;
uint32_t n;
for (n = 0, i = meters.begin(); i != meters.end(); ++i, ++n) {
(*i).meter->set_hold_count ((uint32_t) floor(Config->get_meter_hold()));
}
}
#undef PARAM_IS
}
void
GainMeter::hide_all_meters ()
{
bool remove_metric_area = false;
for (vector<MeterInfo>::iterator i = meters.begin(); i != meters.end(); ++i) {
if ((*i).packed) {
remove_metric_area = true;
meter_packer.remove (*((*i).meter));
(*i).packed = false;
}
}
level_meter->hide_meters();
if (remove_metric_area) {
if (meter_metric_area.get_parent()) {
meter_packer.remove (meter_metric_area);
level_meter->remove (meter_metric_area);
}
}
}
@ -415,76 +349,12 @@ GainMeter::hide_all_meters ()
void
GainMeter::setup_meters (int len)
{
uint32_t nmeters = _io->n_outputs().n_total();
guint16 width;
hide_all_meters ();
Route* r;
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
switch (r->meter_point()) {
case MeterInput:
nmeters = r->n_inputs().n_total();
break;
case MeterPreFader:
nmeters = r->pre_fader_streams().n_total();
break;
case MeterPostFader:
nmeters = r->n_outputs().n_total();
break;
}
} else {
nmeters = _io->n_outputs().n_total();
if (!meter_metric_area.get_parent()) {
level_meter->pack_end (meter_metric_area, false, false);
meter_metric_area.show_all ();
}
if (nmeters == 0) {
return;
}
if (nmeters <= 2) {
width = regular_meter_width;
} else {
width = thin_meter_width;
}
while (meters.size() < nmeters) {
meters.push_back (MeterInfo());
}
/* pack them backwards */
meter_packer.pack_end (meter_metric_area, false, false);
meter_metric_area.show_all ();
int b = ARDOUR_UI::config()->canvasvar_MeterColorBase.get();
int m = ARDOUR_UI::config()->canvasvar_MeterColorMid.get();
int t = ARDOUR_UI::config()->canvasvar_MeterColorTop.get();
int c = ARDOUR_UI::config()->canvasvar_MeterColorClip.get();
//cerr << "GainMeter::setup_meters() called color_changed = " << color_changed << " colors: " << hex << b << " " << m << " " << t << " " << c << endl;//DEBUG
for (int32_t n = nmeters-1; nmeters && n >= 0 ; --n) {
if (meters[n].width != width || meters[n].length != len || color_changed) {
delete meters[n].meter;
meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, FastMeter::Vertical, len, b, m, t, c);
//cerr << "GainMeter::setup_meters() w:l = " << width << ":" << len << endl;//DEBUG
meters[n].width = width;
meters[n].length = len;
meters[n].meter->add_events (Gdk::BUTTON_RELEASE_MASK);
meters[n].meter->signal_button_release_event().connect (bind (mem_fun(*this, &GainMeter::meter_button_release), n));
}
meter_packer.pack_end (*meters[n].meter, false, false);
meters[n].meter->show_all ();
meters[n].packed = true;
}
color_changed = false;
}
level_meter->setup_meters(len, 5);
}
int
GainMeter::get_gm_width ()
@ -531,6 +401,7 @@ GainMeter::reset_peak_display ()
r->peak_meter().reset_max();
}
level_meter->clear_meters();
max_peak = -INFINITY;
peak_display.set_label (_("-Inf"));
peak_display.set_name ("MixerStripPeakDisplay");
@ -547,25 +418,6 @@ GainMeter::reset_group_peak_display (RouteGroup* group)
}
}
gint
GainMeter::meter_button_release (GdkEventButton* ev, uint32_t which)
{
switch (ev->button) {
case 1:
meters[which].meter->clear();
max_peak = minus_infinity();
peak_display.set_label (_("-inf"));
peak_display.set_name ("MixerStripPeakDisplay");
break;
case 3:
// popup_meter_menu (ev);
break;
};
return TRUE;
}
void
GainMeter::popup_meter_menu (GdkEventButton *ev)
{
@ -973,10 +825,24 @@ GainMeter::gain_automation_state_changed ()
}
}
void GainMeter::clear_meters ()
void
GainMeter::update_meters()
{
for (vector<MeterInfo>::iterator i = meters.begin(); i < meters.end(); i++) {
(*i).meter->clear();
char buf[32];
float mpeak = level_meter->update_meters();
if (mpeak > max_peak) {
max_peak = mpeak;
if (mpeak <= -200.0f) {
peak_display.set_label (_("-inf"));
} else {
snprintf (buf, sizeof(buf), "%.1f", mpeak);
peak_display.set_label (buf);
}
if (mpeak >= 0.0f) {
peak_display.set_name ("MixerStripPeakDisplayPeak");
}
}
}

View file

@ -39,6 +39,7 @@
#include <gtkmm2ext/slider_controller.h>
#include "enums.h"
#include "level_meter.h"
namespace ARDOUR {
class IO;
@ -63,7 +64,6 @@ class GainMeter : public Gtk::VBox
void update_gain_sensitive ();
void update_meters ();
void update_meters_falloff ();
void effective_gain_display ();
@ -75,7 +75,11 @@ class GainMeter : public Gtk::VBox
void set_meter_strip_name (const char * name);
void set_fader_name (const char * name);
void clear_meters ();
/* should probably switch to using the shared_ptr that underlies
all this stuff
*/
PBD::Controllable* get_controllable() { return _io->gain_control().get(); }
private:
@ -93,6 +97,7 @@ class GainMeter : public Gtk::VBox
Gtk::HBox gain_display_box;
Gtk::HBox fader_box;
Gtk::DrawingArea meter_metric_area;
LevelMeter *level_meter;
sigc::connection gain_watching;
@ -129,28 +134,10 @@ class GainMeter : public Gtk::VBox
void gain_activated ();
bool gain_focused (GdkEventFocus*);
struct MeterInfo {
Gtkmm2ext::FastMeter *meter;
gint16 width;
int length;
bool packed;
MeterInfo() {
meter = 0;
width = 0;
length = 0;
packed = false;
}
};
guint16 regular_meter_width;
static const guint16 thin_meter_width = 2;
vector<MeterInfo> meters;
float max_peak;
Gtk::VBox* fader_vbox;
Gtk::HBox hbox;
Gtk::HBox meter_packer;
void gain_adjusted ();
void gain_changed ();
@ -161,7 +148,6 @@ class GainMeter : public Gtk::VBox
void hide_all_meters ();
gint meter_button_press (GdkEventButton*, uint32_t);
gint meter_button_release (GdkEventButton*, uint32_t);
bool peak_button_release (GdkEventButton*);
bool gain_key_press (GdkEventKey*);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -45,6 +45,13 @@ IOSelector::IOSelector (ARDOUR::Session& session, boost::shared_ptr<ARDOUR::IO>
} else {
_io->output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
}
#ifdef FIXME
/* these got lost in a merge from 2.0 */
set_button_sensitivity ();
io->name_changed.connect (mem_fun(*this, &IOSelector::name_changed));
#endif
}
@ -88,7 +95,6 @@ IOSelector::get_state (int r, std::string const & p) const
}
int k = 0;
for (vector<string>::iterator i = connections.begin(); i != connections.end(); ++i) {
if ((*i)== p) {

View file

@ -67,6 +67,7 @@ LevelMeter::LevelMeter (boost::shared_ptr<IO> io, Session& s)
Config->ParameterChanged.connect (mem_fun (*this, &LevelMeter::parameter_changed));
UI::instance()->theme_changed.connect (mem_fun(*this, &LevelMeter::on_theme_changed));
ColorsChanged.connect (mem_fun (*this, &LevelMeter::color_handler));
max_peak = minus_infinity();
}
void
@ -84,7 +85,7 @@ LevelMeter::~LevelMeter ()
}
}
void
float
LevelMeter::update_meters ()
{
vector<MeterInfo>::iterator i;
@ -96,8 +97,12 @@ LevelMeter::update_meters ()
peak = _io->peak_meter().peak_power (n);
(*i).meter->set (log_meter (peak));
mpeak = _io->peak_meter().max_peak_power(n);
if (mpeak > max_peak) {
max_peak = mpeak;
}
}
}
return max_peak;
}
void
@ -134,9 +139,10 @@ LevelMeter::hide_all_meters ()
}
void
LevelMeter::setup_meters (int len)
LevelMeter::setup_meters (int len, int initial_width)
{
uint32_t nmeters = _io->n_outputs().n_total();
regular_meter_width = initial_width;
guint16 width;
hide_all_meters ();
@ -191,6 +197,7 @@ LevelMeter::setup_meters (int len)
meters[n].width = width;
meters[n].length = len;
meters[n].meter->add_events (Gdk::BUTTON_RELEASE_MASK);
meters[n].meter->signal_button_release_event().connect (bind (mem_fun(*this, &LevelMeter::meter_button_release), n));
}
pack_end (*meters[n].meter, false, false);
@ -199,13 +206,24 @@ LevelMeter::setup_meters (int len)
}
show();
color_changed = false;
}
}
gint
LevelMeter::meter_button_release (GdkEventButton* ev, uint32_t which)
{
if (ev->button == 1) {
clear_meters();
}
return true;
}
void LevelMeter::clear_meters ()
{
for (vector<MeterInfo>::iterator i = meters.begin(); i < meters.end(); i++) {
(*i).meter->clear();
}
max_peak = minus_infinity();
}
void LevelMeter::hide_meters ()

View file

@ -61,11 +61,11 @@ class LevelMeter : public Gtk::HBox
void update_gain_sensitive ();
void update_meters ();
float update_meters ();
void update_meters_falloff ();
void clear_meters ();
void hide_meters ();
void setup_meters (int len=0);
void setup_meters (int len=0, int width=3);
private:
@ -89,13 +89,13 @@ class LevelMeter : public Gtk::HBox
}
};
static const guint16 regular_meter_width = 3;
guint16 regular_meter_width;
static const guint16 thin_meter_width = 2;
vector<MeterInfo> meters;
//Gtk::HBox meter_packer;
float max_peak;
void hide_all_meters ();
gint meter_button_release (GdkEventButton*, uint32_t);
void parameter_changed (const char*);

View file

@ -246,6 +246,8 @@ Mixer_UI::Mixer_UI ()
list_hpane.show();
track_display.show();
group_display.show();
auto_rebinding = FALSE;
}
Mixer_UI::~Mixer_UI ()
@ -732,8 +734,97 @@ Mixer_UI::redisplay_track_list ()
Route::SyncOrderKeys (); // EMIT SIGNAL
ignore_sync = false;
}
// Rebind all of the midi controls automatically
if (auto_rebinding)
auto_rebind_midi_controls ();
}
void
Mixer_UI::set_auto_rebinding( bool val )
{
if( val == TRUE )
{
auto_rebinding = TRUE;
Session::AutoBindingOff();
}
else
{
auto_rebinding = FALSE;
Session::AutoBindingOn();
}
}
void
Mixer_UI::toggle_auto_rebinding()
{
if (auto_rebinding)
{
set_auto_rebinding( FALSE );
}
else
{
set_auto_rebinding( TRUE );
}
auto_rebind_midi_controls();
}
void
Mixer_UI::auto_rebind_midi_controls ()
{
TreeModel::Children rows = track_model->children();
TreeModel::Children::iterator i;
int pos;
// Create bindings for all visible strips and remove those that are not visible
pos = 1; // 0 is reserved for the master strip
for (i = rows.begin(); i != rows.end(); ++i) {
MixerStrip* strip = (*i)[track_columns.strip];
if ( (*i)[track_columns.visible] == true ) { // add bindings for
// make the actual binding
//cout<<"Auto Binding: Visible Strip Found: "<<strip->name()<<endl;
int controlValue = pos;
if( strip->route()->is_master() ) {
controlValue = 0;
}
else {
pos++;
}
PBD::Controllable::CreateBinding ( strip->solo_button->get_controllable(), controlValue, 0);
PBD::Controllable::CreateBinding ( strip->mute_button->get_controllable(), controlValue, 1);
if( strip->is_audio_track() ) {
PBD::Controllable::CreateBinding ( strip->rec_enable_button->get_controllable(), controlValue, 2);
}
PBD::Controllable::CreateBinding ( strip->gpm.get_controllable(), controlValue, 3);
PBD::Controllable::CreateBinding ( strip->panners.get_controllable(), controlValue, 4);
}
else { // Remove any existing binding
PBD::Controllable::DeleteBinding ( strip->solo_button->get_controllable() );
PBD::Controllable::DeleteBinding ( strip->mute_button->get_controllable() );
if( strip->is_audio_track() ) {
PBD::Controllable::DeleteBinding ( strip->rec_enable_button->get_controllable() );
}
PBD::Controllable::DeleteBinding ( strip->gpm.get_controllable() );
PBD::Controllable::DeleteBinding ( strip->panners.get_controllable() ); // This only takes the first panner if there are multiples...
}
} // for
}
struct SignalOrderRouteSorter {
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
/* use of ">" forces the correct sort order */
@ -1089,6 +1180,7 @@ Mixer_UI::mix_group_row_change (const Gtk::TreeModel::Path& path,const Gtk::Tree
if (name != group->name()) {
group->set_name (name);
}
}
void

View file

@ -75,6 +75,8 @@ class Mixer_UI : public Gtk::Window
void hide_strip (MixerStrip *);
void ensure_float (Gtk::Window&);
void toggle_auto_rebinding ();
void set_auto_rebinding(bool);
RouteRedirectSelection& selection() { return _selection; }
@ -129,6 +131,9 @@ class Mixer_UI : public Gtk::Window
void unselect_all_audiobus_strips ();
void select_all_audiobus_strips ();
void auto_rebind_midi_controls ();
bool auto_rebinding;
void strip_select_op (bool audiotrack, bool select);
void select_strip_op (MixerStrip*, bool select);

View file

@ -57,6 +57,7 @@
(gtk_accel_path "<Actions>/Editor/redo" "<%PRIMARY%>r")
(gtk_accel_path "<Actions>/Transport/Record" "<%TERTIARY%>r")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-timefx" "t")
(gtk_accel_path "<Actions>/Editor/insert-time" "<%PRIMARY%>t")
(gtk_accel_path "<Actions>/Editor/select-all-between-cursors" "u")
(gtk_accel_path "<Actions>/Editor/insert-region" "i")
(gtk_accel_path "<Actions>/Editor/invert-selection" "<%TERTIARY%>i")

View file

@ -166,6 +166,12 @@ PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
show();
}
PBD::Controllable*
PannerUI::get_controllable()
{
return pan_bars[0]->get_controllable();
}
bool
PannerUI::panning_link_button_press (GdkEventButton* ev)
{

View file

@ -68,9 +68,11 @@ class PannerUI : public Gtk::HBox
void effective_pan_display ();
void set_meter_strip_name (string name);
PBD::Controllable* get_controllable();
private:
friend class MixerStrip;
boost::shared_ptr<ARDOUR::IO> _io;
ARDOUR::Session& _session;

View file

@ -66,6 +66,7 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
{
bool have_gui = false;
non_gtk_gui = false;
was_visible = false;
Label* label = manage (new Label());
label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
@ -159,7 +160,6 @@ PluginUIWindow::on_show ()
Window::on_show ();
if (parent) {
cerr << "plugin becomes transient for " << parent << endl;
// set_transient_for (*parent);
}
}
@ -221,9 +221,13 @@ PluginUIWindow::app_activated (bool yn)
cerr << "APP activated ? " << yn << endl;
if (_pluginui) {
if (yn) {
_pluginui->activate ();
present ();
if (was_visible) {
_pluginui->activate ();
present ();
was_visible = true;
}
} else {
was_visible = is_visible();
hide ();
_pluginui->deactivate ();
}

View file

@ -224,6 +224,8 @@ class PluginUIWindow : public Gtk::Window
Gtk::Window* parent;
Gtk::VBox vbox;
bool non_gtk_gui;
bool was_visible;
void app_activated (bool);
void plugin_going_away ();

File diff suppressed because it is too large Load diff

7894
gtk2_ardour/po/pl_PL.po Normal file

File diff suppressed because it is too large Load diff

View file

@ -6214,7 +6214,7 @@ msgstr "Använd FlushToZero"
#: gtk2_ardour/ardour_ui_ed.cc:433
msgid "Use DenormalsAreZero"
msgstr "Använda DenormalsAreZero"
msgstr "Använd DenormalsAreZero"
#: gtk2_ardour/ardour_ui_ed.cc:437
msgid "Use FlushToZero & DenormalsAreZero"
@ -6941,6 +6941,10 @@ msgstr "Sätt loop från region"
msgid "Set Punch From Edit Range"
msgstr "Sätt inslag från redigeringsomfång"
#: gtk2_ardour/editor_actions.cc:311
msgid "Set Punch From Region"
msgstr "Sätt inslag från region"
#: gtk2_ardour/editor_actions.cc:298
msgid "Play From Edit Point"
msgstr "Spela från redigeringspunkten"
@ -7098,3 +7102,343 @@ msgstr "EJ tonhöjdsändrat soloslagverk"
#: gtk2_ardour/editor_timefx.cc:73
msgid "Contents:"
msgstr "Innehåll"
#: gtk2_ardour/editor_actions.cc:359
msgid "Playhead to Mouse"
msgstr "Startmarkören till mus"
#: gtk2_ardour/editor_actions.cc:277
msgid "Playhead To Active Mark"
msgstr "Startmarkören till aktiv markör"
#: gtk2_ardour/editor_actions.cc:231
msgid "Nudge Playhead Forward"
msgstr "Knuffa startmarkören framåt"
#: gtk2_ardour/editor_actions.cc:233
msgid "Nudge Playhead Backward"
msgstr "Knuffa startmarkören bakåt"
#: gtk2_ardour/editor_actions.cc:475
msgid "Move Forward to Transient"
msgstr "Gå framåt till transient"
#: gtk2_ardour/editor_actions.cc:477
msgid "Move Backwards to Transient"
msgstr "Gå bakåt till transient"
#: gtk2_ardour/editor_actions.cc:235
msgid "Forward To Grid"
msgstr "Framåt till rutnät"
#: gtk2_ardour/editor_actions.cc:237
msgid "Backward To Grid"
msgstr "Bakåt till rutnät"
#: gtk2_ardour/editor_actions.cc:66 gtk2_ardour/editor.cc:151
#: gtk2_ardour/editor.cc:3446
msgid "Active Mark"
msgstr "Aktiv markör"
#: gtk2_ardour/editor_actions.cc:137
msgid "to Next Region Boundary"
msgstr "till nästa regionsgränsen"
#: gtk2_ardour/editor_actions.cc:139
msgid "to Previous Region Boundary"
msgstr "till förra regionsgränsen"
#: gtk2_ardour/editor_actions.cc:279
msgid "Active Mark To Playhead"
msgstr "Aktiv markör till startmarkören"
#: gtk2_ardour/editor_actions.cc:361
msgid "Active Marker to Mouse"
msgstr "Aktiv markör till musen"
#: gtk2_ardour/editor_actions.cc:61 gtk2_ardour/editor_actions.cc:613
msgid "Markers"
msgstr "Markörer"
#: gtk2_ardour/ardour_ui_ed.cc:333
msgid "Punch In/Out"
msgstr "Inslag/utslag"
#: gtk2_ardour/editor_actions.cc:177
msgid "Select All Overlapping Edit Range"
msgstr "Välj allt som överlappar redigeringsomfånget"
#: gtk2_ardour/editor_actions.cc:179
msgid "Select All Inside Edit Range"
msgstr "Välj allt inom redigeringsomfånget"
#: gtk2_ardour/editor_actions.cc:182
msgid "Select Edit Range"
msgstr "Välj redigeringsomfång"
#: gtk2_ardour/editor_actions.cc:444
msgid "Separate Using Punch Range"
msgstr "Separera utifrån in-/utslagsomfånget"
#: gtk2_ardour/editor_actions.cc:447
msgid "Separate Using Loop Range"
msgstr "Separera utifrån loopomfånget"
#: gtk2_ardour/editor_actions.cc:469
msgid "Split Regions At Percussion Onsets"
msgstr "Dela regioner vid perkussiva anslag"
#: gtk2_ardour/editor_actions.cc:282
msgid "Trim Start At Edit Point"
msgstr "Beskär början vid redigeringspunkten"
#: gtk2_ardour/editor_actions.cc:285
msgid "Trim End At Edit Point"
msgstr "Beskär slutet vid redigeringspunkten"
#: gtk2_ardour/ardour_ui_ed.cc:95
msgid "Misc. Shortcuts"
msgstr "Diverse kortkommandon"
#: gtk2_ardour/editor_actions.cc:385
msgid "Boost Region Gain"
msgstr "Öka regionens volym"
#: gtk2_ardour/editor_actions.cc:388
msgid "Cut Region Gain"
msgstr "Sänk regionens volym"
#: gtk2_ardour/editor_actions.cc:99
msgid "Break drag"
msgstr "Avbryt dragning"
#: gtk2_ardour/editor_actions.cc:400
msgid "Raise Region"
msgstr "Höj regionen"
#: gtk2_ardour/editor_actions.cc:403
msgid "Lower Region"
msgstr "Sänk regionen"
#: gtk2_ardour/editor_actions.cc:415
msgid "Move To Original Position"
msgstr "Flytta till ursprunglig position"
#: gtk2_ardour/editor_actions.cc:409
msgid "Lock Region"
msgstr "Lås region"
#: gtk2_ardour/editor_actions.cc:397
msgid "Remove Region Sync"
msgstr "Ta bort regionsynk.-punkt"
#: gtk2_ardour/editor_actions.cc:505 gtk2_ardour/editor_ops.cc:5651
msgid "Insert Time"
msgstr "Infoga tid"
#: gtk2_ardour/editor_actions.cc:93
msgid "Waveforms"
msgstr "Vågformer"
#: gtk2_ardour/editor_actions.cc:509
msgid "Toggle Active"
msgstr "Växla aktiv"
#: gtk2_ardour/editor_actions.cc:547
msgid "Zoom Focus Mouse"
msgstr "Zoomfokus: mus"
#: gtk2_ardour/editor_actions.cc:582
msgid "Next Snap Mode"
msgstr "Nästa fästläge"
#: gtk2_ardour/editor_actions.cc:583
msgid "Next Snap Choice"
msgstr "Nästa fästlägealternativ"
#: gtk2_ardour/editor_actions.cc:70
msgid "Primary Clock"
msgstr "Primär klocka"
#: gtk2_ardour/editor_actions.cc:77
msgid "Secondary Clock"
msgstr "Sekundär klocka"
#: gtk2_ardour/ardour_ui_ed.cc:309 gtk2_ardour/ardour_ui_ed.cc:318
#: gtk2_ardour/editor_actions.cc:616
msgid "Bars & Beats"
msgstr "Takter & slag"
#: gtk2_ardour/ardour_ui_ed.cc:311 gtk2_ardour/ardour_ui_ed.cc:320
msgid "Minutes & Seconds"
msgstr "Minuter & sekunder"
#: gtk2_ardour/editor_actions.cc:75
msgid "Rulers"
msgstr "Tidslinjevisning"
#: gtk2_ardour/editor_actions.cc:619
msgid "Min:Sec"
msgstr "Min:sek"
#: gtk2_ardour/editor_actions.cc:615
msgid "Loop/Punch"
msgstr "Loop-/inslagsmarkörer"
#: gtk2_ardour/editor_actions.cc:76
msgid "Scroll"
msgstr "Skrollning"
#: gtk2_ardour/rhythm_ferret.cc:40
msgid "Analysis"
msgstr "Analys"
#: gtk2_ardour/rhythm_ferret.cc:30
msgid "Percussive Onset"
msgstr "Perkussivt anslag"
#: gtk2_ardour/rhythm_ferret.cc:31
msgid "Note Onset"
msgstr "Notanslag"
#: gtk2_ardour/rhythm_ferret.cc:48
msgid "Threshold"
msgstr "Tröskel"
#: gtk2_ardour/rhythm_ferret.cc:51
msgid "Sensitivity"
msgstr "Känslighet"
#: gtk2_ardour/rhythm_ferret.cc:52
msgid "Analyze"
msgstr "Analysera"
#: gtk2_ardour/rhythm_ferret.cc:55
msgid "Trigger gap (msecs)"
msgstr "Utlösningsmellanrum (msek)"
#: gtk2_ardour/rhythm_ferret.cc:43
msgid "Set Tempo Map"
msgstr "Sätt tempokarta"
#: gtk2_ardour/rhythm_ferret.cc:44
msgid "Conform Region"
msgstr "Anpassa region"
#: gtk2_ardour/rhythm_ferret.cc:39
msgid "Selection"
msgstr "Markering"
#: gtk2_ardour/editor_actions.cc:463
msgid "Set Tempo from Region=Bar"
msgstr "Sätt tempo från region=takt"
#: gtk2_ardour/editor_actions.cc:466
msgid "Set Tempo from Edit Range=Bar"
msgstr "Sätt tempo från redigeringsomfång=takt"
#: gtk2_ardour/ardour_ui_ed.cc:548
msgid "JACK does monitoring"
msgstr "JACK sköter medhörning"
#: gtk2_ardour/ardour_ui_ed.cc:552
msgid "Ardour does monitoring"
msgstr "Ardour sköter medhörning"
#: gtk2_ardour/ardour_ui_ed.cc:553
msgid "Audio Hardware does monitoring"
msgstr "Ljudhårdvaran sköter medhörning"
#: gtk2_ardour/ardour_ui_ed.cc:438
msgid "Tape Machine mode"
msgstr "Bandmaskinläge"
#: gtk2_ardour/editor_actions.cc:64
msgid "Misc Options"
msgstr "Diverse inställningar"
#: gtk2_ardour/ardour_ui_ed.cc:446
msgid "Create marker at xrun location"
msgstr "Skapa markör vid xrun-förekomst"
#: gtk2_ardour/ardour_ui_ed.cc:455
msgid "Rubberbanding Snaps to Grid"
msgstr "Gummibandning fäster mot rutnätet"
#: gtk2_ardour/ardour_ui_ed.cc:456
msgid "Auto-analyse new audio"
msgstr "Autoanalysera nya ljud"
#: gtk2_ardour/editor_actions.cc:689
msgid "Import to Region List"
msgstr "Importera till regionslistan"
#: gtk2_ardour/mixer_strip.cc:984
msgid "Protect against denormals"
msgstr "Skydda mot denormals"
#: gtk2_ardour/option_editor.cc:1242
msgid "Keyboard layout"
msgstr "Tangentbordslayout"
#: gtk2_ardour/option_editor.cc:275
msgid "Font Scaling"
msgstr "Typsnittsskalning"
#: gtk2_ardour/option_editor.cc:97
msgid "Add new MIDI port"
msgstr "Lägg till ny MIDI-port"
#: gtk2_ardour/editor.cc:1779 gtk2_ardour/editor.cc:1948
msgid "Spectral Analysis"
msgstr "Spektralanalys"
#: gtk2_ardour/editor.cc:1793
msgid "Glue to Bars&Beats"
msgstr "Klistra mot takt&slag"
#: gtk2_ardour/analysis_window.cc:46
msgid "Signal source"
msgstr "Signalkälla"
#: gtk2_ardour/analysis_window.cc:47
msgid "Selected ranges"
msgstr "Valda omfång"
#: gtk2_ardour/analysis_window.cc:48
msgid "Selected regions"
msgstr "Valda regioner"
#: gtk2_ardour/analysis_window.cc:50
msgid "Display model"
msgstr "Visningsmodell"
#: gtk2_ardour/analysis_window.cc:51
msgid "Composite graphs for each track"
msgstr ""
#: gtk2_ardour/analysis_window.cc:52
msgid "Composite graph of all tracks"
msgstr "Sammansatt graf för alla spår"
#: gtk2_ardour/analysis_window.cc:54
msgid "Show frequency power range"
msgstr "Visa frekvenskraftsomfång"
#: gtk2_ardour/analysis_window.cc:55
msgid "Normalize values"
msgstr "Normalisera värden"
#: gtk2_ardour/analysis_window.cc:59 gtk2_ardour/analysis_window.cc:60
msgid "FFT analysis window"
msgstr "FFT-analysfönster"
#: gtk2_ardour/analysis_window.cc:135
msgid "Re-analyze data"
msgstr "Återanalysera data"

View file

@ -94,6 +94,23 @@ RegionView::RegionView (const RegionView& other)
_pixel_width = other._pixel_width;
}
RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other_region)
: TimeAxisViewItem (other)
{
/* this is a pseudo-copy constructor used when dragging regions
around on the canvas.
*/
/* derived concrete type will call init () */
_region = other_region;
editor = other.editor;
current_visible_sync_position = other.current_visible_sync_position;
valid = false;
_pixel_width = other._pixel_width;
_height = other._height;
}
RegionView::RegionView (ArdourCanvas::Group* parent,
TimeAxisView& tv,
boost::shared_ptr<ARDOUR::Region> r,

View file

@ -48,6 +48,7 @@ class RegionView : public TimeAxisViewItem
Gdk::Color& basic_color);
RegionView (const RegionView& other);
RegionView (const RegionView& other, boost::shared_ptr<ARDOUR::Region> other_region);
~RegionView ();
@ -135,6 +136,7 @@ class RegionView : public TimeAxisViewItem
bool valid; ///< see StreamView::redisplay_diskstream()
bool _enable_display; ///< see StreamView::redisplay_diskstream()
double _pixel_width;
double _height;
bool in_destructor;
bool wait_for_data;

View file

@ -467,7 +467,8 @@ RouteTimeAxisView::playlist_click ()
playlist_action_menu->set_name ("ArdourContextMenu");
build_playlist_menu (playlist_action_menu);
editor.set_selected_track (*this, Selection::Add);
conditionally_add_to_selection ();
playlist_action_menu->popup (1, gtk_get_current_event_time());
}
@ -480,7 +481,7 @@ RouteTimeAxisView::automation_click ()
*/
build_display_menu ();
}
editor.set_selected_track (*this, Selection::Add);
conditionally_add_to_selection ();
automation_action_menu->popup (1, gtk_get_current_event_time());
}
@ -854,6 +855,7 @@ RouteTimeAxisView::set_height (TrackHeight h)
show_name_entry ();
hide_name_label ();
gain_slider->show();
mute_button->show();
solo_button->show();
if (rec_enable_button)
@ -875,6 +877,7 @@ RouteTimeAxisView::set_height (TrackHeight h)
show_name_entry ();
hide_name_label ();
gain_slider->hide();
mute_button->show();
solo_button->show();
if (rec_enable_button)
@ -895,6 +898,7 @@ RouteTimeAxisView::set_height (TrackHeight h)
hide_name_entry ();
show_name_label ();
gain_slider->hide();
mute_button->hide();
solo_button->hide();
if (rec_enable_button)

View file

@ -135,6 +135,10 @@ RouteUI::~RouteUI()
bool
RouteUI::mute_press(GdkEventButton* ev)
{
if (ev->type == GDK_2BUTTON_PRESS) {
return true;
}
if (!ignore_toggle) {
if (Keyboard::is_context_menu_event (ev)) {
@ -212,6 +216,12 @@ RouteUI::mute_release(GdkEventButton* ev)
bool
RouteUI::solo_press(GdkEventButton* ev)
{
/* ignore double clicks */
if (ev->type == GDK_2BUTTON_PRESS) {
return true;
}
if (!ignore_toggle) {
if (Keyboard::is_context_menu_event (ev)) {
@ -281,7 +291,6 @@ RouteUI::solo_press(GdkEventButton* ev)
} else {
/* click: solo this route */
reversibly_apply_route_boolean ("solo change", &Route::set_solo, !_route->soloed(), this);
}
}
@ -310,6 +319,10 @@ RouteUI::solo_release(GdkEventButton* ev)
bool
RouteUI::rec_enable_press(GdkEventButton* ev)
{
if (ev->type == GDK_2BUTTON_PRESS) {
return true;
}
if (!_session.engine().connected()) {
MessageDialog msg (_("Not connected to JACK - cannot engage record"));
msg.run ();
@ -378,7 +391,7 @@ RouteUI::update_solo_display ()
ignore_toggle = true;
solo_button->set_active(x);
ignore_toggle = false;
}
}
if (_route->solo_safe()) {
solo_button->set_visual_state (2);

View file

@ -0,0 +1,502 @@
/* sfdb_freesound_mootcher.cpp **********************************************************************
Adapted for Ardour by Ben Loftis, March 2008
Mootcher 23-8-2005
Mootcher Online Access to thefreesoundproject website
http://freesound.iua.upf.edu/
GPL 2005 Jorn Lemon
mail for questions/remarks: mootcher@twistedlemon.nl
or go to the freesound website forum
-----------------------------------------------------------------
Includes:
curl.h (version 7.14.0)
Librarys:
libcurl.lib
-----------------------------------------------------------------
Licence GPL:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*************************************************************************************/
#include "sfdb_freesound_mootcher.h"
#include <pbd/xml++.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <ardour/audio_library.h>
#define TRUE 1
//------------------------------------------------------------------------
Mootcher:: Mootcher(const char *saveLocation)
: curl( NULL )
, connection( 0 )
{
changeWorkingDir(saveLocation);
};
//------------------------------------------------------------------------
Mootcher:: ~Mootcher()
{
remove( "cookiejar.txt" );
}
//------------------------------------------------------------------------
const char* Mootcher::changeWorkingDir(const char *saveLocation)
{
basePath = saveLocation;
#ifdef __WIN32__
std::string replace = "/";
int pos = (int)basePath.find("\\");
while( pos != std::string::npos ){
basePath.replace(pos, 1, replace);
pos = (int)basePath.find("\\");
}
#endif
//
int pos2 = basePath.find_last_of("/");
if(basePath.length() != (pos2+1)) basePath += "/";
// create Freesound directory and sound dir
std::string sndLocation = basePath;
mkdir(sndLocation.c_str(), 0777);
sndLocation += "snd";
mkdir(sndLocation.c_str(), 0777);
return basePath.c_str();
}
//------------------------------------------------------------------------
size_t Mootcher::WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
{
register int realsize = (int)(size * nmemb);
struct MemoryStruct *mem = (struct MemoryStruct *)data;
// There might be a realloc() out there that doesn't like
// reallocing NULL pointers, so we take care of it here
if(mem->memory) mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
else mem->memory = (char *)malloc(mem->size + realsize + 1);
if (mem->memory) {
memcpy(&(mem->memory[mem->size]), ptr, realsize);
mem->size += realsize;
mem->memory[mem->size] = 0;
}
return realsize;
}
//------------------------------------------------------------------------
void Mootcher::toLog(std::string input)
{
printf("%s\n", input.c_str());// for debugging
}
//------------------------------------------------------------------------
void Mootcher::setcUrlOptions()
{
// basic init for curl
curl_global_init(CURL_GLOBAL_ALL);
// some servers don't like requests that are made without a user-agent field, so we provide one
curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0");
// setup curl error buffer
CURLcode res = curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);
// always use the cookie with session id which is received at the login
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookiejar.txt");
// Allow redirection
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
}
//------------------------------------------------------------------------
int Mootcher::doLogin(std::string login, std::string password)
{
if(connection==1)
return 1;
struct MemoryStruct xml_page;
xml_page.memory = NULL;
xml_page.size = 0;
// create the post message from the login and password
std::string postMessage;
postMessage += "username=";
postMessage += curl_escape(login.c_str(), 0);
postMessage += "&password=";
postMessage += curl_escape(password.c_str(), 0);
postMessage += "&login=";
postMessage += curl_escape("1", 0);
postMessage += "&redirect=";
postMessage += curl_escape("../tests/login.php", 0);
// Do the setup for libcurl
curl = curl_easy_init();
if(curl)
{
setcUrlOptions();
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&xml_page);
// save the sessoin id that is given back by the server in a cookie
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookiejar.txt");
// use POST for login variables
curl_easy_setopt(curl, CURLOPT_POST, TRUE);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postMessage.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, -1);
// the url to get
std::string login_url = "http://freesound.iua.upf.edu/forum/login.php";
curl_easy_setopt(curl, CURLOPT_URL, login_url.c_str() );
// perform online request
connection = 1;
CURLcode res = curl_easy_perform(curl);
if( res != 0 ) {
toLog("curl login error\n");
toLog(curl_easy_strerror(res));
connection = 0;
}
if (connection == 1){
std::string check_page = xml_page.memory;
int test = (int)check_page.find("login"); //logged
if( strcmp(xml_page.memory, "login") == 0 )
toLog("Logged in.\n");
else {
toLog("Login failed: Check username and password.\n");
connection = 0;
}
}
// free the memory
if(xml_page.memory){
free( xml_page.memory );
xml_page.memory = NULL;
xml_page.size = 0;
}
std::cerr << "Login was cool, connection = " << connection << std::endl;
return connection;
}
else return 3; // will be returned if a curl related problem ocurrs
}
//------------------------------------------------------------------------
std::string Mootcher::searchText(std::string word)
{
struct MemoryStruct xml_page;
xml_page.memory = NULL;
xml_page.size = 0;
std::string result;
if(connection != 0)
{
// create a url encoded post message
std::string postMessage;
char tempString[ 128 ];
char *tempPointer = &tempString[0];
postMessage = "search=";
postMessage += curl_escape(word.c_str(), 0);
sprintf( tempPointer, "&searchDescriptions=1");
postMessage += tempPointer;
sprintf( tempPointer, "&searchtags=1");
postMessage += tempPointer;
if(curl)
{
// basic init for curl
setcUrlOptions();
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&xml_page);
// setup the post message
curl_easy_setopt(curl, CURLOPT_POST, TRUE);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postMessage.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, -1);
// the url to get
std::string search_url = "http://freesound.iua.upf.edu/searchTextXML.php";
curl_easy_setopt(curl, CURLOPT_URL, search_url.c_str());
// perform the online search
connection = 1;
CURLcode res = curl_easy_perform(curl);
if( res != 0 ) {
toLog("curl login error\n");
toLog(curl_easy_strerror(res));
connection = 0;
}
result = xml_page.memory;
toLog( result.c_str() );
// free the memory
if(xml_page.memory){
free( xml_page.memory );
xml_page.memory = NULL;
xml_page.size = 0;
}
}
}
return result;
}
//------------------------------------------------------------------------
std::string Mootcher::changeExtension(std::string filename)
{
std::string aiff = ".aiff";
std::string aif = ".aif";
std::string wav = ".wav";
std::string mp3 = ".mp3";
std::string ogg = ".ogg";
std::string flac = ".flac";
std::string replace = ".xml";
int pos = 0;
pos = (int)filename.find(aiff);
if(pos != std::string::npos) filename.replace(pos, aiff.size(), replace);
pos = (int)filename.find(aif);
if(pos != std::string::npos) filename.replace(pos, aif.size(), replace);
pos = (int)filename.find(wav);
if(pos != std::string::npos) filename.replace(pos, wav.size(), replace);
pos = (int)filename.find(mp3);
if(pos != std::string::npos) filename.replace(pos, mp3.size(), replace);
pos = (int)filename.find(ogg);
if(pos != std::string::npos) filename.replace(pos, ogg.size(), replace);
pos = (int)filename.find(flac);
if(pos != std::string::npos) filename.replace(pos, flac.size(), replace);
return filename;
}
//------------------------------------------------------------------------
void Mootcher::GetXml(std::string ID, struct MemoryStruct &xml_page)
{
if(curl) {
setcUrlOptions();
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&xml_page);
// URL to get
std::string getxml_url = "http://freesound.iua.upf.edu/samplesViewSingleXML.php?id=";
getxml_url += ID;
curl_easy_setopt(curl, CURLOPT_URL, getxml_url.c_str() );
// get it!
connection = 1;
CURLcode res = curl_easy_perform(curl);
if( res != 0 ) {
toLog("curl login error\n");
toLog(curl_easy_strerror(res));
connection = 0;
}
}
}
//------------------------------------------------------------------------
std::string Mootcher::getXmlFile(std::string ID, int &length)
{
struct MemoryStruct xml_page;
xml_page.memory = NULL;
xml_page.size = NULL;
std::string xmlFileName;
std::string audioFileName;
std::string filename;
if(connection != 0) {
// download the xmlfile into xml_page
GetXml(ID, xml_page);
// if sample ID does not exist on the freesound website
if(strcmp(xml_page.memory, "sample non existant") == 0){
free( xml_page.memory );
sprintf(message, "getXmlFile: sample with ID:%s does not exist!\n", ID.c_str() );
toLog(message);
return filename;
} else {
XMLTree doc;
doc.read_buffer( xml_page.memory );
XMLNode *freesound = doc.root();
// if the page is not a valid xml document with a 'freesound' root
if( freesound == NULL){
sprintf(message, "getXmlFile: There is no valid root in the xml file");
toLog(message);
} else {
XMLNode *sample = freesound->child("sample");
XMLNode *name = NULL;
XMLNode *filesize = NULL;
if (sample) {
name = sample->child("originalFilename");
filesize = sample->child("filesize");
}
// get the file name and size from xml file
if (sample && name && filesize) {
audioFileName = name->child("text")->content();
sprintf( message, "getXmlFile: %s needs to be downloaded\n", audioFileName.c_str() );
toLog(message);
length = atoi(filesize->child("text")->content().c_str());
// create new filename with the ID number
filename = basePath;
filename += "snd/";
filename += sample->property("id")->value();
filename += "-";
filename += audioFileName;
// change the extention into .xml
xmlFileName = changeExtension( filename );
sprintf(message, "getXmlFile: saving XML: %s\n", xmlFileName.c_str() );
toLog(message);
// save the xml file to disk
doc.write(xmlFileName.c_str());
//store all the tags in the database
XMLNode *tags = sample->child("tags");
if (tags) {
XMLNodeList children = tags->children();
XMLNodeConstIterator niter;
vector<string> strings;
for (niter = children.begin(); niter != children.end(); ++niter) {
XMLNode *node = *niter;
if( strcmp( node->name().c_str(), "tag") == 0 ) {
XMLNode *text = node->child("text");
if (text) strings.push_back(text->content());
}
}
ARDOUR::Library->set_tags (string("//")+filename, strings);
ARDOUR::Library->save_changes ();
}
}
// clear the memory
if(xml_page.memory){
free( xml_page.memory );
xml_page.memory = NULL;
xml_page.size = 0;
}
return audioFileName;
}
}
}
else {
return audioFileName;
}
}
int audioFileWrite(void *buffer, size_t size, size_t nmemb, void *file)
{
return (int)fwrite(buffer, size, nmemb, (FILE*) file);
};
//------------------------------------------------------------------------
std::string Mootcher::getFile(std::string ID)
{
CURLcode result_curl;
std::string audioFileName;
if(connection != 0)
{
int length;
std::string name = getXmlFile(ID, length);
if( name != "" ){
// create new filename with the ID number
audioFileName += basePath;
audioFileName += "snd/";
audioFileName += ID;
audioFileName += "-";
audioFileName += name;
//check to see if audio file already exists
FILE *testFile = fopen(audioFileName.c_str(), "r");
if (testFile) { //TODO: should also check length to see if file is complete
fseek (testFile , 0 , SEEK_END);
if (ftell (testFile) == length) {
sprintf(message, "%s already exists\n", audioFileName.c_str() );
toLog(message);
fclose (testFile);
return audioFileName;
} else {
remove( audioFileName.c_str() ); //file was not correct length, delete it and try again
}
}
//now download the actual file
if (curl) {
FILE* theFile;
theFile = fopen( audioFileName.c_str(), "wb" );
// create the download url, this url will also update the download statics on the site
std::string audioURL;
audioURL += "http://freesound.iua.upf.edu/samplesDownload.php?id=";
audioURL += ID;
setcUrlOptions();
curl_easy_setopt(curl, CURLOPT_URL, audioURL.c_str() );
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, audioFileWrite);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, theFile);
connection = 1;
CURLcode res = curl_easy_perform(curl);
if( res != 0 ) {
toLog("curl login error\n");
toLog(curl_easy_strerror(res));
connection = 0;
}
fclose(theFile);
}
/*
bar.dlnowMoo = 0;
bar.dltotalMoo = 0;
curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 0); // turn on the process bar thingy
curl_easy_setopt (curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
curl_easy_setopt (curl, CURLOPT_PROGRESSDATA, &bar);
*/
}
}
return audioFileName;
}
//---------
int Mootcher::progress_callback(void *bar, double dltotal, double dlnow, double ultotal, double ulnow)
{
struct dlprocess *lbar = (struct dlprocess *) bar;
lbar->dltotalMoo = dltotal;
lbar->dlnowMoo = dlnow;
return 0;
}

View file

@ -0,0 +1,78 @@
/*sfdb_freesound_mootcher.h****************************************************************************
Adapted for Ardour by Ben Loftis, March 2008
Mootcher Online Access to thefreesoundproject website
http://freesound.iua.upf.edu/
GPL 2005 Jorn Lemon
mail for questions/remarks: mootcher@twistedlemon.nl
or go to the freesound website forum
*****************************************************************************/
#include <string>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <string>
#include <sstream>
#include <vector>
//#include <ctime>
#include "curl/curl.h"
// mootcher version
#define ___VERSION___ 1.3
//--- struct to store XML file
struct MemoryStruct {
char *memory;
size_t size;
};
//--- for download process viewing
struct dlprocess {
double dltotalMoo;
double dlnowMoo;
};
class Mootcher
{
public:
Mootcher(const char *saveLocation);
~Mootcher();
int doLogin(std::string login, std::string password);
std::string getFile(std::string ID);
std::string searchText(std::string word);
struct dlprocess bar;
private:
const char* changeWorkingDir(const char *saveLocation);
std::string getXmlFile(std::string ID, int &length);
void GetXml(std::string ID, struct MemoryStruct &xml_page);
std::string changeExtension(std::string filename);
void toLog(std::string input);
void setcUrlOptions();
static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
CURL *curl;
char errorBuffer[CURL_ERROR_SIZE]; // storage for cUrl error message
int connection; // is 0 if no connection
char message[128]; // storage for messages that are send to the logfile
std::string basePath;
std::string xmlLocation;
};

View file

@ -32,6 +32,8 @@
#include <pbd/convert.h>
#include <pbd/tokenizer.h>
#include <pbd/enumwriter.h>
#include <pbd/pthread_utils.h>
#include <pbd/xml++.h>
#include <gtkmm2ext/utils.h>
@ -56,6 +58,10 @@
#include "utils.h"
#include "gain_meter.h"
#ifdef FREESOUND
#include "sfdb_freesound_mootcher.h"
#endif
#include "i18n.h"
using namespace ARDOUR;
@ -72,13 +78,13 @@ ustring SoundFileBrowser::persistent_folder;
static ImportMode
string2importmode (string str)
{
if (str == "as new tracks") {
if (str == _("as new tracks")) {
return ImportAsTrack;
} else if (str == "to selected tracks") {
} else if (str == _("to selected tracks")) {
return ImportToTrack;
} else if (str == "to region list") {
} else if (str == _("to region list")) {
return ImportAsRegion;
} else if (str == "as new tape tracks") {
} else if (str == _("as new tape tracks")) {
return ImportAsTapeTrack;
}
@ -391,74 +397,143 @@ SoundFileBox::save_tags (const vector<string>& tags)
SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::Session* s, bool persistent)
: ArdourDialog (parent, title, false, false),
found_list (ListStore::create(found_list_columns)),
freesound_list (ListStore::create(freesound_list_columns)),
chooser (FILE_CHOOSER_ACTION_OPEN),
found_list_view (found_list),
freesound_list_view (freesound_list),
preview (persistent),
found_search_btn (_("Search"))
found_search_btn (_("Search")),
freesound_search_btn (_("Start Downloading"))
{
resetting_ourselves = false;
gm = 0;
if (ARDOUR::Profile->get_sae()) {
chooser.add_shortcut_folder_uri("file:///Library/GarageBand/Apple Loops");
chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
}
VBox* vbox;
HBox* hbox;
//add the file chooser
{
chooser.set_border_width (12);
gm = 0;
set_session (s);
resetting_ourselves = false;
audio_filter.add_custom (FILE_FILTER_FILENAME, mem_fun(*this, &SoundFileBrowser::on_audio_filter));
audio_filter.set_name (_("Audio files"));
midi_filter.add_custom (FILE_FILTER_FILENAME, mem_fun(*this, &SoundFileBrowser::on_midi_filter));
midi_filter.set_name (_("MIDI files"));
matchall_filter.add_pattern ("*.*");
matchall_filter.set_name (_("All files"));
chooser.add_filter (audio_filter);
chooser.add_filter (midi_filter);
chooser.add_filter (matchall_filter);
chooser.set_select_multiple (true);
chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview));
chooser.signal_file_activated().connect (mem_fun (*this, &SoundFileBrowser::chooser_file_activated));
if (!persistent_folder.empty()) {
chooser.set_current_folder (persistent_folder);
}
notebook.append_page (chooser, _("Browse Files"));
}
hpacker.set_spacing (6);
hpacker.pack_start (notebook, true, true);
hpacker.pack_start (preview, false, false);
//add tag search
{
VBox* vbox;
HBox* hbox;
get_vbox()->pack_start (hpacker, true, true);
hpacker.set_spacing (6);
hpacker.pack_start (notebook, true, true);
hpacker.pack_start (preview, false, false);
hbox = manage(new HBox);
hbox->pack_start (found_entry);
hbox->pack_start (found_search_btn);
get_vbox()->pack_start (hpacker, true, true);
hbox = manage(new HBox);
hbox->pack_start (found_entry);
hbox->pack_start (found_search_btn);
Gtk::ScrolledWindow *scroll = manage(new ScrolledWindow);
scroll->add(found_list_view);
scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
vbox = manage(new VBox);
vbox->pack_start (*hbox, PACK_SHRINK);
vbox->pack_start (*scroll);
found_list_view.append_column(_("Paths"), found_list_columns.pathname);
found_list_view.get_selection()->signal_changed().connect(mem_fun(*this, &SoundFileBrowser::found_list_view_selected));
found_list_view.signal_row_activated().connect (mem_fun (*this, &SoundFileBrowser::found_list_view_activated));
found_search_btn.signal_clicked().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
found_entry.signal_activate().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
notebook.append_page (*vbox, _("Search Tags"));
}
vbox = manage(new VBox);
vbox->pack_start (*hbox, PACK_SHRINK);
vbox->pack_start (found_list_view);
found_list_view.append_column(_("Paths"), found_list_columns.pathname);
chooser.set_border_width (12);
notebook.append_page (chooser, _("Browse Files"));
notebook.append_page (*vbox, _("Search Tags"));
//add freesound search
#ifdef FREESOUND
{
VBox* vbox;
HBox* passbox;
Label* label;
hpacker.set_spacing (6);
hpacker.pack_start (notebook, true, true);
hpacker.pack_start (preview, false, false);
get_vbox()->pack_start (hpacker, true, true);
passbox = manage(new HBox);
passbox->set_border_width (12);
passbox->set_spacing (6);
label = manage (new Label);
label->set_text (_("User:"));
passbox->pack_start (*label, false, false);
passbox->pack_start (freesound_name_entry);
label = manage (new Label);
label->set_text (_("Password:"));
passbox->pack_start (*label, false, false);
passbox->pack_start (freesound_pass_entry);
label = manage (new Label);
label->set_text (_("Tags:"));
passbox->pack_start (*label, false, false);
passbox->pack_start (freesound_entry, false, false);
passbox->pack_start (freesound_search_btn, false, false);
Gtk::ScrolledWindow *scroll = manage(new ScrolledWindow);
scroll->add(freesound_list_view);
scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
vbox = manage(new VBox);
vbox->pack_start (*passbox, PACK_SHRINK);
vbox->pack_start(*scroll);
//vbox->pack_start (freesound_list_view);
freesound_list_view.append_column(_("Paths"), freesound_list_columns.pathname);
freesound_list_view.get_selection()->signal_changed().connect(mem_fun(*this, &SoundFileBrowser::freesound_list_view_selected));
//freesound_list_view.get_selection()->set_mode (SELECTION_MULTIPLE);
freesound_list_view.signal_row_activated().connect (mem_fun (*this, &SoundFileBrowser::freesound_list_view_activated));
freesound_search_btn.signal_clicked().connect(mem_fun(*this, &SoundFileBrowser::freesound_search_clicked));
freesound_entry.signal_activate().connect(mem_fun(*this, &SoundFileBrowser::freesound_search_clicked));
notebook.append_page (*vbox, _("Search Freesound"));
}
#endif
notebook.set_size_request (500, -1);
found_list_view.get_selection()->set_mode (SELECTION_MULTIPLE);
found_list_view.signal_row_activated().connect (mem_fun (*this, &SoundFileBrowser::found_list_view_activated));
audio_filter.add_custom (FILE_FILTER_FILENAME, mem_fun(*this, &SoundFileBrowser::on_audio_filter));
audio_filter.set_name (_("Audio files"));
midi_filter.add_custom (FILE_FILTER_FILENAME, mem_fun(*this, &SoundFileBrowser::on_midi_filter));
midi_filter.set_name (_("MIDI files"));
matchall_filter.add_pattern ("*.*");
matchall_filter.set_name (_("All files"));
chooser.add_filter (audio_filter);
chooser.add_filter (midi_filter);
chooser.add_filter (matchall_filter);
chooser.set_select_multiple (true);
chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview));
chooser.signal_file_activated().connect (mem_fun (*this, &SoundFileBrowser::chooser_file_activated));
if (!persistent_folder.empty()) {
chooser.set_current_folder (persistent_folder);
}
found_list_view.get_selection()->signal_changed().connect(mem_fun(*this, &SoundFileBrowser::found_list_view_selected));
found_search_btn.signal_clicked().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
found_entry.signal_activate().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
set_session (s);
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (Stock::APPLY, RESPONSE_APPLY);
@ -498,6 +573,12 @@ SoundFileBrowser::found_list_view_activated (const TreeModel::Path& path, TreeVi
preview.audition ();
}
void
SoundFileBrowser::freesound_list_view_activated (const TreeModel::Path& path, TreeViewColumn* col)
{
preview.audition ();
}
void
SoundFileBrowser::set_session (Session* s)
{
@ -602,6 +683,29 @@ SoundFileBrowser::found_list_view_selected ()
}
}
void
SoundFileBrowser::freesound_list_view_selected ()
{
if (!reset_options ()) {
set_response_sensitive (RESPONSE_OK, false);
} else {
ustring file;
TreeView::Selection::ListHandle_Path rows = freesound_list_view.get_selection()->get_selected_rows ();
if (!rows.empty()) {
TreeIter iter = freesound_list->get_iter(*rows.begin());
file = (*iter)[freesound_list_columns.pathname];
chooser.set_filename (file);
set_response_sensitive (RESPONSE_OK, true);
} else {
set_response_sensitive (RESPONSE_OK, false);
}
preview.setup_labels (file);
}
}
void
SoundFileBrowser::found_search_clicked ()
{
@ -626,6 +730,88 @@ SoundFileBrowser::found_search_clicked ()
}
}
void*
freesound_search_thread_entry (void* arg)
{
PBD::ThreadCreated (pthread_self(), X_("Freesound Search"));
static_cast<SoundFileBrowser*>(arg)->freesound_search_thread ();
return 0;
}
bool searching = false;
bool canceling = false;
void
SoundFileBrowser::freesound_search_clicked ()
{
if (canceling) //already canceling, button does nothing
return;
if ( searching ) {
freesound_search_btn.set_label(_("Cancelling.."));
canceling = true;
} else {
searching = true;
freesound_search_btn.set_label(_("Cancel"));
pthread_t freesound_thr;
pthread_create_and_store ("freesound_search", &freesound_thr, 0, freesound_search_thread_entry, this);
}
}
void
SoundFileBrowser::freesound_search_thread()
{
#ifdef FREESOUND
freesound_list->clear();
string path;
path = Glib::get_home_dir();
path += "/Freesound/";
Mootcher theMootcher(path.c_str());
string name_string = freesound_name_entry.get_text ();
string pass_string = freesound_pass_entry.get_text ();
string search_string = freesound_entry.get_text ();
if ( theMootcher.doLogin( name_string, pass_string ) ) {
string theString = theMootcher.searchText(search_string);
XMLTree doc;
doc.read_buffer( theString );
XMLNode *root = doc.root();
if (root==NULL) return;
if ( strcmp(root->name().c_str(), "freesound") == 0) {
XMLNode *node = 0;
XMLNodeList children = root->children();
XMLNodeConstIterator niter;
for (niter = children.begin(); niter != children.end() && !canceling; ++niter) {
node = *niter;
if( strcmp( node->name().c_str(), "sample") == 0 ){
XMLProperty *prop=node->property ("id");
string filename = theMootcher.getFile( prop->value().c_str() );
if ( filename != "" ) {
TreeModel::iterator new_row = freesound_list->append();
TreeModel::Row row = *new_row;
string path = Glib::filename_from_uri (string ("file:") + filename);
row[freesound_list_columns.pathname] = path;
}
}
}
}
}
searching = false;
canceling = false;
freesound_search_btn.set_label(_("Start Downloading"));
#endif
}
vector<ustring>
SoundFileBrowser::get_paths ()
{
@ -644,7 +830,7 @@ SoundFileBrowser::get_paths ()
}
}
} else {
} else if (n==1){
typedef TreeView::Selection::ListHandle_Path ListPath;
@ -653,6 +839,17 @@ SoundFileBrowser::get_paths ()
TreeIter iter = found_list->get_iter(*i);
ustring str = (*iter)[found_list_columns.pathname];
results.push_back (str);
}
} else {
typedef TreeView::Selection::ListHandle_Path ListPath;
ListPath rows = freesound_list_view.get_selection()->get_selected_rows ();
for (ListPath::iterator i = rows.begin() ; i != rows.end(); ++i) {
TreeIter iter = freesound_list->get_iter(*i);
ustring str = (*iter)[freesound_list_columns.pathname];
results.push_back (str);
}
}
@ -963,6 +1160,7 @@ SoundFileChooser::SoundFileChooser (Gtk::Window& parent, string title, ARDOUR::S
{
chooser.set_select_multiple (false);
found_list_view.get_selection()->set_mode (SELECTION_SINGLE);
freesound_list_view.get_selection()->set_mode (SELECTION_SINGLE);
}
void

View file

@ -117,6 +117,9 @@ class SoundFileBrowser : public ArdourDialog
FoundTagColumns found_list_columns;
Glib::RefPtr<Gtk::ListStore> found_list;
FoundTagColumns freesound_list_columns;
Glib::RefPtr<Gtk::ListStore> freesound_list;
public:
SoundFileBrowser (Gtk::Window& parent, std::string title, ARDOUR::Session* _s, bool persistent);
virtual ~SoundFileBrowser ();
@ -127,21 +130,31 @@ class SoundFileBrowser : public ArdourDialog
void clear_selection ();
Gtk::FileChooserWidget chooser;
SoundFileBox preview;
Gtk::Entry found_entry;
Gtk::Button found_search_btn;
Gtk::TreeView found_list_view;
Gtk::Entry freesound_name_entry;
Gtk::Entry freesound_pass_entry;
Gtk::Entry freesound_entry;
Gtk::Button freesound_search_btn;
Gtk::TreeView freesound_list_view;
void freesound_search_thread();
protected:
bool resetting_ourselves;
Gtk::FileFilter audio_filter;
Gtk::FileFilter midi_filter;
Gtk::FileFilter matchall_filter;
SoundFileBox preview;
Gtk::HBox hpacker;
static Glib::ustring persistent_folder;
Gtk::Entry found_entry;
Gtk::Button found_search_btn;
Gtk::Notebook notebook;
GainMeter* gm;
@ -154,10 +167,15 @@ class SoundFileBrowser : public ArdourDialog
sigc::connection metering_connection;
void update_preview ();
void found_list_view_selected ();
void found_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
void found_search_clicked ();
void freesound_list_view_selected ();
void freesound_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
void freesound_search_clicked ();
void chooser_file_activated ();
bool on_audio_filter (const Gtk::FileFilter::Info& filter_info);

View file

@ -543,6 +543,18 @@ TimeAxisView::name_entry_button_release (GdkEventButton *ev)
return false;
}
void
TimeAxisView::conditionally_add_to_selection ()
{
Selection& s (editor.get_selection());
if (!s.selected (this)) {
cerr << "set selected track\n";
editor.set_selected_track (*this, Selection::Set);
}
}
void
TimeAxisView::popup_display_menu (guint32 when)
{
@ -550,14 +562,14 @@ TimeAxisView::popup_display_menu (guint32 when)
build_display_menu ();
}
editor.set_selected_track (*this, Selection::Add);
conditionally_add_to_selection ();
display_menu->popup (1, when);
}
gint
TimeAxisView::size_click (GdkEventButton *ev)
{
editor.set_selected_track (*this, Selection::Add);
conditionally_add_to_selection ();
popup_size_menu (ev->time);
return TRUE;
}

View file

@ -334,6 +334,8 @@ class TimeAxisView : public virtual AxisView
ARDOUR::AnalysisFeatureList analysis_features;
void reshow_feature_lines ();
void conditionally_add_to_selection ();
}; /* class TimeAxisView */
#endif /* __ardour_gtk_time_axis_h__ */

View file

@ -60,6 +60,7 @@ class AUPlugin : public ARDOUR::Plugin
{
public:
AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAComponent> comp);
AUPlugin (const AUPlugin& other);
virtual ~AUPlugin ();
std::string unique_id () const;
@ -106,7 +107,7 @@ class AUPlugin : public ARDOUR::Plugin
uint32_t input_streams() const;
boost::shared_ptr<CAAudioUnit> get_au () { return unit; }
boost::shared_ptr<CAComponent> get_comp () { return comp; }
boost::shared_ptr<CAComponent> get_comp () const { return comp; }
OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
@ -140,6 +141,7 @@ class AUPlugin : public ARDOUR::Plugin
nframes_t frames_processed;
std::vector<AUParameterDescriptor> descriptors;
void init ();
};
typedef boost::shared_ptr<AUPlugin> AUPluginPtr;

View file

@ -133,6 +133,8 @@ class AudioEngine : public sigc::trackable
uint32_t n_physical_outputs () const;
uint32_t n_physical_inputs () const;
bool can_request_hardware_monitoring ();
void get_physical_outputs (std::vector<std::string>&);
void get_physical_inputs (std::vector<std::string>&);

View file

@ -27,6 +27,9 @@
#include <sigc++/signal.h>
#include <glibmm/thread.h>
#include <boost/pool/pool.hpp>
#include <boost/pool/pool_alloc.hpp>
#include <pbd/undo.h>
#include <pbd/xml++.h>
#include <pbd/statefuldestructible.h>
@ -67,12 +70,21 @@ struct ControlEvent {
double* coeff; ///< double[4] allocated by Curve as needed
};
/* automation lists use a pool allocator that does not use a lock and
allocates 8k of new pointers at a time
*/
typedef boost::fast_pool_allocator<ControlEvent*,
boost::default_user_allocator_new_delete,
boost::details::pool::null_mutex,
8192> ControlEventAllocator;
class AutomationList : public PBD::StatefulDestructible
{
public:
typedef std::list<ControlEvent*> EventList;
typedef std::list<ControlEvent*,ControlEventAllocator> EventList;
typedef EventList::iterator iterator;
typedef EventList::reverse_iterator reverse_iterator;
typedef EventList::const_iterator const_iterator;
AutomationList (Parameter id, double min_val, double max_val, double default_val);

View file

@ -53,7 +53,7 @@ CONFIG_VARIABLE (float, track_buffer_seconds, "track-buffer-seconds", 5.0)
CONFIG_VARIABLE (uint32_t, disk_choice_space_threshold, "disk-choice-space-threshold", 57600000)
CONFIG_VARIABLE (SampleFormat, native_file_data_format, "native-file-data-format", ARDOUR::FormatFloat)
CONFIG_VARIABLE (HeaderFormat, native_file_header_format, "native-file-header-format", ARDOUR::WAVE)
CONFIG_VARIABLE (bool, auto_analyse_audio, "auto-analyse-audio", true)
CONFIG_VARIABLE (bool, auto_analyse_audio, "auto-analyse-audio", false)
/* OSC */

View file

@ -92,6 +92,8 @@ class Playlist : public SessionObject, public boost::enable_shared_from_this<Pla
void get_region_list_equivalent_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >&);
void replace_region (boost::shared_ptr<Region> old, boost::shared_ptr<Region> newr, nframes_t pos);
void split_region (boost::shared_ptr<Region>, nframes_t position);
void split (nframes64_t at);
void shift (nframes64_t at, nframes64_t distance, bool move_intersected, bool ignore_music_glue);
void partition (nframes_t start, nframes_t end, bool just_top_level);
void duplicate (boost::shared_ptr<Region>, nframes_t position, float times);
void nudge_after (nframes_t start, nframes_t distance, bool forwards);
@ -274,6 +276,8 @@ class Playlist : public SessionObject, public boost::enable_shared_from_this<Pla
void unset_freeze_child (Playlist*);
void timestamp_layer_op (boost::shared_ptr<Region>);
void _split_region (boost::shared_ptr<Region>, nframes_t position);
};
} /* namespace ARDOUR */

View file

@ -138,6 +138,7 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
PositionLockStyle positional_lock_style() const { return _positional_lock_style; }
void set_position_lock_style (PositionLockStyle ps);
void recompute_position_from_lock_style ();
virtual bool should_save_state () const { return !(_flags & DoNotSaveState); };

View file

@ -41,6 +41,12 @@ class RegionFactory {
*/
static sigc::signal<void,boost::shared_ptr<Region> > CheckNewRegion;
static boost::shared_ptr<Region> create (boost::shared_ptr<const Region>);
/* note: both of the first two should use const shared_ptr as well, but
gcc 4.1 doesn't seem to be able to disambiguate them if they do.
*/
static boost::shared_ptr<Region> create (boost::shared_ptr<Region>, nframes_t start,
nframes_t length, std::string name,
layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
@ -49,7 +55,6 @@ class RegionFactory {
layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
static boost::shared_ptr<Region> create (boost::shared_ptr<Source>, nframes_t start, nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
static boost::shared_ptr<Region> create (const SourceList &, nframes_t start, nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
static boost::shared_ptr<Region> create (boost::shared_ptr<Region>);
static boost::shared_ptr<Region> create (Session&, XMLNode&, bool);
static boost::shared_ptr<Region> create (SourceList &, const XMLNode&);
};

View file

@ -261,6 +261,14 @@ class Session : public PBD::StatefulDestructible
const SessionDirectory& session_directory () const { return *(_session_dir.get()); }
static sigc::signal<void> AutoBindingOn;
static sigc::signal<void> AutoBindingOff;
static sigc::signal<void,std::string> Dialog;
std::string sound_dir (bool with_path = true) const;
std::string peak_dir () const;
std::string dead_sound_dir () const;
std::string automation_dir () const;
std::string analysis_dir() const;

View file

@ -1570,7 +1570,9 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
s->update_header (capture_info.front()->start, when, twhen);
s->set_captured_for (_name);
s->mark_immutable ();
Analyser::queue_source_for_analysis (s, true);
if (Config->get_auto_analyse_audio()) {
Analyser::queue_source_for_analysis (s, true);
}
}
}

View file

@ -55,17 +55,49 @@ _render_callback(void *userData,
}
AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAComponent> _comp)
:
Plugin (engine, session),
comp (_comp),
unit (new CAAudioUnit),
initialized (false),
buffers (0),
current_maxbuf (0),
current_offset (0),
current_buffers (0),
: Plugin (engine, session),
comp (_comp),
unit (new CAAudioUnit),
initialized (false),
buffers (0),
current_maxbuf (0),
current_offset (0),
current_buffers (0),
frames_processed (0)
{
init ();
}
AUPlugin::AUPlugin (const AUPlugin& other)
: Plugin (other)
, comp (other.get_comp())
, unit (new CAAudioUnit)
, initialized (false)
, buffers (0)
, current_maxbuf (0)
, current_offset (0)
, current_buffers (0)
, frames_processed (0)
{
init ();
}
AUPlugin::~AUPlugin ()
{
if (unit) {
unit->Uninitialize ();
}
if (buffers) {
free (buffers);
}
}
void
AUPlugin::init ()
{
OSErr err = CAAudioUnit::Open (*(comp.get()), *unit);
if (err != noErr) {
@ -90,7 +122,7 @@ AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAC
// set up the basic stream format. these fields do not change
streamFormat.mSampleRate = session.frame_rate();
streamFormat.mSampleRate = _session.frame_rate();
streamFormat.mFormatID = kAudioFormatLinearPCM;
streamFormat.mFormatFlags = kAudioFormatFlagIsFloat|kAudioFormatFlagIsPacked|kAudioFormatFlagIsNonInterleaved;
@ -121,17 +153,6 @@ AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAC
Plugin::setup_controls ();
}
AUPlugin::~AUPlugin ()
{
if (unit) {
unit->Uninitialize ();
}
if (buffers) {
free (buffers);
}
}
void
AUPlugin::discover_parameters ()
{
@ -281,7 +302,7 @@ AUPlugin::signal_latency () const
return _user_latency;
}
return unit->Latency ();
return unit->Latency() * _session.frame_rate();
}
void

View file

@ -899,6 +899,25 @@ AudioEngine::halted (void *arg)
}
}
bool
AudioEngine::can_request_hardware_monitoring ()
{
const char ** ports;
if (!_jack) {
return 0;
}
if ((ports = jack_get_ports (_jack, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortCanMonitor)) == 0) {
return false;
}
free (ports);
return true;
}
uint32_t
AudioEngine::n_physical_outputs () const
{
@ -913,10 +932,9 @@ AudioEngine::n_physical_outputs () const
return 0;
}
if (ports) {
for (i = 0; ports[i]; ++i);
free (ports);
}
for (i = 0; ports[i]; ++i);
free (ports);
return i;
}

View file

@ -692,29 +692,39 @@ AudioFileSource::setup_peakfile ()
bool
AudioFileSource::safe_file_extension(ustring file)
{
return !(file.rfind(".wav") == ustring::npos &&
file.rfind(".aiff")== ustring::npos &&
file.rfind(".caf")== ustring::npos &&
file.rfind(".aif") == ustring::npos &&
file.rfind(".amb") == ustring::npos &&
file.rfind(".snd") == ustring::npos &&
file.rfind(".au") == ustring::npos &&
file.rfind(".raw") == ustring::npos &&
file.rfind(".sf") == ustring::npos &&
file.rfind(".cdr") == ustring::npos &&
file.rfind(".smp") == ustring::npos &&
file.rfind(".maud")== ustring::npos &&
file.rfind(".vwe") == ustring::npos &&
file.rfind(".paf") == ustring::npos &&
const char* suffixes[] = {
".wav", ".WAV",
".aiff", ".AIFF",
".caf", ".CAF",
".aif", ".AIF",
".amb", ".AMB",
".snd", ".SND",
".au", ".AU",
".raw", ".RAW",
".sf", ".SF",
".cdr", ".CDR",
".smp", ".SMP",
".maud", ".MAUD",
".vwe", ".VWE",
".paf", ".PAF",
".voc", ".VOC",
#ifdef HAVE_FLAC
file.rfind(".flac")== ustring::npos &&
".flac", ".FLAC",
#endif // HAVE_FLAC
#ifdef HAVE_COREAUDIO
file.rfind(".mp3") == ustring::npos &&
file.rfind(".aac") == ustring::npos &&
file.rfind(".mp4") == ustring::npos &&
".mp3", ".MP3",
".aac", ".AAC",
".mp4", ".MP4",
#endif // HAVE_COREAUDIO
file.rfind(".voc") == ustring::npos);
};
for (size_t n = 0; n < sizeof(suffixes)/sizeof(suffixes[0]); ++n) {
if (file.rfind (suffixes[n]) == file.length() - strlen (suffixes[n])) {
return true;
}
}
return false;
}
void

View file

@ -1316,7 +1316,17 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
return 0;
}
cerr << "startup analysis of " << _name << endl;
/* no existing/complete transient info */
if (!Config->get_auto_analyse_audio()) {
pl->session().Dialog (_("\
You have requested an operation that requires audio analysis.\n\n\
You currently have \"auto-analyse-audio\" disabled, which means\n\
that transient data must be generated every time it is required.\n\n\
If you are doing work that will require transient data on a\n\
regular basis, you should probably enable \"auto-analyse-audio\"\n\
then quit ardour and restart."));
}
TransientDetector t (pl->session().frame_rate());
bool existing_results = !results.empty();
@ -1330,14 +1340,10 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
t.reset ();
cerr << "working on channel " << i << endl;
if (t.run ("", this, i, these_results)) {
return -1;
}
cerr << "done\n";
/* translate all transients to give absolute position */
for (AnalysisFeatureList::iterator i = these_results.begin(); i != these_results.end(); ++i) {

View file

@ -685,7 +685,7 @@ AutomationList::truncate_end (double last_coordinate)
{
Glib::Mutex::Lock lm (_lock);
ControlEvent cp (last_coordinate, 0);
list<ControlEvent*>::reverse_iterator i;
AutomationList::reverse_iterator i;
double last_val;
if (_events.empty()) {
@ -754,7 +754,7 @@ AutomationList::truncate_end (double last_coordinate)
uint32_t sz = _events.size();
while (i != _events.rend() && sz > 2) {
list<ControlEvent*>::reverse_iterator tmp;
AutomationList::reverse_iterator tmp;
tmp = i;
++tmp;
@ -851,7 +851,7 @@ AutomationList::truncate_start (double overall_length)
i = _events.begin();
while (i != _events.end() && !_events.empty()) {
list<ControlEvent*>::iterator tmp;
AutomationList::iterator tmp;
tmp = i;
++tmp;
@ -948,6 +948,9 @@ AutomationList::unlocked_eval (double x) const
return multipoint_eval (x);
break;
}
/*NOTREACHED*/ /* stupid gcc */
return 0.0;
}
double

View file

@ -469,7 +469,9 @@ Session::import_audiofiles (import_status& status)
/* now that there is data there, requeue the file for analysis */
Analyser::queue_source_for_analysis (boost::static_pointer_cast<Source>(*x), false);
if (Config->get_auto_analyse_audio()) {
Analyser::queue_source_for_analysis (boost::static_pointer_cast<Source>(*x), false);
}
}
/* save state so that we don't lose these new Sources */

View file

@ -728,7 +728,7 @@ IO::add_input_port (string source, void* src, DataType type)
{
Glib::Mutex::Lock lm (io_lock);
if (n_inputs() >= _input_maximum) {
return -1;
}

View file

@ -857,10 +857,6 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
}
}
if (current->first_frame() >= current->last_frame()) {
PBD::stacktrace (cerr);
}
in_partition = false;
}
@ -1024,11 +1020,68 @@ Playlist::duplicate (boost::shared_ptr<Region> region, nframes_t position, float
}
}
void
Playlist::shift (nframes64_t at, nframes64_t distance, bool move_intersected, bool ignore_music_glue)
{
RegionLock rlock (this);
RegionList copy (regions);
RegionList fixup;
for (RegionList::iterator r = copy.begin(); r != copy.end(); ++r) {
if ((*r)->last_frame() < at) {
/* too early */
continue;
}
if (at > (*r)->first_frame() && at < (*r)->last_frame()) {
/* intersected region */
if (!move_intersected) {
continue;
}
}
/* do not move regions glued to music time - that
has to be done separately.
*/
if (!ignore_music_glue && (*r)->positional_lock_style() != Region::AudioTime) {
fixup.push_back (*r);
continue;
}
(*r)->set_position ((*r)->position() + distance, this);
}
for (RegionList::iterator r = fixup.begin(); r != fixup.end(); ++r) {
(*r)->recompute_position_from_lock_style ();
}
}
void
Playlist::split (nframes64_t at)
{
RegionLock rlock (this);
RegionList copy (regions);
/* use a copy since this operation can modify the region list
*/
for (RegionList::iterator r = copy.begin(); r != copy.end(); ++r) {
_split_region (*r, at);
}
}
void
Playlist::split_region (boost::shared_ptr<Region> region, nframes_t playlist_position)
{
RegionLock rl (this);
_split_region (region, playlist_position);
}
void
Playlist::_split_region (boost::shared_ptr<Region> region, nframes_t playlist_position)
{
if (!region->covers (playlist_position)) {
return;
}

2063
libs/ardour/po/pl_PL.po Normal file

File diff suppressed because it is too large Load diff

View file

@ -316,6 +316,9 @@ Region::~Region ()
for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
(*i)->remove_playlist (pl);
}
for (SourceList::const_iterator i = _master_sources.begin(); i != _master_sources.end(); ++i) {
(*i)->remove_playlist (pl);
}
}
notify_callbacks ();
@ -341,16 +344,26 @@ Region::set_playlist (boost::weak_ptr<Playlist> wpl)
(*i)->remove_playlist (_playlist);
(*i)->add_playlist (pl);
}
for (SourceList::const_iterator i = _master_sources.begin(); i != _master_sources.end(); ++i) {
(*i)->remove_playlist (_playlist);
(*i)->add_playlist (pl);
}
} else {
for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
(*i)->add_playlist (pl);
}
for (SourceList::const_iterator i = _master_sources.begin(); i != _master_sources.end(); ++i) {
(*i)->add_playlist (pl);
}
}
} else {
if (old_playlist) {
for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
(*i)->remove_playlist (old_playlist);
}
for (SourceList::const_iterator i = _master_sources.begin(); i != _master_sources.end(); ++i) {
(*i)->remove_playlist (old_playlist);
}
}
}
}
@ -532,11 +545,8 @@ Region::set_position_internal (nframes_t pos, bool allow_bbt_recompute)
_length = max_frames - _position;
}
if (allow_bbt_recompute && _positional_lock_style == MusicTime) {
boost::shared_ptr<Playlist> pl (playlist());
if (pl) {
pl->session().tempo_map().bbt_time (_position, _bbt_time);
}
if (allow_bbt_recompute) {
recompute_position_from_lock_style ();
}
invalidate_transients ();
@ -574,6 +584,17 @@ Region::set_position_on_top (nframes_t pos, void *src)
send_change (PositionChanged);
}
void
Region::recompute_position_from_lock_style ()
{
if (_positional_lock_style == MusicTime) {
boost::shared_ptr<Playlist> pl (playlist());
if (pl) {
pl->session().tempo_map().bbt_time (_position, _bbt_time);
}
}
}
void
Region::nudge_position (nframes64_t n, void *src)
{

View file

@ -37,8 +37,8 @@ sigc::signal<void,boost::shared_ptr<Region> > RegionFactory::CheckNewRegion;
boost::shared_ptr<Region>
RegionFactory::create (boost::shared_ptr<Region> region, nframes_t start,
nframes_t length, std::string name,
layer_t layer, Region::Flag flags, bool announce)
nframes_t length, std::string name,
layer_t layer, Region::Flag flags, bool announce)
{
boost::shared_ptr<const AudioRegion> other_a;
boost::shared_ptr<const MidiRegion> other_m;
@ -68,16 +68,16 @@ RegionFactory::create (boost::shared_ptr<Region> region, nframes_t start,
}
boost::shared_ptr<Region>
RegionFactory::create (boost::shared_ptr<Region> region)
RegionFactory::create (boost::shared_ptr<const Region> region)
{
boost::shared_ptr<AudioRegion> ar;
boost::shared_ptr<MidiRegion> mr;
boost::shared_ptr<const AudioRegion> ar;
boost::shared_ptr<const MidiRegion> mr;
if ((ar = boost::dynamic_pointer_cast<AudioRegion>(region)) != 0) {
if ((ar = boost::dynamic_pointer_cast<const AudioRegion>(region)) != 0) {
boost::shared_ptr<Region> ret (new AudioRegion (ar));
/* pure copy constructor - no CheckNewRegion emitted */
return ret;
} else if ((mr = boost::dynamic_pointer_cast<MidiRegion>(region)) != 0) {
} else if ((mr = boost::dynamic_pointer_cast<const MidiRegion>(region)) != 0) {
boost::shared_ptr<Region> ret (new MidiRegion (mr));
/* pure copy constructor - no CheckNewRegion emitted */
return ret;
@ -91,8 +91,8 @@ RegionFactory::create (boost::shared_ptr<Region> region)
boost::shared_ptr<Region>
RegionFactory::create (boost::shared_ptr<AudioRegion> region, nframes_t start,
nframes_t length, std::string name,
layer_t layer, Region::Flag flags, bool announce)
nframes_t length, std::string name,
layer_t layer, Region::Flag flags, bool announce)
{
return create (boost::static_pointer_cast<Region> (region), start, length, name, layer, flags, announce);
}

View file

@ -24,6 +24,7 @@
#include <sigc++/bind.h>
#include <pbd/xml++.h>
#include <pbd/enumwriter.h>
#include <pbd/stacktrace.h>
#include <ardour/timestamps.h>
#include <ardour/audioengine.h>

View file

@ -107,6 +107,7 @@ Session::apply_gain_to_buffer_t Session::apply_gain_to_buffer = 0;
Session::mix_buffers_with_gain_t Session::mix_buffers_with_gain = 0;
Session::mix_buffers_no_gain_t Session::mix_buffers_no_gain = 0;
sigc::signal<void,std::string> Session::Dialog;
sigc::signal<int> Session::AskAboutPendingState;
sigc::signal<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
sigc::signal<void> Session::SendFeedback;
@ -115,6 +116,9 @@ sigc::signal<void> Session::SMPTEOffsetChanged;
sigc::signal<void> Session::StartTimeChanged;
sigc::signal<void> Session::EndTimeChanged;
sigc::signal<void> Session::AutoBindingOn;
sigc::signal<void> Session::AutoBindingOff;
Session::Session (AudioEngine &eng,
const string& fullpath,
const string& snapshot_name,
@ -957,7 +961,6 @@ Session::auto_loop_changed (Location* location)
}
last_loopend = location->end();
}
void
@ -995,6 +998,10 @@ Session::set_auto_punch_location (Location* location)
auto_punch_changed_connection = location->changed.connect (mem_fun (this, &Session::auto_punch_changed));
location->set_auto_punch (true, this);
auto_punch_changed (location);
auto_punch_location_changed (location);
}
@ -1034,6 +1041,13 @@ Session::set_auto_loop_location (Location* location)
auto_loop_changed_connection = location->changed.connect (mem_fun (this, &Session::auto_loop_changed));
location->set_auto_loop (true, this);
/* take care of our stuff first */
auto_loop_changed (location);
/* now tell everyone else */
auto_loop_location_changed (location);
}
@ -2835,8 +2849,6 @@ Session::remove_source (boost::weak_ptr<Source> src)
return;
}
cerr << "remove source for " << source->name() << endl;
{
Glib::Mutex::Lock lm (source_lock);

View file

@ -66,25 +66,6 @@ legalize_for_path (ustring str)
return legal;
}
#if 0
string
legalize_for_path (string str)
{
string::size_type pos;
string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: ";
string legal;
legal = str;
pos = 0;
while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
legal.replace (pos, 1, "_");
pos += 1;
}
return legal;
}
#endif
string bump_name_once(std::string name)
{

View file

@ -63,6 +63,7 @@ class BarController : public Gtk::Frame
/* export this to allow direct connection to button events */
Gtk::Widget& event_widget() { return darea; }
PBD::Controllable* get_controllable() { return binding_proxy.get_controllable(); }
protected:
Gtk::Adjustment& adjustment;

View file

@ -47,7 +47,8 @@ class BindableToggleButton : public Gtkmm2ext::StatefulToggleButton
return true;
}
}
PBD::Controllable* get_controllable() { return binding_proxy.get_controllable(); }
private:
BindingProxy binding_proxy;
};
@ -71,6 +72,8 @@ class BindableButton : public Gtkmm2ext::StatefulButton
}
}
PBD::Controllable* get_controllable() { return binding_proxy.get_controllable(); }
private:
BindingProxy binding_proxy;
};

View file

@ -40,6 +40,7 @@ class BindingProxy : public sigc::trackable
bool button_press_handler (GdkEventButton *);
PBD::Controllable* get_controllable() { return &controllable; }
protected:
Gtkmm2ext::PopUp* prompter;

View file

@ -0,0 +1,53 @@
# translation of libgtkmm2ext.po to Polish
# Copyright (C) YEAR "Paul Davis"
# This file is distributed under the same license as the PACKAGE package.
#
# Piotr Zaryk <pzaryk@gmail.com>, 2008.
msgid ""
msgstr ""
"Project-Id-Version: libgtkmm2ext\n"
"Report-Msgid-Bugs-To: Piotr Zaryk <pzaryk@gmail.com>\n"
"POT-Creation-Date: 2008-04-03 16:17+0200\n"
"PO-Revision-Date: 2008-04-10 10:54+0100\n"
"Last-Translator: Piotr Zaryk <pzaryk@gmail.com>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: libs/gtkmm2ext/binding_proxy.cc:69
msgid "operate controller now"
msgstr "Teraz operuj kontrolerem"
#: libs/gtkmm2ext/gtk_ui.cc:95
msgid "Log"
msgstr "Log"
#: libs/gtkmm2ext/gtk_ui.cc:536
msgid "Press To Exit"
msgstr "Wciśnij by zakończyć"
#: libs/gtkmm2ext/gtk_ui.cc:570
msgid "Error"
msgstr "Błąd"
#: libs/gtkmm2ext/pathlist.cc:29
msgid "+"
msgstr "+"
#: libs/gtkmm2ext/pathlist.cc:30
msgid "-"
msgstr "-"
#: libs/gtkmm2ext/pathlist.cc:35
msgid "Paths"
msgstr "Położenia"
#: libs/gtkmm2ext/pathlist.cc:87
msgid "Path Chooser"
msgstr "Wybór położenia"
#: libs/gtkmm2ext/textviewer.cc:34
msgid "Close"
msgstr "Zamknij"

View file

@ -40,7 +40,9 @@ Points::Points(size_type nbpoints)
Points::Points(GnomeCanvasPoints *castitem)
: points_(castitem),owned_(false)
{
reserve(points_->num_points);
while (size() < points_->num_points) {
push_back (Art::Point());
}
//GnomeCanvasPoints has an array of doubles, used 2 at a time:
int i = 0;

View file

@ -28,6 +28,8 @@ using namespace PBD;
sigc::signal<void,Controllable*> Controllable::Destroyed;
sigc::signal<bool,Controllable*> Controllable::StartLearning;
sigc::signal<void,Controllable*> Controllable::StopLearning;
sigc::signal<void,Controllable*,int,int> Controllable::CreateBinding;
sigc::signal<void,Controllable*> Controllable::DeleteBinding;
Glib::Mutex* Controllable::registry_lock = 0;
Controllable::Controllables Controllable::registry;

View file

@ -43,6 +43,8 @@ class Controllable : public PBD::StatefulDestructible {
virtual bool can_send_feedback() const { return true; }
sigc::signal<void> LearningFinished;
static sigc::signal<void,PBD::Controllable*,int,int> CreateBinding;
static sigc::signal<void,PBD::Controllable*> DeleteBinding;
static sigc::signal<bool,PBD::Controllable*> StartLearning;
static sigc::signal<void,PBD::Controllable*> StopLearning;

View file

@ -59,9 +59,17 @@ GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
_feedback_interval = 10000; // microseconds
last_feedback_time = 0;
auto_binding = FALSE;
Controllable::StartLearning.connect (mem_fun (*this, &GenericMidiControlProtocol::start_learning));
Controllable::StopLearning.connect (mem_fun (*this, &GenericMidiControlProtocol::stop_learning));
Session::SendFeedback.connect (mem_fun (*this, &GenericMidiControlProtocol::send_feedback));
Controllable::CreateBinding.connect (mem_fun (*this, &GenericMidiControlProtocol::create_binding));
Controllable::DeleteBinding.connect (mem_fun (*this, &GenericMidiControlProtocol::delete_binding));
Session::AutoBindingOn.connect (mem_fun (*this, &GenericMidiControlProtocol::auto_binding_on));
Session::AutoBindingOff.connect (mem_fun (*this, &GenericMidiControlProtocol::auto_binding_off));
}
GenericMidiControlProtocol::~GenericMidiControlProtocol ()
@ -229,6 +237,71 @@ GenericMidiControlProtocol::stop_learning (Controllable* c)
}
}
void
GenericMidiControlProtocol::delete_binding ( PBD::Controllable* control )
{
if( control != 0 ) {
Glib::Mutex::Lock lm2 (controllables_lock);
for( MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ++iter) {
MIDIControllable* existingBinding = (*iter);
if( control == &(existingBinding->get_controllable()) ) {
delete existingBinding;
controllables.erase (iter);
}
} // end for midi controllables
} // end null check
}
void
GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos, int control_number)
{
if( control != NULL ) {
Glib::Mutex::Lock lm2 (controllables_lock);
MIDI::channel_t channel = (pos & 0xf);
MIDI::byte value = control_number;
// Create a MIDIControllable::
MIDIControllable* mc = new MIDIControllable (*_port, *control);
// Remove any old binding for this midi channel/type/value pair
// Note: can't use delete_binding() here because we don't know the specific controllable we want to remove, only the midi information
for( MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ++iter) {
MIDIControllable* existingBinding = (*iter);
if( (existingBinding->get_control_channel() & 0xf ) == channel &&
existingBinding->get_control_additional() == value &&
(existingBinding->get_control_type() & 0xf0 ) == MIDI::controller ) {
delete existingBinding;
controllables.erase (iter);
}
} // end for midi controllables
// Update the MIDI Controllable based on the the pos param
// Here is where a table lookup for user mappings could go; for now we'll just wing it...
mc->bind_midi( channel, MIDI::controller, value );
controllables.insert (mc);
} // end null test
}
void
GenericMidiControlProtocol::auto_binding_on()
{
auto_binding = TRUE;
}
void
GenericMidiControlProtocol::auto_binding_off()
{
auto_binding = FALSE;
}
XMLNode&
GenericMidiControlProtocol::get_state ()
{
@ -273,46 +346,47 @@ GenericMidiControlProtocol::set_state (const XMLNode& node)
_feedback_interval = 10000;
}
Controllable* c;
{
Glib::Mutex::Lock lm (pending_lock);
pending_controllables.clear ();
}
Glib::Mutex::Lock lm2 (controllables_lock);
controllables.clear ();
nlist = node.children(); // "controls"
if (nlist.empty()) {
return 0;
}
nlist = nlist.front()->children ();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((prop = (*niter)->property ("id")) != 0) {
// Are we using the autobinding feature? If so skip this part
if ( !auto_binding ) {
Controllable* c;
{
Glib::Mutex::Lock lm (pending_lock);
pending_controllables.clear ();
}
Glib::Mutex::Lock lm2 (controllables_lock);
controllables.clear ();
nlist = node.children(); // "controls"
if (nlist.empty()) {
return 0;
}
nlist = nlist.front()->children ();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
ID id = prop->value ();
c = Controllable::by_id (id);
if (c) {
MIDIControllable* mc = new MIDIControllable (*_port, *c);
if (mc->set_state (**niter) == 0) {
controllables.insert (mc);
}
if ((prop = (*niter)->property ("id")) != 0) {
ID id = prop->value ();
c = session->controllable_by_id (id);
} else {
warning << string_compose (_("Generic MIDI control: controllable %1 not found (ignored)"), id)
<< endmsg;
if (c) {
MIDIControllable* mc = new MIDIControllable (*_port, *c);
if (mc->set_state (**niter) == 0) {
controllables.insert (mc);
}
} else {
warning << string_compose (_("Generic MIDI control: controllable %1 not found in session (ignored)"),
id)
<< endmsg;
}
}
}
}
} // end autobinding check
return 0;
}

View file

@ -44,6 +44,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
ARDOUR::microseconds_t last_feedback_time;
bool do_feedback;
bool auto_binding;
void _send_feedback ();
void send_feedback ();
@ -59,6 +60,13 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
void stop_learning (PBD::Controllable*);
void learning_stopped (MIDIControllable*);
void create_binding (PBD::Controllable*, int, int);
void delete_binding (PBD::Controllable*);
void auto_binding_on();
void auto_binding_off();
};
#endif /* ardour_generic_midi_control_protocol_h */

View file

@ -63,6 +63,10 @@ class MIDIControllable : public PBD::Stateful
XMLNode& get_state (void);
int set_state (const XMLNode&);
void bind_midi (MIDI::channel_t, MIDI::eventType, MIDI::byte);
MIDI::channel_t get_control_channel () { return control_channel; }
MIDI::eventType get_control_type () { return control_type; }
MIDI::byte get_control_additional () { return control_additional; }
private:
PBD::Controllable& controllable;
MIDI::Port& _port;
@ -86,8 +90,6 @@ class MIDIControllable : public PBD::Stateful
void midi_sense_controller (MIDI::Parser &, MIDI::EventTwoBytes *);
void midi_sense_program_change (MIDI::Parser &, MIDI::byte);
void midi_sense_pitchbend (MIDI::Parser &, MIDI::pitchbend_t);
void bind_midi (MIDI::channel_t, MIDI::eventType, MIDI::byte);
};
#endif // __gm_midicontrollable_h__

View file

@ -1,46 +1,43 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
]>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<chapter id="ch-using-existing-audio">
<title>Using Existing Audio</title>
<para>
There are two primary ways to bring data into Ardour: recording it
within a session from a live sound source or importing pre-existing
audio files. This section covers the various ways to import audio into a
session.
</para>
<para>There are two primary ways to bring data into Ardour: recording it
within a session from a live sound source or importing pre-existing audio
files. This section covers the various ways to import audio into a
session.</para>
<section id="importing-and-embedding">
<title>Importing and Embedding</title>
<para>
Importing and embedding are two different methods of using existing
audio files on your computer (or network file system) within a
session. They differ in one key respect:
</para>
<para>Importing and embedding are two different methods of using existing
audio files on your computer (or network file system) within a session.
They differ in one key respect:</para>
<variablelist>
<title></title>
<varlistentry>
<term>Importing</term>
<listitem>
<para>
An existing audio file is copied to the session's sounds folder,
and is converted into the session's native format (WAVE or
Broadcast WAVE depending on your choice) and sample rate.
</para>
<para>An existing audio file is copied to the session's sounds
folder, and is converted into the session's native format (WAVE or
Broadcast WAVE depending on your choice) and sample rate. At this
time, no control over the conversion process is offered. If sample
rate conversion is required, it will be carried out at the highest
quality that Ardour can provide. This means that it can be rather
slow (many minutes to import an audio file lasting a few
minutes).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Embedding</term>
<listitem>
<para>
An existing audio file is used as a the source for a region, but
is not copied or modified in any way.
</para>
<para>An existing audio file is used as a the source for a region,
but is not copied or modified in any way.</para>
</listitem>
</varlistentry>
</variablelist>
@ -48,395 +45,267 @@
<section id="supported-external-audio-file-formats">
<title>Supported External Audio File Formats</title>
<para>
The list of audio file formats that Ardour can import/embed is quite
long. It is based on the functionality offered by libsndfile, an
excellent and widely used software library by Australian programmer
Erik de Castro Lopo. As libsndfile's capabilities expand, so will
Ardour's abilities to import (and export) new formats. Ogg/Vorbis (an
excellent, unpatented and license free audio compression format
similar to MP3) is planned for the near future. Currently, supported
formats include:
</para>
<para>The list of audio file formats that Ardour can import/embed is quite
long. It is based on the functionality offered by libsndfile, an excellent
and widely used software library by Australian programmer Erik de Castro
Lopo. As libsndfile's capabilities expand, so will Ardour's abilities to
import (and export) new formats. Ogg/Vorbis (an excellent, unpatented and
license free audio compression format similar to MP3) is planned for the
near future. Currently, supported formats include:</para>
<itemizedlist>
<listitem>
<para>
Microsoft WAV
</para>
<para>Microsoft WAV</para>
</listitem>
<listitem>
<para>
SGI/Apple AIFF/AIFC
</para>
<para>SGI/Apple AIFF/AIFC</para>
</listitem>
<listitem>
<para>
Sun AU/Snd
</para>
<para>Sun AU/Snd</para>
</listitem>
<listitem>
<para>
Raw (headerless)
</para>
<para>Raw (headerless)</para>
</listitem>
<listitem>
<para>
Paris Audio File (PAF)
</para>
<para>Paris Audio File (PAF)</para>
</listitem>
<listitem>
<para>
Commodore IFF/SVX
</para>
<para>Commodore IFF/SVX</para>
</listitem>
<listitem>
<para>
Sphere/NIST WAV
</para>
<para>Sphere/NIST WAV</para>
</listitem>
<listitem>
<para>
IRCAM SF
</para>
<para>IRCAM SF</para>
</listitem>
<listitem>
<para>
Creative VOC
</para>
<para>Creative VOC</para>
</listitem>
<listitem>
<para>
SoundForge W64
</para>
<para>SoundForge W64</para>
</listitem>
<listitem>
<para>
GNU Octave MAT4.4
</para>
<para>GNU Octave MAT4.4</para>
</listitem>
<listitem>
<para>
Portable Voice Format
</para>
<para>Portable Voice Format</para>
</listitem>
<listitem>
<para>
Fasttracker 2 XI
</para>
<para>Fasttracker 2 XI</para>
</listitem>
<listitem>
<para>
HMM Tool Kit HTK
</para>
<para>HMM Tool Kit HTK</para>
</listitem>
</itemizedlist>
<para>
Sample encodings supported include:
</para>
<para>Sample encodings supported include:</para>
<itemizedlist>
<listitem>
<para>
Unsigned and signed 8, 16, 24 and 32 bit PCM
</para>
<para>Unsigned and signed 8, 16, 24 and 32 bit PCM</para>
</listitem>
<listitem>
<para>
IEEE 32 and 64 floating point
</para>
<para>IEEE 32 and 64 floating point</para>
</listitem>
<listitem>
<para>
U-LAW
</para>
<para>U-LAW</para>
</listitem>
<listitem>
<para>
A-LAW
</para>
<para>A-LAW</para>
</listitem>
<listitem>
<para>
IMA ADPCM
</para>
<para>IMA ADPCM</para>
</listitem>
<listitem>
<para>
MS ADPCM
</para>
<para>MS ADPCM</para>
</listitem>
<listitem>
<para>
GSM 6.10
</para>
<para>GSM 6.10</para>
</listitem>
<listitem>
<para>
G721/723 ADPCM
</para>
<para>G721/723 ADPCM</para>
</listitem>
<listitem>
<para>
12/16/24 bit DWVW
</para>
<para>12/16/24 bit DWVW</para>
</listitem>
<listitem>
<para>
OK Dialogic ADPCM
</para>
<para>OK Dialogic ADPCM</para>
</listitem>
<listitem>
<para>
8/16 DPCM
</para>
<para>8/16 DPCM</para>
</listitem>
</itemizedlist>
</section>
<section id="using-audio-files">
<title> Using audio files as tracks or regions? </title>
<para>
When you want to use existing audio files in an Ardour session, the
first choice you need to make is whether you want to bring the files
in as tracks or as new regions. Consider the two following scenarios:
</para>
<title>Using audio files as tracks or regions?</title>
<para>When you want to use existing audio files in an Ardour session, the
first choice you need to make is whether you want to bring the files in as
tracks or as new regions. Consider the two following scenarios:</para>
<itemizedlist>
<listitem>
<para>
you have an 8 track recording of existing material, with 1 audio
file per track
</para>
<para>you have an 8 track recording of existing material, with 1 audio
file per track</para>
</listitem>
<listitem>
<para>
you have a sample library containing 500 small audio files
</para>
<para>you have a sample library containing 500 small audio
files</para>
</listitem>
</itemizedlist>
<para>
In the first case, your goal is probably to have 8 tracks (at least),
with each track containing a single audio file. In the second case,
its a lot more likely that you simply want to be able to use any of
the samples easily, but do not want any tracks created as a direct
result of the import/embed. It is very important that you understand
this distinction: many new users think there should be a "simple" way
to import existing audio without understanding that the goal of
importing/embedding is not always the same.
</para>
<para>In the first case, your goal is probably to have 8 tracks (at
least), with each track containing a single audio file. In the second
case, its a lot more likely that you simply want to be able to use any of
the samples easily, but do not want any tracks created as a direct result
of the import/embed. It is very important that you understand this
distinction: many new users think there should be a "simple" way to import
existing audio without understanding that the goal of importing/embedding
is not always the same.</para>
<para>
Ardour provides two different options when importing. You can
import/embed audio files as new tracks, or you can import/embed them
into the region list, where they will be available as regions to put
into new or existing tracks. You can also insert import/embed audio
files directly into an existing track.
</para>
</section>
<section id="importing-an-audio-file-as-a-new-track">
<title> How to import an audio file as a new track </title>
<para>
Click on the <guimenuitem>Edit</guimenuitem> item in the editor's menu
bar. From the popup menu that appears, choose <menuchoice>
<guimenu>Import</guimenu> <guisubmenu>...as new tracks</guisubmenu>
</menuchoice>. The Audio Library/File Chooser window will appear.
After you have made your selection of files to import, click the
button at the bottom of that window (it will say something like
"Import selected regions as new tracks").
</para>
</section>
<section id="embedding-an-audio-file-as-a-new-track">
<title> How to embed an audio file as a new track </title>
<section id="embedding-an-audio-file-drag-and-drop">
<title> Drag-n-Drop </title>
<para>
If you use a file manager such as Nautilus or Konqueror ((basically,
any tool that uses standard "list-of-URL's" encoding for
drag-n-drop)), the simplest method to import files as tracks is to
drag-n-drop. Select the files you want to embed in the file manager,
drag the selection into Ardour and drop it over an area of the
editor's track/arrange display where there are no tracks. The files
will be embedded as 1 new track per file.
</para>
</section>
<section id="embedding-audio-file-using-edit-menu">
<title> Edit menu </title>
<para>
Click on the <guimenuitem>Edit</guimenuitem> item in the editor's
menu bar. From the popup menu that appears, choose <menuchoice>
<guimenu>Embed</guimenu> <guisubmenu>...as new tracks</guisubmenu>
</menuchoice>. The Audio Library/File Chooser window will appear.
After you have made your selection of files to embed, click the
button at the bottom of that window (it will say something like
"Embed selected regions as new tracks"). 1 new track will be created
for each file.
</para>
</section>
</section>
<section id="importing-audio-as-a-new-region">
<title> Importing as a new region </title>
<para></para>
</section>
<section id="embedding-audio-as-a-new-region">
<title> Embedding as a new region </title>
<para></para>
<section id="embedding-audio-drag-and-drop">
<title> Drag-n-Drop </title>
<para></para>
</section>
<section id="embedding-audio-region-list-menu">
<title> Region List Menu </title>
<para></para>
</section>
<para>Ardour provides two different options when importing. You can
import/embed audio files as new tracks, or you can import/embed them into
the region list, where they will be available as regions to put into new
or existing tracks. You can also insert import/embed audio files directly
into an existing track.</para>
</section>
<section id="how-to-import-embed">
<title>How to import/embed</title>
<para>
Begin by clicking on the titlebar of the region list in the editor
window. Select <guimenuitem>Import</guimenuitem> from the menu that
appears, and the Sound File Database will be displayed. See sfdb for
more details on using this dialog.
</para>
<para>
Once you have found and selected the files you want to import, click
the "Import Selected" button on the SFDB dialog. Each selected audio
file will be copied into the session's sounds folder, converted into
the session's native format and sample rate. One or more new regions
will be placed in the "External" section of the region list, either
one per channel of each file or, if "create multichannel regions" was
selected in the SFBD dialog, one per file.
</para>
<para>There are three pathways for importing/embedding an audio file into
a session. One is initiated from the File menu, one is initiated from the
track context menu, and one is initiated from the region list. These
methods are all equivalent: they open the file import dialog. Once the
dialog is open, you can choose to add new audio as new tracks, as regions
in the region list, or as audio in the selected track. You can change this
behavior once the dialog is opened.</para>
<para>
If you use Nautilus as your file manager, you can easily import files
into your project by dragging them onto the desired track, then
releasing the mouse button. The file will then be
<link linkend="gt-embed">embedded</link> into your session.
</para>
<para>
At this time, no control over the conversion process is offered. If
sample rate conversion is required, it will be carried out at the
highest quality that Ardour can provide. This means that it can be
rather slow (many minutes to import an audio file lasting a few
minutes).
</para>
<para><caution>
<para>If you want to import a file directly into an existing track,
you must have the track selected in the editor before beginning the
import. </para>
</caution>If you use Nautilus as your file manager, you can easily
import files into your project by dragging them onto the desired track,
then releasing the mouse button. The file will then be <link
linkend="gt-embed">embedded</link> into your session.</para>
</section>
<section id="how-to-embed-a-file">
<title> How to embed a file </title>
<para>
There are two pathways for embedding an audio file into a session. One
is initiated from the region list, and simply creates one or more new
regions. The other is initiated from a specific track, and not only
adds regions to the region list, but also inserts them into the
track's playlist.
</para>
<title>Working with Tags</title>
<para>A "tag" is bit of information, or <emphasis>metadata</emphasis>,
that is associated with a data file. Specifically, tags are keywords or
terms that you feel have some relevance to a particular soundfile. Ardour
can store these tags in a seachable database so that you can quickly
search for sounds based on the tags that you have assigned to them. For
example you can assign the term "120bpm" to a sound, and then when you
search for this tag, the file will appear in the search list. Tags are
independent of the filename or anything else about the file. Tags, and the
file paths that they are associated with, are stored in a file called
"sfdb" in your Ardour user folder. </para>
<section id="embedding-via-the-region-list">
<title>Embedding via the region list</title>
<title>Adding tags to a file</title>
<orderedlist>
<listitem>
<para>
click with 1 on the region list title bar.
</para>
<para>Select a file in the import dialog.</para>
</listitem>
<listitem>
<para>
Select Import audio file from the menu that appears.
</para>
</listitem>
<listitem>
<para>
The SFDB dialog appears.
</para>
</listitem>
<listitem>
<para>
Select the files you want to import
</para>
</listitem>
<listitem>
<para>
then click on the <guibutton>Embed Selected</guibutton> button.
</para>
<para>Enter the tags in the box to the right labeled "Tags".</para>
</listitem>
</orderedlist>
<para>
New regions are added to the External section of the region list.
</para>
<para>Tags are stored when the input box loses focus, there is no reason
to explicitly "save" them.</para>
</section>
<section id="embedding-from-a-track">
<title>Embedding from a track</title>
<title>Searching for files using tags</title>
<orderedlist>
<listitem>
<para>
in the track you want to add the audiofile to.The track context
menu will appear.
</para>
<para>Select the "Search Tags" tab on the import dialog.</para>
</listitem>
<listitem>
<para>
Select EditInsert external sndfile from this menu. The SFDB
dialog appears.
</para>
</listitem>
<listitem>
<para>
Select the files you want to import
</para>
</listitem>
<listitem>
<para>
then click on the <guibutton>Embed Selected</guibutton> button.
</para>
<para>Enter the tag(s) to search for and press "Search".</para>
</listitem>
</orderedlist>
<para>
New regions are added to the "External" section of the region list,
and one is inserted into the track from which the embed was started.
</para>
<para>Files which have been "tagged" with the input terms will appear in
the results window. You can audition these files and apply tags to them
from this window.</para>
</section>
</section>
<!--
<section id="how-to-embed-a-file">
<title>Searching Freesound for soundfiles (optional)</title>
<para>Freesound (http://freesound.iua.upf.edu/) is an online database with
thousands of soundfiles which can be freely used in many projects (visit
Freesound for the exact licensing terms). Ardour has an option to download
files directly from freesound directly from the import dialog. Freesound
files are tagged with metadata which you can use to search for relevant
sounds.</para>
<para>To enable the Freesound search engine inside Ardour, you must build
Ardour with the option FREESOUND=yes, and you must have the "curl" library
installed. This is currently optional but may later become a standard
feature of Ardour.</para>
<para>To download files from Freesound, you must first register for a
username and password on the freesound website. Enter this information
into the text entry boxes, enter your tags to search for, and then click
"Start Downloading". Ardour will begin downloading files, and the "Start
Downloading" button will change to say "Cancel". Clicking the "Cancel"
button will wait until the currently downloading file is finished, then
the button will switch back to "Start Downloading". The button will also
say "Start Downloading" once Ardour has downloaded all of the files that
match the given tag. In the future there may be better indication of the
file progress and better filtering on the filetypes that are
downloaded.</para>
<para>If you later search for the same terms, you will see that the files
appear in the list more quickly, because any files in the search set that
are already downloaded won't have to be downloaded again.</para>
<para>Sounds that are downloaded from Freesound will automatically be
given tags in Ardour that match their tags in the Freesound database. This
means that once they are downloaded, Ardour can search for the local files
very quickly using the "Search Tags" tab.</para>
</section>
<!--
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="Some_Subsection.xml" />
-->
</chapter>
</chapter>

View file

@ -1,4 +1,4 @@
#ifndef __ardour_svn_revision_h__
#define __ardour_svn_revision_h__
static const char* ardour_svn_revision = "3142";
static const char* ardour_svn_revision = "3201";
#endif