Merge libs/ardour and gtk2_ardour with 2.0-ongoing R2837.

git-svn-id: svn://localhost/ardour2/trunk@2883 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2008-01-10 21:20:59 +00:00
parent 73dd9d37e7
commit bb457bb960
168 changed files with 11821 additions and 5338 deletions

View file

@ -16,7 +16,7 @@ import SCons.Node.FS
SConsignFile()
EnsureSConsVersion(0, 96)
ardour_version = '3.0'
ardour_version = '2.1'
subst_dict = { }
@ -28,26 +28,26 @@ opts = Options('scache.conf')
opts.AddOptions(
('ARCH', 'Set architecture-specific compilation flags by hand (all flags as 1 argument)',''),
BoolOption('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0),
BoolOption('CMT', 'Compile with support for CMT Additions', 1),
BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0),
BoolOption('GTKOSX', 'Compile for use with GTK-OSX, not GTK-X11', 0),
BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 1),
BoolOption('NATIVE_OSX_KEYS', 'Build key bindings file that matches OS X conventions', 0),
BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 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', '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', 0),
BoolOption('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1),
BoolOption('GPROFILE', 'Compile with support for gprofile (Developers only)', 0),
BoolOption('LIBLO', 'Compile with support for liblo library', 1),
BoolOption('NLS', 'Set to turn on i18n support', 1),
PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
BoolOption('SURFACES', 'Build support for control surfaces', 1),
BoolOption('SYSLIBS', 'USE AT YOUR OWN RISK: CANCELS ALL SUPPORT FROM ARDOUR AUTHORS: Use existing system versions of various libraries instead of internal ones', 0),
BoolOption('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 1),
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('GPROFILE', 'Compile with support for gprofile (Developers only)', 0),
BoolOption('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 1)
)
#----------------------------------------------------------------------
@ -65,6 +65,7 @@ class LibraryInfo(Environment):
self.Append (LIBPATH = other.get ('LIBPATH', []))
self.Append (CPPPATH = other.get('CPPPATH', []))
self.Append (LINKFLAGS = other.get('LINKFLAGS', []))
self.Append (CCFLAGS = other.get('CCFLAGS', []))
self.Replace(LIBPATH = list(Set(self.get('LIBPATH', []))))
self.Replace(CPPPATH = list(Set(self.get('CPPPATH',[]))))
#doing LINKFLAGS breaks -framework
@ -402,6 +403,29 @@ else:
os.remove('.personal_use_only')
####################
# push environment
####################
def pushEnvironment(context):
if os.environ.has_key('PATH'):
context.Append(PATH = os.environ['PATH'])
if os.environ.has_key('PKG_CONFIG_PATH'):
context.Append(PKG_CONFIG_PATH = os.environ['PKG_CONFIG_PATH'])
if os.environ.has_key('CC'):
context['CC'] = os.environ['CC']
if os.environ.has_key('CXX'):
context['CXX'] = os.environ['CXX']
if os.environ.has_key('DISTCC_HOSTS'):
context['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
context['ENV']['HOME'] = os.environ['HOME']
pushEnvironment (env)
#######################
# Dependency Checking #
#######################
@ -415,7 +439,7 @@ deps = \
'samplerate' : '0.1.0',
'raptor' : '1.4.2',
'lrdf' : '0.4.0',
'jack' : '0.105.0',
'jack' : '0.101.1',
'libgnomecanvas-2.0' : '2.0'
}
@ -424,16 +448,22 @@ def DependenciesRequiredMessage():
print 'Please consult http://ardour.org/building for more information'
def CheckPKGConfig(context, version):
context.Message( 'Checking for pkg-config version >= %s... ' %version )
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
context.Result( ret )
return ret
context.Message( 'Checking for pkg-config version >= %s... ' %version )
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
context.Result( ret )
return ret
def CheckPKGVersion(context, name, version):
context.Message( 'Checking for %s... ' % name )
ret = context.TryAction('pkg-config --atleast-version=%s %s' %(version,name) )[0]
context.Result( ret )
return ret
context.Message( 'Checking for %s... ' % name )
ret = context.TryAction('pkg-config --atleast-version=%s %s' %(version,name) )[0]
context.Result( ret )
return ret
def CheckPKGExists(context, name):
context.Message ('Checking for %s...' % name)
ret = context.TryAction('pkg-config --exists %s' % name)[0]
context.Result (ret)
return ret
conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
'CheckPKGVersion' : CheckPKGVersion })
@ -473,27 +503,30 @@ libraries['raptor'].ParseConfig('pkg-config --cflags --libs raptor')
libraries['samplerate'] = LibraryInfo()
libraries['samplerate'].ParseConfig('pkg-config --cflags --libs samplerate')
libraries['rubberband'] = LibraryInfo()
#
# chris cannam's rubberband has not yet been released
#
if os.path.exists ('libs/rubberband'):
libraries['rubberband'] = LibraryInfo (LIBS='rubberband',
LIBPATH='#libs/rubberband/lib',
CPPPATH='#libs/rubberband/src',
CXXFLAGS='-DUSE_RUBBERBAND')
conf = env.Configure (custom_tests = { 'CheckPKGExists' : CheckPKGExists } )
if conf.CheckPKGExists ('fftw3f'):
libraries['fftw3f'] = LibraryInfo()
libraries['fftw3f'].ParseConfig('pkg-config --cflags --libs fftw3f')
if conf.CheckPKGExists ('fftw3'):
libraries['fftw3'] = LibraryInfo()
libraries['fftw3'].ParseConfig('pkg-config --cflags --libs fftw3')
env = conf.Finish ()
if env['FFT_ANALYSIS']:
libraries['fftw3f'] = LibraryInfo()
libraries['fftw3f'].ParseConfig('pkg-config --cflags --libs fftw3f')
#
# Check for fftw3 header as well as the library
conf = Configure (libraries['fftw3f'])
if conf.CheckHeader ('fftw3.h') == False:
print "FFT Analysis cannot be compiled without the FFTW3 headers, which don't seem to be installed"
sys.exit (1)
libraries['fftw3f'] = conf.Finish();
#
conf = Configure(libraries['fftw3'])
if conf.CheckHeader ('fftw3.h') == False:
print ('FFT Analysis cannot be compiled without the FFTW3 headers, which do not seem to be installed')
sys.exit (1)
conf.Finish()
libraries['jack'] = LibraryInfo()
libraries['jack'].ParseConfig('pkg-config --cflags --libs jack')
@ -515,12 +548,6 @@ libraries['gtk2'].ParseConfig ('pkg-config --cflags --libs gtk+-2.0')
libraries['pango'] = LibraryInfo()
libraries['pango'].ParseConfig ('pkg-config --cflags --libs pango')
libraries['cairo'] = LibraryInfo()
libraries['cairo'].ParseConfig ('pkg-config --cflags --libs cairo')
libraries['gtk2-unix-print'] = LibraryInfo()
libraries['gtk2-unix-print'].ParseConfig ('pkg-config --cflags --libs gtk+-unix-print-2.0')
libraries['libgnomecanvas2'] = LibraryInfo()
libraries['libgnomecanvas2'].ParseConfig ('pkg-config --cflags --libs libgnomecanvas-2.0')
@ -541,7 +568,7 @@ libraries['gtkmm2ext'] = LibraryInfo (LIBS='gtkmm2ext', LIBPATH='#libs/gtkmm2ext
# SCons should really do this for us
conf = Configure (env)
conf = env.Configure ()
have_cxx = conf.TryAction (Action (str(env['CXX']) + ' --version'))
if have_cxx[0] != 1:
@ -559,9 +586,9 @@ env = conf.Finish()
opt_flags = []
if env['GPROFILE'] == 1:
debug_flags = [ '-O0', '-g', '-pg' ]
debug_flags = [ '-g', '-pg' ]
else:
debug_flags = [ '-O0', '-g' ]
debug_flags = [ '-g' ]
# guess at the platform, used to define compiler flags
@ -728,23 +755,45 @@ if env['LIBLO']:
def prep_libcheck(topenv, libinfo):
if topenv['DIST_TARGET'] == 'panther' or topenv['DIST_TARGET'] == 'tiger':
#
# rationale: GTK-Quartz uses jhbuild and installs to /opt/gtk by default.
# All libraries needed should be built against this location
if topenv['GTKOSX']:
libinfo.Append(CCFLAGS="-I/opt/gtk/include", LINKFLAGS="-L/opt/gtk/lib")
libinfo.Append(CCFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")
#
# rationale: GTK-Quartz uses jhbuild and installs to /opt/gtk by default.
# All libraries needed should be built against this location
if topenv['GTKOSX']:
libinfo.Append(CPPPATH="/opt/gtk/include", LIBPATH="/opt/gtk/lib")
libinfo.Append(CXXFLAGS="-I/opt/gtk/include", LINKFLAGS="-L/opt/gtk/lib")
libinfo.Append(CPPPATH="/opt/local/include", LIBPATH="/opt/local/lib")
libinfo.Append(CXXFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")
prep_libcheck(env, env)
#
# glibc backtrace API, needed everywhere if we want to do shared_ptr<T> debugging
# check for VAMP and rubberband (currently optional)
#
conf = Configure (env)
if conf.CheckCHeader('execinfo.h'):
conf.env.Append(CXXFLAGS="-DHAVE_EXECINFO")
env = conf.Finish ()
libraries['vamp'] = LibraryInfo()
env['RUBBERBAND'] = False
#conf = env.Configure (custom_tests = { 'CheckPKGExists' : CheckPKGExists } )
#
#if conf.CheckPKGExists('vamp-sdk'):
# have_vamp = True
# libraries['vamp'].ParseConfig('pkg-config --cflags --libs vamp-sdk')
#else:
# have_vamp = False
#
#libraries['vamp'] = conf.Finish ()
#
#if have_vamp:
# if os.path.exists ('libs/rubberband/src'):
# conf = Configure (libraries['vamp'])
# if conf.CheckHeader ('fftw3.h'):
# env['RUBBERBAND'] = True
# libraries['rubberband'] = LibraryInfo (LIBS='rubberband',
# LIBPATH='#libs/rubberband',
# CPPPATH='#libs/rubberband',
# CCFLAGS='-DUSE_RUBBERBAND')
# libraries['vamp'] = conf.Finish ()
#
# Check for libusb
@ -771,7 +820,7 @@ libraries['usb'] = conf.Finish ()
libraries['flac'] = LibraryInfo ()
prep_libcheck(env, libraries['flac'])
libraries['flac'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/usr/local/lib")
libraries['flac'].Append(CPPPATH="/usr/local/include", LIBPATH="/usr/local/lib")
#
# june 1st 2007: look for a function that is in FLAC 1.1.2 and not in later versions
@ -780,12 +829,14 @@ libraries['flac'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/usr/local
#
conf = Configure (libraries['flac'])
if conf.CheckLib ('FLAC', 'FLAC__seekable_stream_decoder_set_read_callback', language='CXX'):
if conf.CheckLib ('FLAC', 'FLAC__seekable_stream_decoder_init', language='CXX'):
conf.env.Append(CCFLAGS='-DHAVE_FLAC')
use_flac = True
else:
use_flac = False
libraries['flac'] = conf.Finish ()
# or if that fails...
#libraries['flac'] = LibraryInfo (LIBS='FLAC')
@ -793,7 +844,7 @@ libraries['flac'] = conf.Finish ()
libraries['boost'] = LibraryInfo ()
prep_libcheck(env, libraries['boost'])
libraries['boost'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/usr/local/lib")
libraries['boost'].Append(CPPPATH="/usr/local/include", LIBPATH="/usr/local/lib")
conf = Configure (libraries['boost'])
if conf.CheckHeader ('boost/shared_ptr.hpp', language='CXX') == False:
print "Boost header files do not appear to be installed."
@ -834,17 +885,16 @@ else:
libraries['dmalloc'] = conf.Finish ()
#
# Audio/MIDI library (needed for MIDI, since audio is all handled via JACK. Note, however, that
# we still need ALSA & CoreAudio to discover audio devices for the engine
# dialog, regardless of what MIDI subsystem is being used)
# Audio/MIDI library (needed for MIDI, since audio is all handled via JACK)
#
conf = Configure(env)
# ALSA, for engine dialog
libraries['asound'] = LibraryInfo ()
if conf.CheckCHeader('alsa/asoundlib.h'):
libraries['sysaudio'] = LibraryInfo (LIBS='asound')
elif conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers/CoreAudio.h'):
libraries['sysaudio'] = LibraryInfo (LINKFLAGS= '-framework CoreMIDI -framework CoreFoundation -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox -bind_at_load')
libraries['asound'] = LibraryInfo (LIBS='asound')
if conf.CheckCHeader('jack/midiport.h'):
libraries['sysmidi'] = LibraryInfo (LIBS='jack')
@ -863,14 +913,13 @@ elif conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/Co
if env['GTKOSX']:
# We need Carbon as well as the rest
libraries['sysmidi'] = LibraryInfo (
LINKFLAGS = ' -framework CoreMIDI -framework CoreFoundation -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox -framework Carbon -bind_at_load' )
LINKFLAGS = ' -framework CoreMIDI -framework CoreFoundation -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox -framework Carbon -bind_at_load' )
else:
libraries['sysmidi'] = LibraryInfo (
LINKFLAGS = ' -framework CoreMIDI -framework CoreFoundation -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox -bind_at_load' )
env['SYSMIDI'] = 'CoreMIDI'
subst_dict['%MIDITAG%'] = "ardour"
subst_dict['%MIDITYPE%'] = "coremidi"
print "Using CoreMIDI"
else:
print "It appears you don't have the required MIDI libraries installed. For Linux this means you are missing the development package for ALSA libraries."
sys.exit (1)
@ -883,8 +932,7 @@ if env['SYSLIBS']:
{
'sigc++-2.0' : '2.0',
'gtkmm-2.4' : '2.8',
'libgnomecanvasmm-2.6' : '2.12.0',
'libSoundTouch' : '1.2.1'
'libgnomecanvasmm-2.6' : '2.12.0'
}
conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
@ -912,8 +960,6 @@ if env['SYSLIBS']:
libraries['atkmm'].ParseConfig ('pkg-config --cflags --libs atkmm-1.6')
libraries['pangomm'] = LibraryInfo()
libraries['pangomm'].ParseConfig ('pkg-config --cflags --libs pangomm-1.4')
libraries['cairomm'] = LibraryInfo()
libraries['cairomm'].ParseConfig ('pkg-config --cflags --libs cairomm-1.0')
libraries['libgnomecanvasmm'] = LibraryInfo()
libraries['libgnomecanvasmm'].ParseConfig ('pkg-config --cflags --libs libgnomecanvasmm-2.6')
@ -930,17 +976,16 @@ if env['SYSLIBS']:
# libraries['flowcanvas'] = LibraryInfo(LIBS='flowcanvas', LIBPATH='#/libs/flowcanvas', CPPPATH='#libs/flowcanvas')
libraries['soundtouch'] = LibraryInfo()
libraries['soundtouch'].ParseConfig ('pkg-config --cflags --libs libSoundTouch')
#libraries['soundtouch'].ParseConfig ('pkg-config --cflags --libs soundtouch-1.0')
# Comment the previous line and uncomment this for Debian:
#libraries['soundtouch'].ParseConfig ('pkg-config --cflags --libs libSoundTouch')
libraries['soundtouch'].ParseConfig ('pkg-config --cflags --libs libSoundTouch')
libraries['appleutility'] = LibraryInfo(LIBS='libappleutility',
LIBPATH='#libs/appleutility',
CPPPATH='#libs/appleutility')
coredirs = [
'templates',
'manual'
'templates'
]
subdirs = [
@ -972,10 +1017,7 @@ else:
CPPPATH='#libs/sigc++2')
libraries['glibmm2'] = LibraryInfo(LIBS='glibmm2',
LIBPATH='#libs/glibmm2',
CPPPATH=['#libs/glibmm2/glib', '#libs/glibmm2'])
libraries['cairomm'] = LibraryInfo(LIBS='cairomm',
LIBPATH="#libs/cairomm",
CPPPATH='#libs/cairomm')
CPPPATH='#libs/glibmm2')
libraries['pangomm'] = LibraryInfo(LIBS='pangomm',
LIBPATH='#libs/gtkmm2/pango',
CPPPATH='#libs/gtkmm2/pango')
@ -1006,9 +1048,7 @@ else:
CPPPATH='#libs/appleutility')
coredirs = [
'libs/soundtouch',
'templates',
'manual'
'templates'
]
subdirs = [
@ -1034,7 +1074,6 @@ else:
'libs/gtkmm2/atk',
'libs/gtkmm2/gdk',
'libs/gtkmm2/gtk',
'libs/cairomm',
'libs/libgnomecanvasmm',
# 'libs/flowcanvas',
'libs/gtkmm2ext',
@ -1075,25 +1114,17 @@ else:
env['POWERMATE'] = 0
env['TRANZPORT'] = 0
#
# timestretch libraries
#
timefx_subdirs = ['libs/soundtouch']
#if env['RUBBERBAND']:
# timefx_subdirs += ['libs/rubberband']
opts.Save('scache.conf', env)
Help(opts.GenerateHelpText(env))
if os.environ.has_key('PATH'):
env.Append(PATH = os.environ['PATH'])
if os.environ.has_key('PKG_CONFIG_PATH'):
env.Append(PKG_CONFIG_PATH = os.environ['PKG_CONFIG_PATH'])
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('DISTCC_HOSTS'):
env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
env['ENV']['HOME'] = os.environ['HOME']
final_prefix = '$PREFIX'
if env['DESTDIR'] :
@ -1112,14 +1143,6 @@ else:
config_prefix = '$DESTDIR' + final_config_prefix
# For colorgcc
if os.environ.has_key('PATH'):
env['PATH'] = os.environ['PATH']
if os.environ.has_key('TERM'):
env['TERM'] = os.environ['TERM']
if os.environ.has_key('HOME'):
env['HOME'] = os.environ['HOME']
#
# everybody needs this
#
@ -1174,8 +1197,8 @@ if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Versions/A/
subst_dict['%JACK_INPUT%'] = "coreaudio:Built-in Audio:in"
subst_dict['%JACK_OUTPUT%'] = "coreaudio:Built-in Audio:out"
else:
subst_dict['%JACK_INPUT%'] = "system:playback_"
subst_dict['%JACK_OUTPUT%'] = "system:capture_"
subst_dict['%JACK_INPUT%'] = "alsa_pcm:playback_"
subst_dict['%JACK_OUTPUT%'] = "alsa_pcm:capture_"
# posix_memalign available
if not conf.CheckFunc('posix_memalign'):
@ -1256,7 +1279,7 @@ env.AddPostAction (srcdist, Action ('rm -rf ' + str (File (env['DISTTREE']))))
for subdir in coredirs:
SConscript (subdir + '/SConscript')
for sublistdir in [ subdirs, gtk_subdirs, surface_subdirs ]:
for sublistdir in [ subdirs, timefx_subdirs, gtk_subdirs, surface_subdirs ]:
for subdir in sublistdir:
SConscript (subdir + '/SConscript')

View file

@ -49,12 +49,10 @@ gtkardour.Merge ([
libraries['gtk2'],
libraries['xml'],
libraries['xslt'],
libraries['soundtouch'],
libraries['rubberband'],
libraries['samplerate'],
libraries['jack'],
libraries['sysaudio'],
libraries['cairomm']
libraries['cairomm'],
libraries['asound']
])
gtkmmtests.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
@ -78,17 +76,22 @@ if gtkardour['FFT_ANALYSIS']:
gtkardour.Merge ([libraries['fftw3f']])
gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
if gtkardour['RUBBERBAND']:
gtkardour.Merge ([ libraries['rubberband'], libraries['vamp'], libraries['fftw3f'], libraries['fftw3'] ])
else:
gtkardour.Merge ([ libraries['soundtouch'] ])
skipped_files=Split("""
connection_editor.cc
""")
audiounit_files=Split("""
au_pluginui.cc
au_pluginui.mm
""")
gtkosx_files=Split("""
sync-menu.c
cocoacarbon.c
cocoacarbon.mm
""")
x11_files=Split("""
@ -165,6 +168,7 @@ export_session_dialog.cc
export_region_dialog.cc
export_range_markers_dialog.cc
gain_meter.cc
generic_pluginui.cc
ghostregion.cc
gtk-custom-hruler.c
gtk-custom-ruler.c
@ -172,7 +176,6 @@ io_selector.cc
port_matrix.cc
keyboard.cc
keyeditor.cc
ladspa_pluginui.cc
latency_gui.cc
level_meter.cc
location_ui.cc
@ -183,6 +186,7 @@ mixer_ui.cc
new_session_dialog.cc
option_editor.cc
opts.cc
panner.cc
panner2d.cc
panner_ui.cc
@ -230,6 +234,10 @@ icon_files = glob.glob ('icons/*.png')
intl_files = gtkardour_files + glob.glob('*.h')
evtest_files=Split("""
evtest.cc
""")
mtest_files=Split("""
mtest.cc
""")
@ -274,21 +282,23 @@ marker_view.cc
visual_time_axis.cc
""")
if env['CMT']:
extra_sources += cmt_files
gtkardour.Append (CCFLAGS="-DWITH_CMT")
#if env['CMT']:
# extra_sources += cmt_files
# gtkardour.Append (CCFLAGS="-DWITH_CMT")
if gtkardour['GTKOSX']:
extra_sources += gtkosx_files
gtkardour.Append (CCFLAGS="-DTOP_MENUBAR -DGTKOSX")
extra_sources += gtkosx_files
gtkardour.Append (CCFLAGS="-DTOP_MENUBAR -DGTKOSX")
gtkardour.Append (LINKFLAGS=" -framework AppKit -framework CoreAudioKit")
if gtkardour['AUDIOUNITS']:
extra_sources += audiounit_files
gtkardour.Append(CCFLAGS='-DHAVE_AUDIOUNITS')
gtkardour.Merge([libraries['appleutility']])
else:
extra_sources += x11_files
if gtkardour['AUDIOUNITS']:
extra_sources += audiounit_files
gtkardour.Append(CCFLAGS='-DHAVE_AUDIOUNITS')
gtkardour.Append(LINKFLAGS='-framework Carbon')
gtkardour.Merge([libraries['appleutility']])
if env['FFT_ANALYSIS']:
extra_sources += fft_analysis_files
@ -307,6 +317,7 @@ executable = 'ardour-' + ardour_version
ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
ardourlib = gtkardour.SharedLibrary(target = 'ardourgtk', source = gtkardour_files + extra_sources)
evest = gtkmmtests.Program(target = 'evtest', source = evtest_files)
mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
itest = gtkardour.Program(target = 'itest', source = itest_files)
rcu = gtkardour.Program(target = 'rcu', source = rcu_files)
@ -396,7 +407,30 @@ my_subst_dict = { }
# null substitution just to avoid ardour.bindings being in svn
#
ardourbindings = env.SubstInFile ('ardour.bindings', 'ardour.bindings.in', SUBST_DICT = my_subst_dict);
keybindings_dict = { }
if gtkardour['GTKOSX'] and gtkardour['NATIVE_OSX_KEYS']:
#
# Command(Mod1), Alt(Mod5), Ctrl, Shift
#
keybindings_dict['%PRIMARY%'] = 'Mod5'
keybindings_dict['%SECONDARY%'] = 'Alt'
keybindings_dict['%TERTIARY%'] = 'Shift'
keybindings_dict['%LEVEL4%'] = 'Ctrl'
keybindings_dict['%WINDOW%'] = 'Mod5'
else:
#
# Ctrl, Alt, Shift, Mod3(Meta)
#
keybindings_dict['%PRIMARY%'] = 'Ctrl'
keybindings_dict['%SECONDARY%'] = 'Alt'
keybindings_dict['%TERTIARY%'] = 'Shift'
keybindings_dict['%LEVEL4%'] = 'Mod2'
keybindings_dict['%WINDOW%'] = 'Ctrl'
ardourbindings = env.SubstInFile ('ardour.bindings', 'ardour.bindings.in', SUBST_DICT = keybindings_dict);
ardoursaeDEbindings = env.SubstInFile ('ardour-sae-de.bindings', 'ardour-sae-de.bindings.in', SUBST_DICT = keybindings_dict);
ardoursaeANSIbindings = env.SubstInFile ('ardour-sae-ansi.bindings', 'ardour-sae-ansi.bindings.in', SUBST_DICT = keybindings_dict);
my_subst_dict['%INSTALL_PREFIX%'] = final_prefix
my_subst_dict['%LIBDIR%'] = env['LIBDIR']
@ -409,6 +443,8 @@ ardourdev = env.SubstInFile ('ardev_common.sh','ardev_common.sh.in', SUBST_DICT
env.AddPostAction (ardourdev, Chmod ('$TARGET', 0755))
Default(ardourbindings)
Default(ardoursaeDEbindings)
Default(ardoursaeANSIbindings)
Default(ardourdev)
Default(ardoursh)
Default(ardour_dark_theme)
@ -441,7 +477,8 @@ env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), ardour_
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour-sae.menus'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.bindings'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui_default.conf'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour-sae-ansi.bindings'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour-sae-de.bindings'))
# data files
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2'), 'splash.png'))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'pixmaps'), pixmap_files))
@ -457,9 +494,11 @@ env.Alias ('tarball', env.Distribute (env['DISTTREE'],
'ardev_common.sh.in',
'ardev', 'ardbg',
'ardour2_ui_dark.rc.in', 'ardour2_ui_light.rc.in', 'splash.png',
'ardour.menus',
'ardour-sae.menus',
'ardour.bindings.in', 'ardour2_ui_default.conf',
'ardour.menus', 'ardour-sae.menus',
'ardour.bindings.in',
'ardour-sae-ansi.bindings.in',
'ardour-sae-de.bindings.in',
'ardour2_ui_default.conf',
'editor_xpms'
] +
gtkardour_files +

View file

@ -19,6 +19,7 @@
#include <vector>
#include <string>
#include <list>
#include <gtk/gtkaccelmap.h>
#include <gtk/gtkuimanager.h>
@ -150,6 +151,14 @@ ActionManager::lookup_entry (const ustring accel_path, Gtk::AccelKey& key)
return known;
}
struct SortActionsByLabel {
bool operator() (Glib::RefPtr<Gtk::Action> a, Glib::RefPtr<Gtk::Action> b) {
ustring astr = a->get_accel_path();
ustring bstr = b->get_accel_path();
return astr < bstr;
}
};
void
ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, vector<string>& keys, vector<AccelKey>& bindings)
{
@ -162,18 +171,29 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
GList* acts;
for (node = list; node; node = g_list_next (node)) {
GtkActionGroup* group = (GtkActionGroup*) node->data;
/* first pass: collect them all */
typedef std::list<Glib::RefPtr<Gtk::Action> > action_list;
action_list the_acts;
for (acts = gtk_action_group_list_actions (group); acts; acts = g_list_next (acts)) {
GtkAction* action = (GtkAction*) acts->data;
the_acts.push_back (Glib::wrap (action, true));
}
/* now sort by label */
SortActionsByLabel cmp;
the_acts.sort (cmp);
Glib::RefPtr<Action> act = Glib::wrap (action, true);
for (action_list::iterator a = the_acts.begin(); a != the_acts.end(); ++a) {
string accel_path = (*a)->get_accel_path ();
ustring label = (*a)->property_label();
string accel_path = act->get_accel_path ();
ustring label = act->property_label();
names.push_back (label);
paths.push_back (accel_path);

View file

@ -25,6 +25,7 @@
#include <pbd/error.h>
#include <pbd/convert.h>
#include <gtkmm2ext/utils.h>
#include <ardour/profile.h>
#include "utils.h"
#include "add_route_dialog.h"
@ -67,10 +68,27 @@ AddRouteDialog::AddRouteDialog ()
{
if (channel_combo_strings.empty()) {
channel_combo_strings = I18N (channel_setup_names);
if (ARDOUR::Profile->get_sae()) {
/* remove all but the first two (Mono & Stereo) */
while (track_mode_strings.size() > 2) {
track_mode_strings.pop_back();
}
}
}
if (track_mode_strings.empty()) {
track_mode_strings = I18N (track_mode_names);
if (ARDOUR::Profile->get_sae()) {
/* remove all but the first track mode (Normal) */
while (track_mode_strings.size() > 1) {
track_mode_strings.pop_back();
}
}
}
set_name ("AddRouteDialog");
@ -121,7 +139,9 @@ AddRouteDialog::AddRouteDialog ()
ccframe.set_shadow_type (SHADOW_IN);
dvbox->pack_start (channel_combo, true, false, 5);
dvbox->pack_start (track_mode_combo, true, false, 5);
if (!ARDOUR::Profile->get_sae()) {
dvbox->pack_start (track_mode_combo, true, false, 5);
}
dhbox->pack_start (*dvbox, true, false, 5);
ccframe.add (*dhbox);
@ -198,6 +218,10 @@ AddRouteDialog::count ()
ARDOUR::TrackMode
AddRouteDialog::mode ()
{
if (ARDOUR::Profile->get_sae()) {
return ARDOUR::Normal;
}
Glib::ustring str = track_mode_combo.get_active_text();
if (str == _("Normal")) {
return ARDOUR::Normal;

View file

@ -7,10 +7,10 @@ export GTK_PATH=libs/clearlooks
export ARDOUR_SURFACES_PATH=libs/surfaces/frontier:libs/surfaces/generic_midi:libs/surfaces/mackie:libs/surfaces/tranzport
export LD_LIBRARY_PATH=libs/surfaces/control_protocol:libs/ardour:libs/midi++2:libs/pbd:libs/soundtouch:libs/gtkmm2ext:libs/sigc++2:libs/glibmm2:libs/gtkmm2/atk:libs/gtkmm2/pango:libs/gtkmm2/gdk:libs/gtkmm2/gtk:libs/libgnomecanvasmm:libs/libsndfile:libs/appleutility:libs/cairomm:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=libs/surfaces/control_protocol:libs/ardour:libs/midi++2:libs/pbd:libs/rubberband:libs/soundtouch:libs/gtkmm2ext:libs/sigc++2:libs/glibmm2:libs/gtkmm2/atk:libs/gtkmm2/pango:libs/gtkmm2/gdk:libs/gtkmm2/gtk:libs/libgnomecanvasmm:libs/libsndfile:libs/appleutility:$LD_LIBRARY_PATH
# DYLD_LIBRARY_PATH is for darwin.
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
# For the internal clearlooks engine
export GTK_PATH=$PWD/libs/clearlooks:~/.ardour2

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

@ -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" "<%SECONDARY%>z")
; (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" "asciicircum")
(gtk_accel_path "<Actions>/Editor/cycle-edit-point-with-marker" "<%SECONDARY%>asciicircum")
(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" "<%PRIMARY%>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" "<%PRIMARY%>w")
(gtk_accel_path "<Actions>/Main/New" "<%PRIMARY%>n")
(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" "<%LEVEL4%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-start" "<%LEVEL4%><%SECONDARY%>less")
; (gtk_accel_path "<Actions>/Main/Export" "<%PRIMARY%>e")
(gtk_accel_path "<Actions>/Editor/jump-forward-to-mark" "<%PRIMARY%>KP_6")
; (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%><%TERTIARY%>n")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-end-relative" "<%PRIMARY%>less")
; (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_4")
; (gtk_accel_path "<Actions>/Main/AudioFileFormatData" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFastest" "")
(gtk_accel_path "<Actions>/Editor/audition-at-mouse" "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" "less")
(gtk_accel_path "<Actions>/Editor/align-regions-sync" "<%SECONDARY%>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" "y")
; (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" "<%PRIMARY%><%TERTIARY%>a")
; (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" "x")
; (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" "<%PRIMARY%>e")
(gtk_accel_path "<Actions>/Editor/select-all" "<%PRIMARY%>a")
(gtk_accel_path "<Actions>/Editor/invert-selection" "<%TERTIARY%>i")
(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%>End")
(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" "<%TERTIARY%>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" "<%PRIMARY%>o")
; (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" "<%PRIMARY%>e")
; (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" "<%TERTIARY%>Home")
; (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" "<%PRIMARY%>o")
; (gtk_accel_path "<Actions>/Editor/PullupMinus4" "")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<%PRIMARY%>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" "<%PRIMARY%>b")
(gtk_accel_path "<Actions>/Common/ToggleKeyEditor" "<%PRIMARY%>k")
; (gtk_accel_path "<Actions>/Snap/snap-to-asixteenthbeat" "")
(gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<%TERTIARY%>p")
; (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_Insert")
(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" "<%PRIMARY%><%TERTIARY%>s")
; (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" "<%PRIMARY%>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" "<%PRIMARY%>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" "<%PRIMARY%><%TERTIARY%>o")
; (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" "<%TERTIARY%>z")
(gtk_accel_path "<Actions>/Editor/zoom-to-region" "z")

View file

@ -6,30 +6,36 @@
<menuitem action='Open'/>
<menuitem action='Recent'/>
<menuitem action='Close'/>
<menuitem action='Quit'/>
<separator/>
<menuitem action='Save'/>
<menuitem action='Snapshot'/>
<menuitem action='SaveTemplate'/>
<separator/>
<menuitem action='AddTrackBus'/>
<menu name='Files' action='Files'>
<menuitem action='addExistingAudioFiles'/>
<separator/>
<menuitem action='ExportSession'/>
</menu>
<separator/>
<menu name='Cleanup' action='Cleanup'>
<menuitem action='CleanupUnused'/>
<menuitem action='FlushWastebasket'/>
</menu>
<menuitem action='ToggleOptionsEditor'/>
<menuitem action='About'/>
</menu>
<menu name='Files' action='Files'>
<menuitem action='addExistingAudioFiles'/>
<separator/>
<menuitem action='ExportSession'/>
<menuitem action='ExportSelection'/>
<menuitem action='ExportRangeMarkers'/>
</menu>
<menu name='Transport' action='Transport'>
<menuitem action='ToggleRoll'/>
<menuitem action='play-from-edit-point-and-return'/>
<menuitem action='play-edit-range'/>
<menuitem action='record-roll'/>
<menuitem action='ToggleRollForgetCapture'/>
<menuitem action='Loop'/>
<menuitem action='PlaySelection'/>
<menuitem action='loop-region'/>
<menuitem action='set-playhead'/>
<menuitem action='Forward'/>
<menuitem action='Rewind'/>
@ -46,28 +52,38 @@
<menuitem action='jump-backward-to-mark'/>
<menuitem action='add-location-from-playhead'/>
<separator/>
<menuitem action='playhead-to-next-region-start'/>
<menuitem action='playhead-to-next-region-end'/>
<menuitem action='playhead-to-previous-region-start'/>
<menuitem action='playhead-to-previous-region-end'/>
<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'/>
<separator/>
<menuitem action='playhead-to-edit'/>
<separator/>
<menuitem action='playhead-to-range-start'/>
<menuitem action='playhead-to-range-end'/>
<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='focus-on-clock'/>
<separator/>
<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'/>
<separator/>
<menuitem action='set-loop-from-edit-range'/>
<menuitem action='set-loop-from-region'/>
<menuitem action='set-punch-from-edit-range'/>
<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'/>
</menu>
</menu>
<menu name='Edit' action='Edit'>
<menuitem action='undo'/>
@ -77,22 +93,33 @@
<menuitem action='editor-copy'/>
<menuitem action='editor-paste'/>
<menuitem action='set-edit-point'/>
<menuitem action='editor-separate'/>
<separator/>
<menuitem action='remove-last-capture'/>
<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-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'/>
<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='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'/>
<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>
<menu name='KeyMouse Actions' action='KeyMouse Actions'>
<menuitem action='audition-at-mouse'/>
<menuitem action='play-selected-regions'/>
<menuitem action='brush-at-mouse'/>
<menuitem action='mute-unmute-region'/>
<separator/>
@ -101,28 +128,12 @@
<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'/>
</menu>
<separator/>
<menuitem action='ToggleOptionsEditor'/>
</menu>
<menu name='Select' action='Select'>
<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='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'/>
</menu>
<menu name='Regions' action='Regions'>
<menuitem action='crop'/>
<menuitem action='duplicate-region'/>
@ -130,9 +141,7 @@
<menuitem action='normalize-region'/>
<separator/>
<menuitem action="nudge-forward"/>
<menuitem action="nudge-next-forward"/>
<menuitem action="nudge-backward"/>
<menuitem action="nudge-next-backward"/>
<menuitem action='split-region'/>
<menuitem action='set-region-sync-position'/>
<separator/>
@ -144,28 +153,33 @@
<menuitem action='align-regions-sync-relative'/>
<separator/>
<menuitem action='set-fade-in-length'/>
<menuitem action='toggle-fade-in-active'/>
<menuitem action='set-fade-out-length'/>
<menuitem action='toggle-fade-out-active'/>
<separator/>
<menuitem action='trim-from-start'/>
<menuitem action='trim-to-end'/>
<menuitem action='trim-front'/>
<menuitem action='trim-back'/>
<menuitem action='trim-region-to-loop'/>
<menuitem action='trim-region-to-punch'/>
<separator/>
<menuitem action='pitch-shift-region'/>
</menu>
<menu name='View' action = 'View'>
<menuitem action='ToggleMaximalEditor'/>
<separator/>
<menu name='ZoomFocus' action='ZoomFocus'>
<menuitem action='zoom-focus-left'/>
<menuitem action='zoom-focus-right'/>
<menuitem action='zoom-focus-center'/>
<menuitem action='zoom-focus-playhead'/>
<menuitem action='zoom-focus-edit'/>
<menuitem action='zoom-focus-mouse'/>
</menu>
<menu name='SnapMode' action='SnapMode'>
<menuitem action='snap-off'/>
<menuitem action='snap-normal'/>
<menuitem action='snap-magnetic'/>
<separator/>
<menuitem action='cycle-snap-mode'/>
</menu>
<menu name='SnapTo' action='SnapTo'>
<menuitem action='snap-to-frame'/>
<menuitem action='snap-to-cd-frame'/>
<menuitem action='snap-to-smpte-frame'/>
<menuitem action='snap-to-smpte-seconds'/>
@ -180,17 +194,18 @@
<menuitem action='snap-to-beat'/>
<menuitem action='snap-to-bar'/>
<menuitem action='snap-to-mark'/>
<menuitem action='snap-to-edit-cursor'/>
<menuitem action='snap-to-region-start'/>
<menuitem action='snap-to-region-end'/>
<menuitem action='snap-to-region-sync'/>
<menuitem action='snap-to-region-boundary'/>
<menuitem action='cycle-snap-choice'/>
</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'/>
@ -205,77 +220,24 @@
<separator/>
<menuitem action='show-editor-mixer'/>
<menuitem action='SyncEditorAndMixerTrackOrder'/>
<menuitem action='ToggleMeasureVisibility'/>
<menuitem action='ToggleLogoVisibility'/>
</menu>
<menu name='JACK' action='JACK'>
<menuitem action='JACKDisconnect'/>
<menuitem action='JACKReconnect'/>
<menu name='Latency' action='Latency'>
<menuitem action='JACKLatency32'/>
<menuitem action='JACKLatency64'/>
<menuitem action='JACKLatency128'/>
<menuitem action='JACKLatency256'/>
<menuitem action='JACKLatency512'/>
<menuitem action='JACKLatency1024'/>
<menuitem action='JACKLatency2048'/>
<menuitem action='JACKLatency4096'/>
<menuitem action='JACKLatency8192'/>
</menu>
</menu>
<menu name='Windows' action = 'Windows'>
<menuitem action='ToggleMaximalEditor'/>
<separator/>
<menuitem action='goto-editor'/>
<menuitem action='goto-mixer'/>
<menuitem action='ToggleInspector'/>
<menuitem action='ToggleLocations'/>
<menuitem action='ToggleKeyEditor'/>
<menuitem action='ToggleThemeManager'/>
<menuitem action='ToggleBigClock'/>
<separator/>
</menu>
<menu name='Options' action='Options'>
<menu action='AudioFileFormat'>
<menu action='AudioFileFormatData'>
<menuitem action='FileDataFormatFloat'/>
<menuitem action='FileDataFormat24bit'/>
<menuitem action='FileDataFormat16bit'/>
</menu>
<menu action='AudioFileFormatHeader'>
<menuitem action='FileHeaderFormatBWF'/>
<menuitem action='FileHeaderFormatWAVE'/>
<menuitem action='FileHeaderFormatWAVE64'/>
<menuitem action='FileHeaderFormatCAF'/>
</menu>
</menu>
<menu action='Monitoring'>
<menuitem action='UseHardwareMonitoring'/>
<menuitem action='UseSoftwareMonitoring'/>
<menuitem action='UseExternalMonitoring'/>
</menu>
<menu action='Metering'>
<menu action='MeteringFallOffRate'>
<menuitem action='MeterFalloffOff'/>
<menuitem action='MeterFalloffSlowest'/>
<menuitem action='MeterFalloffSlow'/>
<menuitem action='MeterFalloffMedium'/>
<menuitem action='MeterFalloffFast'/>
<menuitem action='MeterFalloffFaster'/>
<menuitem action='MeterFalloffFastest'/>
</menu>
<menu action='MeteringHoldTime'>
<menuitem action='MeterHoldOff'/>
<menuitem action='MeterHoldShort'/>
<menuitem action='MeterHoldMedium'/>
<menuitem action='MeterHoldLong'/>
</menu>
</menu>
<menu action='Solo'>
<menuitem action='LatchedSolo'/>
</menu>
<menuitem action='LatchedSolo'/>
<menuitem action='link-region-and-track-selection'/>
</menu>
<menu name='Help' action='Help'>
<menuitem action='About'/>
</menu>
</menubar>
<popup name='redirectmenu'>

View file

@ -2,29 +2,31 @@
; this file is an automated accelerator map dump
;
; (gtk_accel_path "<Actions>/RegionList/RegionListSort" "")
(gtk_accel_path "<Actions>/Common/Quit" "<Control>q")
(gtk_accel_path "<Actions>/Common/Save" "<Control>s")
(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/playhead-to-previous-region-end" "<Control>comma")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "comma")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-sync" "<%PRIMARY%>comma")
; (gtk_accel_path "<Actions>/processormenu/copy" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFaster" "")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<Control>space")
(gtk_accel_path "<Actions>/Transport/Record" "<Shift>r")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>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>/processormenu/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>/options/ABAllPlugins" "<Control><Alt>p")
; (gtk_accel_path "<Actions>/RegionList/rlHide" "")
; (gtk_accel_path "<Actions>/Main/Metering" "")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-end" "<Control>period")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-sync" "<%PRIMARY%>period")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-playhead" "")
; (gtk_accel_path "<Actions>/Editor/center-edit-cursor" "")
; (gtk_accel_path "<Actions>/Editor/Monitoring" "")
@ -35,19 +37,19 @@
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-start" "bracketleft")
; (gtk_accel_path "<Actions>/Main/Close" "")
; (gtk_accel_path "<Actions>/Main/New" "")
(gtk_accel_path "<Actions>/Editor/nudge-next-backward" "<Control>KP_Subtract")
(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" "<Shift>a")
(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" "<Control>KP_Right")
(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" "")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<Control><Mod2>a")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<%PRIMARY%><%LEVEL4%>a")
; (gtk_accel_path "<Actions>/JACK/JACKDisconnect" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFast" "")
; (gtk_accel_path "<Actions>/options/FileDataFormatFloat" "")
@ -59,16 +61,16 @@
; (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" "<Control>KP_Left")
(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/audition-at-mouse" "")
(gtk_accel_path "<Actions>/Transport/Forward" "<Control>rightarrow")
(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" "<Control>v")
(gtk_accel_path "<Actions>/Editor/editor-paste" "<%PRIMARY%>v")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down")
; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-minutes" "")
; (gtk_accel_path "<Actions>/Main/FlushWastebasket" "")
@ -82,10 +84,9 @@
; (gtk_accel_path "<Actions>/options/MeterHoldOff" "")
; (gtk_accel_path "<Actions>/options/OutputAutoConnectMaster" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency64" "")
(gtk_accel_path "<Actions>/Editor/undo" "<Control>z")
(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>/Editor/edit-cursor-to-next-region-start" "bracketright")
; (gtk_accel_path "<Actions>/Snap/snap-to-region-start" "")
; (gtk_accel_path "<Actions>/Editor/View" "")
; (gtk_accel_path "<Actions>/Editor/Layering" "")
@ -94,7 +95,6 @@
(gtk_accel_path "<Actions>/Editor/set-edit-point" "e")
; (gtk_accel_path "<Actions>/Editor/Smpte30drop" "")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-edit" "")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-start" "comma")
; (gtk_accel_path "<Actions>/Editor/EditCursorMovementOptions" "")
; (gtk_accel_path "<Actions>/processormenu/activate_all" "")
; (gtk_accel_path "<Actions>/Editor/addExternalAudioAsTapeTrack" "")
@ -112,14 +112,14 @@
; (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/scroll-backward" "leftarrow")
(gtk_accel_path "<Actions>/Editor/start-range" "F1")
(gtk_accel_path "<Actions>/Editor/start-range" "<%PRIMARY%>KP_Down")
; (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" "<Shift>rightarrow")
(gtk_accel_path "<Actions>/Editor/scroll-playhead-forward" "<%TERTIARY%>rightarrow")
(gtk_accel_path "<Actions>/Editor/align-regions-sync-relative" "a")
; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
(gtk_accel_path "<Actions>/Editor/crop" "c")
@ -128,63 +128,62 @@
; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "")
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
(gtk_accel_path "<Actions>/Transport/GotoStart" "Home")
(gtk_accel_path "<Actions>/Editor/scroll-playhead-backward" "<Shift>leftarrow")
(gtk_accel_path "<Actions>/Editor/scroll-playhead-backward" "<%TERTIARY%>leftarrow")
(gtk_accel_path "<Actions>/Editor/split-region" "s")
; (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>/Editor/align-regions-sync" "<Mod2>a")
(gtk_accel_path "<Actions>/Editor/align-regions-sync" "<%LEVEL4%>a")
; (gtk_accel_path "<Actions>/Main/Windows" "")
; (gtk_accel_path "<Actions>/Main/CleanupUnused" "")
; (gtk_accel_path "<Actions>/processormenu/deselectall" "")
; (gtk_accel_path "<Actions>/options/SoloViaBus" "")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "z")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "<Shift>z")
; (gtk_accel_path "<Actions>/RegionList/rlAudition" "")
(gtk_accel_path "<Actions>/Editor/set-region-sync-position" "v")
; (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" "<Control>x")
(gtk_accel_path "<Actions>/Editor/editor-cut" "<%PRIMARY%>x")
; (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" "<Alt>e")
(gtk_accel_path "<Actions>/Editor/select-all" "<Control>a")
(gtk_accel_path "<Actions>/Editor/nudge-next-forward" "<Control>KP_Add")
(gtk_accel_path "<Actions>/Common/goto-editor" "<%WINDOW%>e")
(gtk_accel_path "<Actions>/Editor/select-all" "<%PRIMARY%>a")
(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" "<Shift><Control>p")
(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" "<Shift><Control>e")
(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" "F3")
(gtk_accel_path "<Actions>/Editor/finish-range" "<%PRIMARY%>KP_Up")
(gtk_accel_path "<Actions>/Transport/Loop" "l")
; (gtk_accel_path "<Actions>/Editor/CrossfadesFull" "")
(gtk_accel_path "<Actions>/Editor/finish-add-range" "<Shift><Control>KP_Up")
(gtk_accel_path "<Actions>/Editor/finish-add-range" "<%TERTIARY%><%PRIMARY%>KP_Up")
; (gtk_accel_path "<Actions>/Transport/ToggleClick" "")
; (gtk_accel_path "<Actions>/options/SendMTC" "")
; (gtk_accel_path "<Actions>/Transport/TogglePunchOut" "")
(gtk_accel_path "<Actions>/Editor/select-all-in-loop-range" "<Control>l")
(gtk_accel_path "<Actions>/Editor/show-editor-mixer" "<Shift>e")
(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>/Editor/show-editor-list" "<Shift>l")
; (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" "<Control>uparrow")
(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" "<Alt>Return")
(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" "")
@ -196,20 +195,20 @@
; (gtk_accel_path "<Actions>/Transport/ToggleAutoReturn" "")
; (gtk_accel_path "<Actions>/Editor/Smpte2997" "")
; (gtk_accel_path "<Actions>/Editor/ToggleWaveformVisibility" "")
(gtk_accel_path "<Actions>/Editor/redo" "<Control>r")
(gtk_accel_path "<Actions>/Editor/redo" "<%PRIMARY%>r")
; (gtk_accel_path "<Actions>/Editor/addExternalAudioAsRegion" "")
; (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" "minus")
; (gtk_accel_path "<Actions>/JACK/Latency" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-end" "<Shift>F2")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-end" "F2")
; (gtk_accel_path "<Actions>/processormenu/rename" "")
; (gtk_accel_path "<Actions>/RegionList/rlShowAuto" "")
(gtk_accel_path "<Actions>/Editor/select-all-before-playhead" "<Control>p")
(gtk_accel_path "<Actions>/Editor/select-all-before-playhead" "<%PRIMARY%>p")
; (gtk_accel_path "<Actions>/Editor/addExistingAudioFiles" "")
; (gtk_accel_path "<Actions>/Main/Session" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-start" "<Shift>F1")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-start" "F1")
; (gtk_accel_path "<Actions>/Main/AudioFileFormat" "")
; (gtk_accel_path "<Actions>/Transport/Transport" "")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-timefx" "t")
@ -219,37 +218,37 @@
(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" "<Control>downarrow")
(gtk_accel_path "<Actions>/Transport/TransitionToReverse" "<%PRIMARY%>downarrow")
; (gtk_accel_path "<Actions>/Editor/Crossfades" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4" "")
(gtk_accel_path "<Actions>/Editor/add-location-from-playhead" "KP_Enter")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-end" "<Control>bracketleft")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-end" "<%PRIMARY%>bracketleft")
; (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" "<Control>o")
(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%WINDOW%>o")
; (gtk_accel_path "<Actions>/Editor/PullupMinus4" "")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<Alt>m")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<%WINDOW%>m")
; (gtk_accel_path "<Actions>/Editor/addExternalAudioToTrack" "")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileCreationDate" "")
; (gtk_accel_path "<Actions>/processormenu/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>/Editor/addExternalAudioAsTrack" "")
(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<Alt>b")
(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" "<Control>d")
(gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<%PRIMARY%>d")
; (gtk_accel_path "<Actions>/processormenu/edit" "")
(gtk_accel_path "<Actions>/Editor/duplicate-region" "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" "<Control>Delete")
(gtk_accel_path "<Actions>/Editor/remove-last-capture" "<%PRIMARY%>Delete")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatWAVE" "")
(gtk_accel_path "<Actions>/Transport/GotoZero" "KP_Insert")
(gtk_accel_path "<Actions>/Transport/GotoZero" "KP_0")
(gtk_accel_path "<Actions>/Transport/GotoEnd" "End")
; (gtk_accel_path "<Actions>/processormenu/cut" "")
; (gtk_accel_path "<Actions>/processormenu/newinsert" "")
@ -265,28 +264,28 @@
; (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" "<Alt>c")
(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" "<Control>b")
(gtk_accel_path "<Actions>/Editor/brush-at-mouse" "<%PRIMARY%>b")
; (gtk_accel_path "<Actions>/RegionList/rlShowAll" "")
(gtk_accel_path "<Actions>/Transport/Rewind" "<Control>leftarrow")
(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>/Editor/step-tracks-up" "uparrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-start" "period")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "period")
; (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" "<Control>e")
(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" "<Alt>l")
(gtk_accel_path "<Actions>/Common/ToggleLocations" "<%WINDOW%>l")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurface" "")
(gtk_accel_path "<Actions>/Editor/editor-delete" "Delete")
; (gtk_accel_path "<Actions>/JACK/JACKLatency256" "")
@ -300,7 +299,7 @@
; (gtk_accel_path "<Actions>/Snap/snap-to-bar" "")
; (gtk_accel_path "<Actions>/Editor/LayerLaterHigher" "")
; (gtk_accel_path "<Actions>/processormenu/selectall" "")
(gtk_accel_path "<Actions>/Editor/editor-copy" "<Control>c")
(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" "equal")
; (gtk_accel_path "<Actions>/options/UseSoftwareMonitoring" "")
@ -313,13 +312,35 @@
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceFeedback" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4Minus1" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency512" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-end" "<Control>bracketright")
; (gtk_accel_path "<Actions>/Main/Recent" "")
; (gtk_accel_path "<Actions>/processormenu/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/cycle-edit-point" "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>/Editor/set-fade-in-length" "slash")
(gtk_accel_path "<Actions>/Editor/set-fade-out-length" "backslash")
(gtk_accel_path "<Actions>/Editor/trim-from-start" "<Shift>braceleft")
(gtk_accel_path "<Actions>/Editor/trim-to-end" "<Shift>braceright")
(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/toggle-zoom" "<%TERTIARY%>z")
(gtk_accel_path "<Actions>/Editor/zoom-to-region" "z")

View file

@ -30,9 +30,14 @@
</menu>
<menu name='Transport' action='Transport'>
<menuitem action='ToggleRoll'/>
<menuitem action='play-from-edit-point-and-return'/>
<menuitem action='play-edit-range'/>
<menuitem action='record-roll'/>
<menuitem action='ToggleRollForgetCapture'/>
<menuitem action='Loop'/>
<menuitem action='loop-region'/>
<menuitem action='PlaySelection'/>
<menuitem action='play-edit-range'/>
<menuitem action='Forward'/>
<menuitem action='Rewind'/>
<menuitem action='GotoZero'/>
@ -48,10 +53,8 @@
<menuitem action='jump-backward-to-mark'/>
<menuitem action='add-location-from-playhead'/>
<separator/>
<menuitem action='playhead-to-next-region-start'/>
<menuitem action='playhead-to-next-region-end'/>
<menuitem action='playhead-to-previous-region-start'/>
<menuitem action='playhead-to-previous-region-end'/>
<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'/>
@ -59,6 +62,17 @@
<separator/>
<menuitem action='playhead-to-range-start'/>
<menuitem action='playhead-to-range-end'/>
<menuitem action='focus-on-clock'/>
<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 action='TransportOptions'>
<menuitem action='ToggleTimeMaster'/>
<menuitem action='TogglePunchIn'/>
@ -70,6 +84,9 @@
<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'/>
</menu>
<menu name='Edit' action='Edit'>
<menuitem action='undo'/>
@ -78,6 +95,11 @@
<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'>
@ -93,12 +115,11 @@
<menuitem action='edit-cursor-to-range-end'/>
</menu>
<menu name='KeyMouse Actions' action='KeyMouse Actions'>
<menuitem action='audition-at-mouse'/>
<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='split-region'/>
<menuitem action='set-region-sync-position'/>
<separator/>
<menuitem action='set-mouse-mode-object'/>
@ -106,6 +127,10 @@
<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'/>
</menu>
</menu>
<menu name='Select' action='Select'>
@ -117,6 +142,8 @@
<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'/>
@ -125,10 +152,14 @@
<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 name='Regions' action='Regions'>
<menuitem action='crop'/>
<menuitem action='duplicate-region'/>
<menuitem action='multi-duplicate-region'/>
<menuitem action='insert-region'/>
<menuitem action='normalize-region'/>
<separator/>
@ -148,11 +179,17 @@
<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'/>
<menuitem action='trim-front'/>
<menuitem action='trim-from-start'/>
<menuitem action='trim-to-end'/>
<menuitem action='trim-region-to-loop'/>
<menuitem action='trim-region-to-punch'/>
<separator/>
<menuitem action='pitch-shift-region'/>
</menu>
<menu name='View' action = 'View'>
<menu name='ZoomFocus' action='ZoomFocus'>
@ -164,11 +201,14 @@
<menuitem action='zoom-focus-mouse'/>
</menu>
<menu name='SnapMode' action='SnapMode'>
<menuitem action='snap-off'/>
<menuitem action='snap-normal'/>
<menuitem action='snap-magnetic'/>
<separator/>
<menuitem action='cycle-snap-mode'/>
<menuitem action='cycle-snap-choice'/>
</menu>
<menu name='SnapTo' action='SnapTo'>
<menuitem action='snap-to-frame'/>
<menuitem action='snap-to-cd-frame'/>
<menuitem action='snap-to-smpte-frame'/>
<menuitem action='snap-to-smpte-seconds'/>
@ -183,7 +223,6 @@
<menuitem action='snap-to-beat'/>
<menuitem action='snap-to-bar'/>
<menuitem action='snap-to-mark'/>
<menuitem action='snap-to-edit-cursor'/>
<menuitem action='snap-to-region-start'/>
<menuitem action='snap-to-region-end'/>
<menuitem action='snap-to-region-sync'/>
@ -210,6 +249,8 @@
<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'/>
@ -387,6 +428,8 @@
<menuitem action='SecondaryClockDeltaEditCursor'/>
<menuitem action='ShowTrackMeters'/>
<menuitem action='OnlyCopyImportedFiles'/>
<menuitem action='ShowTrackMeters'/>
<menuitem action='link-region-and-track-selection'/>
<separator/>
</menu>
<menu name='Help' action='Help'>

View file

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Ardour>
<UI>
<Option name="ui-rc-file" value="ardour2_ui_dark.rc"/>
</UI>
<Canvas>
<Option name="waveform" value="000000cc"/>
<Option name="clipped waveform" value="ff0000e5"/>
@ -8,7 +11,7 @@
<Option name="audio track base" value="c6d3d868"/>
<Option name="audio bus base" value="dbd1ea68"/>
<Option name="midi track base" value="c67e7e5f"/>
<Option name="midi bus base" value="ffceea40"/>
<Option name="midi bus base" value="ffceea40"/>
<Option name="time stretch fill" value="e2b5b596"/>
<Option name="time stretch outline" value="63636396"/>
<Option name="automation line" value="44bc59ff"/>
@ -41,11 +44,12 @@
<Option name="verbose canvas cursor" value="f4f214bc"/>
<Option name="marker label" value="000000ff"/>
<Option name="marker bar separator" value="aaaaaa77"/>
<Option name="meter bar" value="666672ff"/>
<Option name="tempo bar" value="72727fff"/>
<Option name="range marker bar" value="7f7f8cff"/>
<Option name="meter bar" value="666672ff"/>
<Option name="marker bar" value="a1a1adff"/>
<Option name="cd marker bar" value="9898a3ff"/>
<Option name="range marker bar" value="7f7f8cff"/>
<Option name="transport marker bar" value="8c8c96ff"/>
<Option name="marker bar" value="9898a3ff"/>
<Option name="range drag bar rect" value="969696c6"/>
<Option name="range drag rect" value="82c696c6"/>
<Option name="transport drag rect" value="969696c6"/>
@ -83,9 +87,9 @@
<Option name="trim handle" value="1900ff44"/>
<Option name="edit point" value="0000ffff"/>
<Option name="play head" value="ff0000ff"/>
<Option name="meter fill min" value="0000ffff"/>
<Option name="meter fill mid" value="73f9baff"/>
<Option name="meter fill max" value="00fd5dff"/>
<Option name="meter fill min" value="33dd33ff"/>
<Option name="meter fill mid" value="eeee33ff"/>
<Option name="meter fill max" value="ee3333ff"/>
<Option name="meter fill clip" value="ff0000ff"/>
<Option name="midi select rect outline" value="5555ffff"/>
<Option name="midi select rect fill" value="8888ff88"/>
@ -98,4 +102,3 @@
<Option name="midi note selected outline" value="5566ffee"/>
</Canvas>
</Ardour>

View file

@ -37,6 +37,7 @@
#include <pbd/error.h>
#include <pbd/misc.h>
#include <pbd/basename.h>
#include <pbd/compose.h>
#include <pbd/failed_constructor.h>
#include <pbd/enumwriter.h>
@ -70,6 +71,7 @@
#include <ardour/audio_track.h>
#include <ardour/midi_track.h>
#include <ardour/filesystem_paths.h>
#include <ardour/filename_extensions.h>
#include "actions.h"
#include "ardour_ui.h"
@ -123,7 +125,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
/* big clock */
big_clock (X_("bigclock"), false, "BigClockNonRecording", false, false, true),
big_clock (X_("bigclock"), false, "BigClockNonRecording", true, false, true),
/* transport */
@ -199,7 +201,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
have_disk_speed_dialog_displayed = false;
session_loaded = false;
last_speed_displayed = -1.0f;
ab_direction = true;
sys::path key_bindings_file;
@ -256,7 +257,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
starting.connect (mem_fun(*this, &ARDOUR_UI::startup));
stopping.connect (mem_fun(*this, &ARDOUR_UI::shutdown));
platform_specific ();
platform_setup ();
}
int
@ -502,6 +503,7 @@ ARDOUR_UI::save_ardour_state ()
Config->add_extra_xml (*node);
Config->add_extra_xml (get_transport_controllable_state());
Config->save_state();
ui_config->save_state ();
XMLNode enode(static_cast<Stateful*>(editor)->get_state());
XMLNode mnode(mixer->get_state());
@ -621,9 +623,18 @@ ARDOUR_UI::startup ()
/* Load session or start the new session dialog */
if (find_session (ARDOUR_COMMAND_LINE::session_name, path, name, isnew)) {
error << string_compose(_("could not load command line session \"%1\""),
ARDOUR_COMMAND_LINE::session_name) << endmsg;
return;
MessageDialog msg (string_compose(_("Could not find command line session \"%1\""),
ARDOUR_COMMAND_LINE::session_name),
true,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK);
msg.set_position (Gtk::WIN_POS_MOUSE);
msg.present ();
msg.run ();
exit (1);
}
if (!ARDOUR_COMMAND_LINE::new_session) {
@ -631,70 +642,34 @@ ARDOUR_UI::startup ()
/* Supposed to be loading an existing session, but the session doesn't exist */
if (isnew) {
error << string_compose (_("\n\nNo session named \"%1\" exists.\n"
"To create it from the command line, start ardour as \"ardour --new %1"), path)
<< endmsg;
return;
MessageDialog msg (string_compose (_("\n\nNo session named \"%1\" exists.\n"
"To create it from the command line, start ardour as:\n ardour --new %1"), path),
true,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK);
msg.set_position (Gtk::WIN_POS_MOUSE);
msg.present ();
msg.run ();
exit (1);
}
}
new_session_dialog->set_session_name (name);
new_session_dialog->set_session_folder (Glib::path_get_basename (path));
_session_is_new = isnew;
}
hide_splash ();
bool have_backend = EngineControl::engine_running();
bool need_nsd;
bool load_needed = false;
if (have_backend) {
/* backend audio is working */
if (ARDOUR_COMMAND_LINE::session_name.empty() || ARDOUR_COMMAND_LINE::new_session) {
/* need NSD to get session name and other info */
need_nsd = true;
} else {
need_nsd = false;
}
} else {
XMLNode* audio_setup = Config->extra_xml ("AudioSetup");
if (audio_setup) {
new_session_dialog->engine_control.set_state (*audio_setup);
}
/* no backend audio, must bring up NSD to check configuration */
need_nsd = true;
}
if (need_nsd) {
if (!get_session_parameters (ARDOUR_COMMAND_LINE::session_name, have_backend, ARDOUR_COMMAND_LINE::new_session)) {
return;
}
} else {
if (create_engine ()) {
backend_audio_error (false);
exit (1);
}
load_needed = true;
XMLNode* audio_setup = Config->extra_xml ("AudioSetup");
if (audio_setup) {
new_session_dialog->engine_control.set_state (*audio_setup);
}
if (load_needed) {
if (load_session (ARDOUR_COMMAND_LINE::session_name, name)) {
return;
}
if (!get_session_parameters (ARDOUR_COMMAND_LINE::session_name, have_backend, ARDOUR_COMMAND_LINE::new_session)) {
return;
}
show ();
}
@ -1458,7 +1433,7 @@ ARDOUR_UI::remove_last_capture()
}
void
ARDOUR_UI::transport_record ()
ARDOUR_UI::transport_record (bool roll)
{
if (session) {
switch (session->record_status()) {
@ -1469,8 +1444,18 @@ ARDOUR_UI::transport_record ()
return;
}
session->maybe_enable_record ();
if (roll) {
transport_roll ();
}
break;
case Session::Recording:
if (roll) {
session->request_stop();
} else {
session->disable_record (false, true);
}
break;
case Session::Enabled:
session->disable_record (false, true);
}
@ -1924,6 +1909,14 @@ ARDOUR_UI::primary_clock_value_changed ()
}
}
void
ARDOUR_UI::big_clock_value_changed ()
{
if (session) {
session->request_locate (big_clock.current_time ());
}
}
void
ARDOUR_UI::secondary_clock_value_changed ()
{
@ -2027,12 +2020,40 @@ ARDOUR_UI::save_template ()
}
}
void
ARDOUR_UI::fontconfig_dialog ()
{
#ifdef GTKOSX
/* X11 users will always have fontconfig info around, but new GTK-OSX users
may not and it can take a while to build it. Warn them.
*/
Glib::ustring fontconfig = Glib::build_filename (Glib::get_home_dir(), ".fontconfig");
if (!Glib::file_test (fontconfig, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
MessageDialog msg (*new_session_dialog,
_("Welcome to Ardour.\n\n"
"The program will take a bit longer to start up\n"
"while the system fonts are checked.\n\n"
"This will only be done once, and you will\n"
"not see this message again\n"),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
msg.show_all ();
msg.present ();
msg.run ();
}
#endif
}
bool
ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_engine, bool should_be_new)
{
string session_name;
string session_path;
string template_name;
bool existing_session = false;
Glib::ustring session_name;
Glib::ustring session_path;
Glib::ustring template_name;
if (!loading_dialog) {
loading_dialog = new MessageDialog (*new_session_dialog,
@ -2041,41 +2062,117 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_NONE);
}
int response = Gtk::RESPONSE_NONE;
new_session_dialog->set_modal(true);
new_session_dialog->set_name (predetermined_path);
new_session_dialog->reset_recent();
if (predetermined_path.length()) {
/* before we start, lets see if the given path looks like
an existing ardour session. if it does, skip the
tabs that we don't need
*/
if (Glib::file_test (predetermined_path, Glib::FILE_TEST_IS_DIR)) {
session_path = predetermined_path;
existing_session = true;
} else if (Glib::file_test (predetermined_path, Glib::FILE_TEST_IS_REGULAR)) {
session_path = Glib::path_get_dirname (string (predetermined_path));
existing_session = true;
} else {
/* it doesn't exist, assume the best */
session_path = Glib::path_get_dirname (string (predetermined_path));
}
session_name = basename_nosuffix (string (predetermined_path));
new_session_dialog->set_session_name (session_name);
new_session_dialog->set_session_folder (session_path);
new_session_dialog->set_modal (true);
if (existing_session) {
if (session_name.length() == 0 || session_path.length() == 0) {
error << string_compose (_("Ardour cannot understand \"%1\" as a session name"), predetermined_path) << endmsg;
return false;
}
if (Glib::file_test (predetermined_path, Glib::FILE_TEST_IS_DIR)) {
Glib::ustring predicted_session_file;
predicted_session_file = predetermined_path;
predicted_session_file += '/';
predicted_session_file += session_name;
predicted_session_file += ARDOUR::statefile_suffix;
if (Glib::file_test (predicted_session_file, Glib::FILE_TEST_EXISTS)) {
existing_session = true;
}
} else if (Glib::file_test (predetermined_path, Glib::FILE_TEST_EXISTS)) {
if (predetermined_path.find (ARDOUR::statefile_suffix) == predetermined_path.length() - 7) {
/* existing .ardour file */
existing_session = true;
}
} else {
existing_session = false;
}
if (existing_session && have_engine) {
/* lets just try to load it */
loading_dialog->set_message (_("Starting audio engine"));
loading_dialog->show_all ();
flush_pending ();
if (create_engine ()) {
backend_audio_error (!have_engine, new_session_dialog);
loading_dialog->hide ();
return false;
}
if (load_session (session_path, session_name) == 0) {
goto done;
}
}
}
}
/* loading failed, or we need the NSD for something */
new_session_dialog->set_position (WIN_POS_CENTER);
new_session_dialog->set_current_page (0);
new_session_dialog->set_existing_session (existing_session);
new_session_dialog->reset_recent();
do {
new_session_dialog->set_have_engine (have_engine);
new_session_dialog->show();
new_session_dialog->present ();
response = new_session_dialog->run ();
response = new_session_dialog->run ();
loading_dialog->hide ();
_session_is_new = false;
/* handle possible negative responses */
if (response == Gtk::RESPONSE_CANCEL || response == Gtk::RESPONSE_DELETE_EVENT) {
if (!session) {
quit();
}
new_session_dialog->hide ();
return false;
} else if (response == Gtk::RESPONSE_NONE) {
/* Clear was pressed */
new_session_dialog->reset();
continue;
/* "Clear" was pressed */
goto try_again;
}
/* first things first ... if we're here to help set up audio parameters
this is where want to do that.
fontconfig_dialog();
/* if we're here to help set up audio parameters this is where want to do that.
*/
if (!have_engine) {
@ -2083,45 +2180,24 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
new_session_dialog->hide ();
return false;
}
loading_dialog->set_message (_("Starting audio engine"));
loading_dialog->show_all ();
flush_pending ();
}
#ifdef GTKOSX
/* X11 users will always have fontconfig info around, but new GTK-OSX users
may not and it can take a while to build it. Warn them.
*/
Glib::ustring fontconfig = Glib::build_filename (Glib::get_home_dir(), ".fontconfig");
if (!Glib::file_test (fontconfig, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
MessageDialog msg (*new_session_dialog,
_("Welcome to Ardour.\n\n"
"The program will take a bit longer to start up\n"
"while the system fonts are checked.\n\n"
"This will only be done once, and you will\n"
"not see this message again\n"),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
msg.show_all ();
msg.present ();
msg.run ();
}
#endif
loading_dialog->set_message (_("Starting audio engine"));
loading_dialog->show_all ();
flush_pending ();
if (create_engine ()) {
backend_audio_error (!have_engine, new_session_dialog);
loading_dialog->hide ();
flush_pending ();
/* audio setup page */
new_session_dialog->set_existing_session (false);
new_session_dialog->set_current_page (2);
/* try again */
response = Gtk::RESPONSE_NONE;
continue;
goto try_again;
}
loading_dialog->hide ();
have_engine = true;
/* now handle possible affirmative responses */
@ -2134,16 +2210,22 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
if (session_name.empty()) {
response = Gtk::RESPONSE_NONE;
continue;
goto try_again;
}
if (session_name[0] == '/' ||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
load_session (Glib::path_get_dirname (session_name), session_name);
if (load_session (Glib::path_get_dirname (session_name), session_name)) {
response = Gtk::RESPONSE_NONE;
goto try_again;
}
} else {
session_path = new_session_dialog->session_folder();
load_session (session_path, session_name);
if (load_session (session_path, session_name)) {
response = Gtk::RESPONSE_NONE;
goto try_again;
}
}
} else if (response == Gtk::RESPONSE_OK) {
@ -2154,9 +2236,9 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
if (session_name.empty()) {
response = Gtk::RESPONSE_NONE;
continue;
goto try_again;
}
switch (new_session_dialog->get_current_page()) {
case 1: /* recent session selector */
case 2: /* audio engine control */
@ -2164,10 +2246,19 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
if (session_name[0] == '/' ||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
load_session (Glib::path_get_dirname (session_name), session_name);
cerr << "here\n";
if (load_session (Glib::path_get_dirname (session_name), session_name)) {
response = Gtk::RESPONSE_NONE;
goto try_again;
}
} else {
session_path = new_session_dialog->session_folder();
load_session (session_path, session_name);
cerr << "there\n";
if (load_session (session_path, session_name)) {
response = Gtk::RESPONSE_NONE;
goto try_again;
}
}
break;
@ -2191,15 +2282,19 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
session_path = new_session_dialog->session_folder();
}
//XXX This is needed because session constructor wants a
//non-existant path. hopefully this will be fixed at some point.
session_path = Glib::build_filename (session_path, session_name);
if (!should_be_new) {
load_session (session_path, session_name);
if (load_session (session_path, session_name)) {
response = Gtk::RESPONSE_NONE;
goto try_again;
}
continue; /* leaves while() loop because response != NONE */
} else if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
@ -2222,12 +2317,17 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
new_session_dialog->hide ();
goto_editor_window ();
flush_pending ();
load_session (session_path, session_name);
if (load_session (session_path, session_name)) {
response = Gtk::RESPONSE_NONE;
goto try_again;
}
goto done;
break;
default:
response = RESPONSE_NONE;
new_session_dialog->reset ();
new_session_dialog->set_existing_session (false);
loading_dialog->hide ();
continue;
}
}
@ -2242,7 +2342,11 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
goto_editor_window ();
flush_pending ();
load_session (session_path, session_name, &template_name);
if (load_session (session_path, session_name, template_name)) {
response = Gtk::RESPONSE_NONE;
goto try_again;
}
} else {
@ -2298,10 +2402,6 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
nphysout = (uint32_t) new_session_dialog->output_limit_count();
}
new_session_dialog->hide ();
goto_editor_window ();
flush_pending ();
if (build_session (session_path,
session_name,
cchns,
@ -2313,9 +2413,12 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
engine->frame_rate() * 60 * 5)) {
response = Gtk::RESPONSE_NONE;
new_session_dialog->reset ();
continue;
goto try_again;
}
new_session_dialog->hide ();
goto_editor_window ();
flush_pending ();
}
break;
@ -2323,6 +2426,13 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
break;
}
}
try_again:
if (response == Gtk::RESPONSE_NONE) {
loading_dialog->hide ();
new_session_dialog->set_existing_session (false);
new_session_dialog->reset ();
}
} while (response == Gtk::RESPONSE_NONE);
@ -2346,7 +2456,7 @@ ARDOUR_UI::close_session()
}
int
ARDOUR_UI::load_session (const string & path, const string & snap_name, string* mix_template)
ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_name, Glib::ustring mix_template)
{
Session *new_session;
int unload_status;
@ -2369,7 +2479,7 @@ ARDOUR_UI::load_session (const string & path, const string & snap_name, string*
/* if it already exists, we must have write access */
if (::access (path.c_str(), F_OK) == 0 && ::access (path.c_str(), W_OK)) {
if (Glib::file_test (path.c_str(), Glib::FILE_TEST_EXISTS) && ::access (path.c_str(), W_OK)) {
MessageDialog msg (*editor, _("You do not have write access to this session.\n"
"This prevents the session from being loaded."));
msg.run ();
@ -2387,8 +2497,55 @@ ARDOUR_UI::load_session (const string & path, const string & snap_name, string*
new_session = new Session (*engine, path, snap_name, mix_template);
}
/* this one is special */
catch (AudioEngine::PortRegistrationFailure& err) {
MessageDialog msg (err.what(),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK_CANCEL);
msg.set_title (_("Loading Error"));
msg.set_secondary_text (_("Click the OK button to try again."));
msg.set_position (Gtk::WIN_POS_CENTER);
msg.present ();
int response = msg.run ();
msg.hide ();
switch (response) {
case RESPONSE_CANCEL:
exit (1);
default:
break;
}
goto out;
}
catch (...) {
error << string_compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name) << endmsg;
cerr << "Caught something\n";
MessageDialog msg (string_compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK_CANCEL);
msg.set_title (_("Loading Error"));
msg.set_secondary_text (_("Click the OK button to try again."));
msg.set_position (Gtk::WIN_POS_CENTER);
msg.present ();
int response = msg.run ();
msg.hide ();
switch (response) {
case RESPONSE_CANCEL:
exit (1);
default:
break;
}
goto out;
}
@ -2413,7 +2570,7 @@ ARDOUR_UI::load_session (const string & path, const string & snap_name, string*
}
int
ARDOUR_UI::build_session (const string & path, const string & snap_name,
ARDOUR_UI::build_session (const Glib::ustring& path, const Glib::ustring& snap_name,
uint32_t control_channels,
uint32_t master_channels,
AutoConnectOption input_connect,
@ -3202,41 +3359,3 @@ ARDOUR_UI::setup_profile ()
}
}
void
ARDOUR_UI::disable_all_plugins ()
{
if (!session) {
return;
}
// session->begin_reversible_command (_("Disable all plugins"));
boost::shared_ptr<Session::RouteList> routes = session->get_routes ();
for (Session::RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
// XMLNode& before = (*i)->get_redirect_state ();
// session->add_command (new MementoCommand<Route>(**i, &before, 0));
(*i)->disable_plugins ();
// XMLNode& after = (*i)->get_redirect_state ();
// session->add_command (new MementoCommand<Route>(**i, 0, &after));
}
// session->commit_reversible_command ();
}
void
ARDOUR_UI::ab_all_plugins ()
{
if (!session) {
return;
}
boost::shared_ptr<Session::RouteList> routes = session->get_routes ();
for (Session::RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
(*i)->ab_plugins (ab_direction);
}
ab_direction = !ab_direction;
}

View file

@ -112,10 +112,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void show_splash ();
void hide_splash ();
int load_session (const string & path, const string & snapshot, string* mix_template = 0);
int load_session (const Glib::ustring & path, const Glib::ustring& snapshot, Glib::ustring mix_template = Glib::ustring());
bool session_loaded;
/// @return zero if building the session was successful
int build_session (const string & path, const string & snapshot,
int build_session (const Glib::ustring& path, const Glib::ustring& snapshot,
uint32_t ctl_chns,
uint32_t master_chns,
ARDOUR::AutoConnectOption input_connect,
@ -155,7 +154,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
PublicEditor& the_editor(){return *editor;}
Mixer_UI* the_mixer() { return mixer; }
ARDOUR::AudioEngine& the_engine() const { return *engine; }
void toggle_key_editor ();
void toggle_location_window ();
void toggle_theme_manager ();
@ -280,8 +281,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
ARDOUR::AudioEngine *engine;
ARDOUR::Session *session;
bool check_audioengine();
Gtk::Tooltips _tooltips;
void goto_editor_window ();
@ -482,6 +481,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void solo_alert_toggle ();
void audition_alert_toggle ();
void big_clock_value_changed ();
void primary_clock_value_changed ();
void secondary_clock_value_changed ();
@ -578,7 +578,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void transport_goto_end ();
void transport_stop ();
void transport_stop_and_forget_capture ();
void transport_record ();
void transport_record (bool roll);
void transport_roll ();
void transport_play_selection();
void transport_forward (int option);
@ -753,10 +753,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void no_memory_warning ();
void check_memory_locking ();
bool ab_direction;
void disable_all_plugins ();
void ab_all_plugins ();
bool check_audioengine();
void audioengine_setup ();
void display_message (const char *prefix, gint prefix_len,
@ -766,6 +763,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
Gtk::MessageDialog* loading_dialog;
void platform_specific ();
void platform_setup ();
void fontconfig_dialog ();
};
#endif /* __ardour_gui_h__ */

View file

@ -316,6 +316,7 @@ ARDOUR_UI::setup_transport ()
primary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
secondary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
big_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
ARDOUR_UI::instance()->tooltips().set_tip (primary_clock, _("Primary clock"));
ARDOUR_UI::instance()->tooltips().set_tip (secondary_clock, _("secondary clock"));
@ -398,7 +399,9 @@ ARDOUR_UI::setup_transport ()
transport_tearoff_hbox.pack_start (*svbox, false, false, 3);
transport_tearoff_hbox.pack_start (auto_loop_button, false, false);
transport_tearoff_hbox.pack_start (play_selection_button, false, false);
if (!Profile->get_sae()) {
transport_tearoff_hbox.pack_start (play_selection_button, false, false);
}
transport_tearoff_hbox.pack_start (roll_button, false, false);
transport_tearoff_hbox.pack_start (stop_button, false, false);
transport_tearoff_hbox.pack_start (rec_button, false, false, 6);
@ -408,12 +411,16 @@ ARDOUR_UI::setup_transport ()
if (!ARDOUR::Profile->get_small_screen()) {
clock_box->pack_start (secondary_clock, false, false);
}
VBox* time_controls_box = manage (new VBox);
time_controls_box->pack_start (sync_option_combo, false, false);
time_controls_box->pack_start (time_master_button, false, false);
clock_box->pack_start (*time_controls_box, false, false, 1);
if (!Profile->get_sae()) {
VBox* time_controls_box = manage (new VBox);
time_controls_box->pack_start (sync_option_combo, false, false);
time_controls_box->pack_start (time_master_button, false, false);
clock_box->pack_start (*time_controls_box, false, false, 1);
}
transport_tearoff_hbox.pack_start (*clock_box, false, false, 0);
HBox* toggle_box = manage(new HBox);
VBox* punch_box = manage (new VBox);
@ -443,6 +450,11 @@ ARDOUR_UI::setup_transport ()
transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4);
transport_tearoff_hbox.pack_start (alert_box, false, false);
if (Profile->get_sae()) {
Image* img = manage (new Image ((::get_icon (X_("sae")))));
transport_tearoff_hbox.pack_end (*img, false, false, 6);
}
}
void

View file

@ -51,7 +51,7 @@ ARDOUR_UI::shutdown ()
session->remove_pending_capture_state ();
session = 0;
}
ui_config->save_state();
}
void

View file

@ -82,7 +82,7 @@ ARDOUR_UI::install_actions ()
/* menus + submenus that need action items */
ActionManager::register_action (main_actions, X_("Session"), _("Session"));
ActionManager::register_action (main_actions, X_("Files"), _("Files"));
ActionManager::register_action (main_actions, X_("Files"), _("Import/Export"));
ActionManager::register_action (main_actions, X_("Regions"), _("Regions"));
ActionManager::register_action (main_actions, X_("Cleanup"), _("Cleanup"));
ActionManager::register_action (main_actions, X_("Sync"), _("Sync"));
@ -269,7 +269,9 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("Record"), _("Enable Record"), mem_fun(*this, &ARDOUR_UI::transport_record));
act = ActionManager::register_action (transport_actions, X_("Record"), _("Enable Record"), bind (mem_fun(*this, &ARDOUR_UI::transport_record), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("record-roll"), _("Start Recording"), bind (mem_fun(*this, &ARDOUR_UI::transport_record), true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("Rewind"), _("Rewind"), bind (mem_fun(*this, &ARDOUR_UI::transport_rewind), 0));
@ -300,6 +302,10 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("focus-on-clock"), _("Focus On Clock"), mem_fun(primary_clock, &AudioClock::focus));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (transport_actions, X_("TogglePunchIn"), _("Punch In"), mem_fun(*this, &ARDOUR_UI::toggle_punch_in));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
@ -420,7 +426,7 @@ ARDOUR_UI::install_actions ()
ActionManager::register_toggle_action (option_actions, X_("RegionEquivalentsOverlap"), _("Region equivalents overlap"), mem_fun (*this, &ARDOUR_UI::toggle_RegionEquivalentsOverlap));
ActionManager::register_toggle_action (option_actions, X_("PrimaryClockDeltaEditCursor"), _("Primary Clock delta to edit point"), mem_fun (*this, &ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor));
ActionManager::register_toggle_action (option_actions, X_("SecondaryClockDeltaEditCursor"), _("Secondary Clock delta to edit point"), mem_fun (*this, &ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor));
ActionManager::register_toggle_action (option_actions, X_("ShowTrackMeters"), _("Display Editor Meters"), mem_fun (*this, &ARDOUR_UI::toggle_ShowTrackMeters));
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));
RadioAction::Group denormal_group;
@ -464,17 +470,16 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("LatchedSolo"), _("Latched solo"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedSolo));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("ShowSoloMutes"), _("Show solo muting"), mem_fun (*this, &ARDOUR_UI::toggle_ShowSoloMutes));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (option_actions, X_("DisableAllPlugins"), _("Disable All Plugins"), mem_fun (*this, &ARDOUR_UI::disable_all_plugins));
/*act = ActionManager::register_action (option_actions, X_("DisableAllPlugins"), _("Disable All Plugins"), mem_fun (*this, &ARDOUR_UI::disable_all_plugins));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (option_actions, X_("ABAllPlugins"), _("A/B All Plugins"), mem_fun (*this, &ARDOUR_UI::ab_all_plugins));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);*/
/* !!! REMEMBER THAT RADIO ACTIONS HAVE TO BE HANDLED WITH MORE FINESSE THAN SIMPLE TOGGLES !!! */

View file

@ -33,6 +33,7 @@
#include "ardour_ui.h"
#include "actions.h"
#include "gui_thread.h"
#include "public_editor.h"
#include "i18n.h"
@ -1118,6 +1119,9 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("options", "SecondaryClockDeltaEditCursor", &Configuration::get_secondary_clock_delta_edit_cursor);
} else if (PARAM_IS ("only-copy-imported-files")) {
map_only_copy_imported_files ();
} else if (PARAM_IS ("show-track-meters")) {
ActionManager::map_some_state ("options", "ShowTrackMeters", &Configuration::get_show_track_meters);
editor->toggle_meter_updating();
}
#undef PARAM_IS

View file

@ -1,160 +0,0 @@
/*
Copyright (C) 2006 Paul Davis
Written by Taybin Rutkin
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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <ardour/audio_unit.h>
#include <ardour/processor.h>
#include <gtkmm2ext/doi.h>
#include "au_pluginui.h"
#include "gui_thread.h"
#include <appleutility/CAAudioUnit.h>
#include <appleutility/CAComponent.h>
#include <AudioUnit/AudioUnit.h>
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
{
if ((au = boost::dynamic_pointer_cast<AUPlugin> (insert->plugin())) == 0) {
error << _("unknown type of editor-supplying plugin (note: no AudioUnit support in this version of ardour)") << endmsg;
throw failed_constructor ();
}
OSStatus err = noErr;
CAComponentDescription desc;
Component carbonViewComponent = NULL;
AudioUnitCarbonView carbonView = NULL;
GetComponentInfo(au->get_comp()->Comp(), &desc, 0, 0, 0);
carbonViewComponent = get_carbon_view_component(desc.componentSubType);
err = OpenAComponent(carbonViewComponent, &carbonView);
Rect rec;
rec.top = 0;
rec.left = 0;
rec.bottom = 400;
rec.right = 500;
ProcessSerialNumber ourPSN;
/* Here we will set the MacOSX native section of the process to the foreground for putting up this
* dialog box. First step is to get our process serial number. We do this by calling
* GetCurrentProcess.
* First Argument: On success this PSN will be our PSN on return.
* Return Value: A Macintosh error indicating success or failure.
*/
err = GetCurrentProcess(&ourPSN);
//If no error then set this process to be frontmost.
if (err == noErr) {
/* Calling SetFrontProcess to make us frontmost.
* First Argument: The Process Serial Number of the process we want to make frontmost. Here
* of course we pass our process serial number
* Return Value: An error value indicating success or failure. We just ignore the return
* value here.
*/
(void)SetFrontProcess(&ourPSN);
} else {
error << "couldn't get current process" << endmsg;
}
err = CreateNewWindow (kDocumentWindowClass, kWindowStandardFloatingAttributes, &rec, &wr);
ComponentResult auResult;
ControlRef rootControl = NULL;
GetRootControl(wr, &rootControl);
int width = 500;
int height = 400;
Float32Point location = {30, 30};
Float32Point size = {width, height};
ControlRef audioUnitControl = NULL;
auResult = AudioUnitCarbonViewCreate(carbonView,
au->get_au()->AU(),
wr,
rootControl,
&location,
&size,
&audioUnitControl);
ShowWindow (wr);
BringToFront (wr);
// AudioUnitCarbonViewSetEventListener(carbonView, EventListener, this);
#if 0
set_name ("PluginEditor");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)));
#endif
insert->GoingAway.connect (mem_fun(*this, &AUPluginUI::plugin_going_away));
info << "AUPluginUI created" << endmsg;
}
AUPluginUI::~AUPluginUI ()
{
// nothing to do here - plugin destructor destroys the GUI
}
void
AUPluginUI::plugin_going_away (ARDOUR::IOProcessor* ignored)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &AUPluginUI::plugin_going_away), ignored));
delete_when_idle (this);
}
Component
AUPluginUI::get_carbon_view_component(OSType subtype)
{
ComponentDescription desc;
Component component;
desc.componentType = kAudioUnitCarbonViewComponentType; // 'auvw'
desc.componentSubType = subtype;
desc.componentManufacturer = 0;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
// First see if we can find a carbon view designed specifically for this
// plug-in:
component = FindNextComponent(NULL, &desc);
if (component)
return component;
// If not, grab the generic carbon view, which will create a GUI for
// any Audio Unit.
desc.componentSubType = kAUCarbonViewSubType_Generic;
component = FindNextComponent(NULL, &desc);
return component;
}

View file

@ -1,48 +1,77 @@
/*
Copyright (C) 2006 Paul Davis
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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __au_plugin_ui_h__
#define __au_plugin_ui_h__
#include <boost/shared_ptr.hpp>
#ifndef __gtk2_ardour_auplugin_ui_h__
#define __gtk2_ardour_auplugin_ui_h__
#include <AppKit/AppKit.h>
#include <Carbon/Carbon.h>
#include <AudioUnit/AudioUnit.h>
/* fix up stupid apple macros */
#undef check
#undef require
#undef verify
#include <gtkmm/box.h>
#include "plugin_ui.h"
namespace ARDOUR {
class AUPlugin;
class PluginInsert;
class IOProcessor;
}
class AUPluginUI
class AUPluginUI : public PlugUIBase, public Gtk::VBox
{
public:
AUPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>);
~AUPluginUI ();
gint get_preferred_height () { return prefheight; }
gint get_preferred_width () { return prefwidth; }
bool start_updating(GdkEventAny*);
bool stop_updating(GdkEventAny*);
virtual void activate ();
virtual void deactivate ();
void on_realize ();
void on_show ();
OSStatus carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event);
private:
WindowRef wr;
boost::shared_ptr<ARDOUR::AUPlugin> au;
int prefheight;
int prefwidth;
void plugin_going_away (ARDOUR::IOProcessor*);
Component get_carbon_view_component(OSType subtype);
/* Cocoa */
NSWindow* cocoa_window;
NSScrollView* scroll_view;
NSView* au_view;
/* Carbon */
NSWindow* cocoa_parent;
ComponentDescription carbon_descriptor;
AudioUnitCarbonView editView;
WindowRef carbon_window;
EventHandlerRef carbon_event_handler;
bool carbon_parented;
bool cocoa_parented;
void test_view_support (bool&, bool&);
bool test_cocoa_view_support ();
bool test_carbon_view_support ();
int create_carbon_view (bool generic);
int create_cocoa_view ();
int parent_carbon_window ();
int parent_cocoa_window ();
NSWindow* get_nswindow();
bool plugin_class_valid (Class pluginClass);
};
#endif // __au_plugin_ui_h__
#endif /* __gtk2_ardour_auplugin_ui_h__ */

567
gtk2_ardour/au_pluginui.mm Normal file
View file

@ -0,0 +1,567 @@
#include <pbd/error.h>
#include <ardour/audio_unit.h>
#include <ardour/insert.h>
#include <gdk/gdkquartz.h>
#include "au_pluginui.h"
#include "gui_thread.h"
#include <appleutility/CAAudioUnit.h>
#include <appleutility/CAComponent.h>
#import <AudioUnit/AUCocoaUIView.h>
#import <CoreAudioKit/AUGenericView.h>
#include "i18n.h"
using namespace ARDOUR;
using namespace Gtk;
using namespace sigc;
using namespace std;
using namespace PBD;
static const float kOffsetForAUView_X = 220;
static const float kOffsetForAUView_Y = 90;
AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
: PlugUIBase (insert)
{
if ((au = boost::dynamic_pointer_cast<AUPlugin> (insert->plugin())) == 0) {
error << _("unknown type of editor-supplying plugin (note: no AudioUnit support in this version of ardour)") << endmsg;
throw failed_constructor ();
}
bool has_carbon;
bool has_cocoa;
carbon_parented = false;
cocoa_parented = false;
cocoa_parent = 0;
cocoa_window = 0;
test_view_support (has_carbon, has_cocoa);
if (has_cocoa) {
create_cocoa_view ();
} else if (has_carbon) {
create_carbon_view (has_carbon);
} else {
/* fallback to cocoa */
create_cocoa_view ();
}
}
AUPluginUI::~AUPluginUI ()
{
if (carbon_parented) {
NSWindow* win = get_nswindow();
RemoveEventHandler(carbon_event_handler);
[win removeChildWindow:cocoa_parent];
}
}
void
AUPluginUI::test_view_support (bool& has_carbon, bool& has_cocoa)
{
has_carbon = test_carbon_view_support();
has_cocoa = test_cocoa_view_support();
}
bool
AUPluginUI::test_carbon_view_support ()
{
bool ret = false;
carbon_descriptor.componentType = kAudioUnitCarbonViewComponentType;
carbon_descriptor.componentSubType = 'gnrc';
carbon_descriptor.componentManufacturer = 'appl';
carbon_descriptor.componentFlags = 0;
carbon_descriptor.componentFlagsMask = 0;
OSStatus err;
// ask the AU for its first editor component
UInt32 propertySize;
err = AudioUnitGetPropertyInfo(*au->get_au(), kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, &propertySize, NULL);
if (!err) {
int nEditors = propertySize / sizeof(ComponentDescription);
ComponentDescription *editors = new ComponentDescription[nEditors];
err = AudioUnitGetProperty(*au->get_au(), kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, editors, &propertySize);
if (!err) {
// just pick the first one for now
carbon_descriptor = editors[0];
ret = true;
}
delete[] editors;
}
return ret;
}
bool
AUPluginUI::test_cocoa_view_support ()
{
UInt32 dataSize = 0;
Boolean isWritable = 0;
OSStatus err = AudioUnitGetPropertyInfo(*au->get_au(),
kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global,
0, &dataSize, &isWritable);
return dataSize > 0 && err == noErr;
}
bool
AUPluginUI::plugin_class_valid (Class pluginClass)
{
if([pluginClass conformsToProtocol: @protocol(AUCocoaUIBase)]) {
if([pluginClass instancesRespondToSelector: @selector(interfaceVersion)] &&
[pluginClass instancesRespondToSelector: @selector(uiViewForAudioUnit:withSize:)]) {
return true;
}
}
return false;
}
int
AUPluginUI::create_cocoa_view ()
{
BOOL wasAbleToLoadCustomView = NO;
AudioUnitCocoaViewInfo* cocoaViewInfo = NULL;
UInt32 numberOfClasses = 0;
UInt32 dataSize;
Boolean isWritable;
NSString* factoryClassName = 0;
NSURL* CocoaViewBundlePath;
OSStatus result = AudioUnitGetPropertyInfo (*au->get_au(),
kAudioUnitProperty_CocoaUI,
kAudioUnitScope_Global,
0,
&dataSize,
&isWritable );
numberOfClasses = (dataSize - sizeof(CFURLRef)) / sizeof(CFStringRef);
// Does view have custom Cocoa UI?
if ((result == noErr) && (numberOfClasses > 0) ) {
cocoaViewInfo = (AudioUnitCocoaViewInfo *)malloc(dataSize);
if(AudioUnitGetProperty(*au->get_au(),
kAudioUnitProperty_CocoaUI,
kAudioUnitScope_Global,
0,
cocoaViewInfo,
&dataSize) == noErr) {
CocoaViewBundlePath = (NSURL *)cocoaViewInfo->mCocoaAUViewBundleLocation;
// we only take the first view in this example.
factoryClassName = (NSString *)cocoaViewInfo->mCocoaAUViewClass[0];
} else {
if (cocoaViewInfo != NULL) {
free (cocoaViewInfo);
cocoaViewInfo = NULL;
}
}
}
NSRect crect = { { 0, 0 }, { 1, 1} };
// [A] Show custom UI if view has it
if (CocoaViewBundlePath && factoryClassName) {
NSBundle *viewBundle = [NSBundle bundleWithPath:[CocoaViewBundlePath path]];
if (viewBundle == nil) {
error << _("AUPluginUI: error loading AU view's bundle") << endmsg;
return -1;
} else {
Class factoryClass = [viewBundle classNamed:factoryClassName];
if (!factoryClass) {
error << _("AUPluginUI: error getting AU view's factory class from bundle") << endmsg;
return -1;
}
// make sure 'factoryClass' implements the AUCocoaUIBase protocol
if (!plugin_class_valid (factoryClass)) {
error << _("AUPluginUI: U view's factory class does not properly implement the AUCocoaUIBase protocol") << endmsg;
return -1;
}
// make a factory
id factoryInstance = [[[factoryClass alloc] init] autorelease];
if (factoryInstance == nil) {
error << _("AUPluginUI: Could not create an instance of the AU view factory") << endmsg;
return -1;
}
// make a view
au_view = [factoryInstance uiViewForAudioUnit:*au->get_au() withSize:crect.size];
// cleanup
[CocoaViewBundlePath release];
if (cocoaViewInfo) {
UInt32 i;
for (i = 0; i < numberOfClasses; i++)
CFRelease(cocoaViewInfo->mCocoaAUViewClass[i]);
free (cocoaViewInfo);
}
wasAbleToLoadCustomView = YES;
}
}
if (!wasAbleToLoadCustomView) {
// [B] Otherwise show generic Cocoa view
au_view = [[AUGenericView alloc] initWithAudioUnit:*au->get_au()];
[(AUGenericView *)au_view setShowsExpertParameters:YES];
}
/* make a child cocoa window */
cocoa_window = [[NSWindow alloc]
initWithContentRect:crect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
return 0;
}
int
AUPluginUI::create_carbon_view (bool generic)
{
OSStatus err;
ControlRef root_control;
Component editComponent = FindNextComponent(NULL, &carbon_descriptor);
OpenAComponent(editComponent, &editView);
if (!editView) {
error << _("AU Carbon view: cannot open AU Component") << endmsg;
return -1;
}
Rect r = { 100, 100, 100, 100 };
WindowAttributes attr = WindowAttributes (kWindowStandardHandlerAttribute |
kWindowCompositingAttribute|
kWindowNoShadowAttribute|
kWindowNoTitleBarAttribute);
if ((err = CreateNewWindow(kDocumentWindowClass, attr, &r, &carbon_window)) != noErr) {
error << string_compose (_("AUPluginUI: cannot create carbon window (err: %1)"), err) << endmsg;
return -1;
}
if ((err = GetRootControl(carbon_window, &root_control)) != noErr) {
error << string_compose (_("AUPlugin: cannot get root control of carbon window (err: %1)"), err) << endmsg;
return -1;
}
ControlRef viewPane;
Float32Point location = { 0.0, 0.0 };
Float32Point size = { 0.0, 0.0 } ;
if ((err = AudioUnitCarbonViewCreate (editView, *au->get_au(), carbon_window, root_control, &location, &size, &viewPane)) != noErr) {
error << string_compose (_("AUPluginUI: cannot create carbon plugin view (err: %1)"), err) << endmsg;
return -1;
}
// resize window
Rect bounds;
GetControlBounds(viewPane, &bounds);
size.x = bounds.right-bounds.left;
size.y = bounds.bottom-bounds.top;
SizeWindow(carbon_window, (short) (size.x + 0.5), (short) (size.y + 0.5), true);
prefwidth = (int) (size.x + 0.5);
prefheight = (int) (size.y + 0.5);
#if 0
mViewPaneResizer->WantEventTypes (GetControlEventTarget(mAUViewPane), GetEventTypeCount(resizeEvent), resizeEvent);
#endif
return 0;
}
NSWindow*
AUPluginUI::get_nswindow ()
{
Gtk::Container* toplevel = get_toplevel();
if (!toplevel || !toplevel->is_toplevel()) {
error << _("AUPluginUI: no top level window!") << endmsg;
return 0;
}
NSWindow* true_parent = gdk_quartz_window_get_nswindow (toplevel->get_window()->gobj());
if (!true_parent) {
error << _("AUPluginUI: no top level window!") << endmsg;
return 0;
}
return true_parent;
}
void
AUPluginUI::activate ()
{
NSWindow* win = get_nswindow ();
[win setLevel:NSFloatingWindowLevel];
if (carbon_parented) {
[cocoa_parent makeKeyAndOrderFront:nil];
ActivateWindow (carbon_window, TRUE);
}
}
void
AUPluginUI::deactivate ()
{
/* nothing to do here */
}
OSStatus
_carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event, void *userData)
{
return ((AUPluginUI*)userData)->carbon_event (nextHandlerRef, event);
}
OSStatus
AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event)
{
UInt32 eventKind = GetEventKind(event);
ClickActivationResult howToHandleClick;
NSWindow* win = get_nswindow ();
switch (eventKind) {
case kEventWindowHandleActivate:
[win makeMainWindow];
return eventNotHandledErr;
break;
case kEventWindowHandleDeactivate:
return eventNotHandledErr;
break;
case kEventWindowGetClickActivation:
howToHandleClick = kActivateAndHandleClick;
SetEventParameter(event, kEventParamClickActivation, typeClickActivationResult,
sizeof(ClickActivationResult), &howToHandleClick);
break;
}
return noErr;
}
int
AUPluginUI::parent_carbon_window ()
{
NSWindow* win = get_nswindow ();
int x, y;
if (!win) {
return -1;
}
Gtk::Container* toplevel = get_toplevel();
if (!toplevel || !toplevel->is_toplevel()) {
error << _("AUPluginUI: no top level window!") << endmsg;
return -1;
}
toplevel->get_window()->get_root_origin (x, y);
/* compute how tall the title bar is, because we have to offset the position of the carbon window
by that much.
*/
NSRect content_frame = [NSWindow contentRectForFrameRect:[win frame] styleMask:[win styleMask]];
NSRect wm_frame = [NSWindow frameRectForContentRect:content_frame styleMask:[win styleMask]];
int titlebar_height = wm_frame.size.height - content_frame.size.height;
MoveWindow (carbon_window, x, y + titlebar_height, false);
ShowWindow (carbon_window);
// create the cocoa window for the carbon one and make it visible
cocoa_parent = [[NSWindow alloc] initWithWindowRef: carbon_window];
EventTypeSpec windowEventTypes[] = {
{kEventClassWindow, kEventWindowGetClickActivation },
{kEventClassWindow, kEventWindowHandleDeactivate },
{kEventClassWindow, kEventWindowHandleActivate }
};
EventHandlerUPP ehUPP = NewEventHandlerUPP(_carbon_event);
OSStatus result = InstallWindowEventHandler (carbon_window, ehUPP,
sizeof(windowEventTypes) / sizeof(EventTypeSpec),
windowEventTypes, this, &carbon_event_handler);
if (result != noErr) {
return -1;
}
[win addChildWindow:cocoa_parent ordered:NSWindowAbove];
[win setLevel:NSFloatingWindowLevel];
[win setHidesOnDeactivate:YES];
carbon_parented = true;
return 0;
}
int
AUPluginUI::parent_cocoa_window ()
{
NSWindow* win = get_nswindow ();
if (!win) {
return -1;
}
Gtk::Container* toplevel = get_toplevel();
if (!toplevel || !toplevel->is_toplevel()) {
error << _("AUPluginUI: no top level window!") << endmsg;
return -1;
}
// Get the size of the new AU View's frame
NSRect au_view_frame = [au_view frame];
if (au_view_frame.size.width > 500 || au_view_frame.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];
NSSize frameSize = [NSScrollView frameSizeForContentSize:au_view_frame.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 = frameSize;
// Set the new frame and document views on the scroll view
NSRect currentFrame = [scroll_view frame];
[scroll_view setFrame:newFrame];
[scroll_view setDocumentView:au_view];
cerr << "scroll view size is " << newFrame.size.width << " x " << newFrame.size.height << endl;
NSSize oldContentSize = [[cocoa_window contentView] frame].size;
NSSize newContentSize = oldContentSize;
cerr << "original size is " << newContentSize.width << " x " << newContentSize.height << endl;
newContentSize.width += (newFrame.size.width - currentFrame.size.width);
newContentSize.height += (newFrame.size.height - currentFrame.size.height);
[cocoa_window setContentSize:newContentSize];
[cocoa_window setContentView:scroll_view];
} else {
[cocoa_window setContentSize:au_view_frame.size];
[cocoa_window setContentView:au_view];
}
/* compute how tall the title bar is, because we have to offset the position of the child window
by that much.
*/
NSRect content_frame = [NSWindow contentRectForFrameRect:[win frame] styleMask:[win styleMask]];
NSRect wm_frame = [NSWindow frameRectForContentRect:content_frame styleMask:[win styleMask]];
int titlebar_height = wm_frame.size.height - content_frame.size.height;
// move cocoa window into position relative to the toplevel window
NSRect view_frame = [[cocoa_window contentView] frame];
view_frame.origin.x = content_frame.origin.x;
view_frame.origin.y = content_frame.origin.y;
[cocoa_window setFrame:view_frame display:NO];
/* make top level window big enough to hold cocoa window and titlebar */
content_frame.size.width = view_frame.size.width;
content_frame.size.height = view_frame.size.height + titlebar_height;
[win setFrame:content_frame display:NO];
/* now make cocoa window a child of this top level */
[win addChildWindow:cocoa_window ordered:NSWindowAbove];
// [win setLevel:NSFloatingWindowLevel];
[win setHidesOnDeactivate:YES];
cocoa_parented = true;
return 0;
}
void
AUPluginUI::on_realize ()
{
VBox::on_realize ();
if (cocoa_window) {
if (parent_cocoa_window ()) {
}
} else if (carbon_window) {
if (parent_carbon_window ()) {
// ShowWindow (carbon_window);
}
}
}
void
AUPluginUI::on_show ()
{
cerr << "AU plugin window shown\n";
VBox::on_show ();
if (cocoa_window) {
[cocoa_window setIsVisible:YES];
} else if (carbon_window) {
[cocoa_parent setIsVisible:YES];
}
}
bool
AUPluginUI::start_updating (GdkEventAny* any)
{
return false;
}
bool
AUPluginUI::stop_updating (GdkEventAny* any)
{
return false;
}
PlugUIBase*
create_au_gui (boost::shared_ptr<PluginInsert> plugin_insert, VBox** box)
{
AUPluginUI* aup = new AUPluginUI (plugin_insert);
(*box) = aup;
return aup;
}

View file

@ -599,10 +599,15 @@ AudioClock::set_smpte (nframes_t when, bool force)
smpte_upper_info_label->set_text (buf);
if (session->smpte_drop_frames()) {
sprintf (buf, "DF");
if ((fabs(smpte_frames - 29.97) < 0.0001) || smpte_frames == 30) {
if (session->smpte_drop_frames()) {
sprintf (buf, "DF");
} else {
sprintf (buf, "NDF");
}
} else {
sprintf (buf, "NDF");
// there is no drop frame alternative
buf[0] = '\0';
}
smpte_lower_info_label->set_text (buf);
@ -654,6 +659,32 @@ AudioClock::set_session (Session *s)
}
}
void
AudioClock::focus ()
{
switch (_mode) {
case SMPTE:
hours_ebox.grab_focus ();
break;
case BBT:
bars_ebox.grab_focus ();
break;
case MinSec:
ms_hours_ebox.grab_focus ();
break;
case Frames:
frames_ebox.grab_focus ();
break;
case Off:
break;
}
}
bool
AudioClock::field_key_press_event (GdkEventKey *ev, Field field)
{
@ -1020,7 +1051,7 @@ AudioClock::field_button_release_event (GdkEventButton *ev, Field field)
if (dragging) {
gdk_pointer_ungrab (GDK_CURRENT_TIME);
dragging = false;
if (ev->y > drag_start_y+1 || ev->y < drag_start_y-1 || Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)){
if (ev->y > drag_start_y+1 || ev->y < drag_start_y-1 || Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)){
// we actually dragged so return without setting editing focus, or we shift clicked
return true;
}
@ -1100,7 +1131,7 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field field)
switch (ev->button) {
case 1:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
set (frames, true);
ValueChanged (); /* EMIT_SIGNAL */
}
@ -1116,7 +1147,7 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field field)
break;
case 2:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
set (frames, true);
ValueChanged (); /* EMIT_SIGNAL */
}
@ -1149,7 +1180,7 @@ AudioClock::field_button_scroll_event (GdkEventScroll *ev, Field field)
case GDK_SCROLL_UP:
frames = get_frames (field);
if (frames != 0) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
frames *= 10;
}
set (current_time() + frames, true);
@ -1160,7 +1191,7 @@ AudioClock::field_button_scroll_event (GdkEventScroll *ev, Field field)
case GDK_SCROLL_DOWN:
frames = get_frames (field);
if (frames != 0) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
frames *= 10;
}
@ -1192,13 +1223,13 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
float pixel_frame_scale_factor = 0.2f;
/*
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
pixel_frame_scale_factor = 0.1f;
}
if (Keyboard::modifier_state_contains (ev->state,
Keyboard::Control|Keyboard::Alt)) {
Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
pixel_frame_scale_factor = 0.025f;
}
@ -1853,7 +1884,7 @@ AudioClock::build_ops_menu ()
ops_items.push_back (MenuElem (_("Timecode"), bind (mem_fun(*this, &AudioClock::set_mode), SMPTE)));
ops_items.push_back (MenuElem (_("Bars:Beats"), bind (mem_fun(*this, &AudioClock::set_mode), BBT)));
ops_items.push_back (MenuElem (_("Minutes:Seconds"), bind (mem_fun(*this, &AudioClock::set_mode), MinSec)));
ops_items.push_back (MenuElem (_("Audio Frames"), bind (mem_fun(*this, &AudioClock::set_mode), Frames)));
ops_items.push_back (MenuElem (_("Samples"), bind (mem_fun(*this, &AudioClock::set_mode), Frames)));
ops_items.push_back (MenuElem (_("Off"), bind (mem_fun(*this, &AudioClock::set_mode), Off)));
}

View file

@ -45,7 +45,9 @@ class AudioClock : public Gtk::HBox
AudioClock (std::string clock_name, bool transient, std::string widget_name, bool editable, bool is_duration = false, bool with_info = false);
Mode mode() const { return _mode; }
void focus ();
void set (nframes_t, bool force = false, nframes_t offset = 0, char which = 0);
void set_mode (Mode);

View file

@ -1,7 +1,7 @@
/*
Copyright (C) 2001-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
This program is free software; you can r>edistribute 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.
@ -411,8 +411,8 @@ void
AudioRegionView::set_y_position_and_height (double y, double h)
{
//RegionView::set_y_position_and_height(y, h - 1);
RegionView::set_height (height);
RegionView::set_height (h);
const uint32_t wcnt = waves.size();
_y_position = y;
@ -1205,3 +1205,35 @@ AudioRegionView::color_handler ()
envelope_active_changed();
}
void
AudioRegionView::set_frame_color ()
{
if (!frame) {
return;
}
if (_region->opaque()) {
fill_opacity = 130;
} else {
fill_opacity = 0;
}
uint32_t r,g,b,a;
if (_selected && should_show_selection) {
frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_WaveForm.get();
UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_FrameBase.get(), &r, &g, &b, &a);
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
(*w)->property_wave_color() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);// Lets still use the theme's opacity value if Opaque is not set
}
} else {
UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_FrameBase.get(), &r, &g, &b, &a);
frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
(*w)->property_wave_color() = ARDOUR_UI::config()->canvasvar_WaveForm.get();
}
}
}

View file

@ -161,7 +161,8 @@ class AudioRegionView : public RegionView
void compute_colors (Gdk::Color&);
void reset_width_dependent_items (double pixel_width);
void set_waveview_data_src();
void set_frame_color ();
void color_handler ();
vector<GnomeCanvasWaveViewCache*> wave_caches;

View file

@ -73,8 +73,6 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
_amplitude_above_axis = 1.0;
use_rec_regions = tv.editor.show_waveforms_recording ();
}
AudioStreamView::~AudioStreamView ()

View file

@ -43,6 +43,7 @@
#include <ardour/location.h>
#include <ardour/panner.h>
#include <ardour/playlist.h>
#include <ardour/profile.h>
#include <ardour/session.h>
#include <ardour/session_playlist.h>
#include <ardour/utils.h>
@ -156,8 +157,10 @@ AudioTimeAxisView::append_extra_display_menu_items ()
MenuList& items = display_menu->items();
// crossfade stuff
items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
}
// waveform menu
Menu *waveform_menu = manage(new Menu);
@ -177,8 +180,12 @@ AudioTimeAxisView::append_extra_display_menu_items ()
waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
if (!Profile->get_sae()) {
waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
} else {
rectified_item = 0;
}
waveform_items.push_back (SeparatorElem());
@ -194,9 +201,11 @@ AudioTimeAxisView::append_extra_display_menu_items ()
AudioStreamView* asv = audio_view();
if (asv) {
ignore_toggle = true;
if (asv->get_waveform_shape() == Rectified)
if (asv->get_waveform_shape() == Rectified && rectified_item) {
rectified_item->set_active(true);
else traditional_item->set_active(true);
} else {
traditional_item->set_active(true);
}
if (asv->get_waveform_scale() == LogWaveform)
logscale_item->set_active(true);

View file

@ -41,6 +41,7 @@ CANVAS_VARIABLE(canvasvar_MarkerBarSeparator, "marker bar separator")
CANVAS_VARIABLE(canvasvar_TempoBar, "tempo bar")
CANVAS_VARIABLE(canvasvar_MeterBar, "meter bar")
CANVAS_VARIABLE(canvasvar_MarkerBar, "marker bar")
CANVAS_VARIABLE(canvasvar_CDMarkerBar, "cd marker bar")
CANVAS_VARIABLE(canvasvar_RangeMarkerBar, "range marker bar")
CANVAS_VARIABLE(canvasvar_TransportMarkerBar, "transport marker bar")
CANVAS_VARIABLE(canvasvar_RangeDragBarRect, "range drag bar rect")

122
gtk2_ardour/cocoacarbon.mm Normal file
View file

@ -0,0 +1,122 @@
/*
Copyright (C) 2007 Paul Davis
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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Carbon/Carbon.h>
#undef check // stupid, stupid carbon
#include "ardour_ui.h"
#include "actions.h"
#include "opts.h"
#include "sync-menu.h"
#include <Appkit/Appkit.h>
sigc::signal<void,bool> ApplicationActivationChanged;
static EventHandlerRef application_event_handler_ref;
/* Called for clicks on the dock icon. Can be used to unminimize or
* create a new window for example.
*/
static OSErr
handle_reopen_application (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
cerr << "reopen app\n";
return noErr;
}
static OSErr
handle_quit_application (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
cerr << "quit app\n";
ARDOUR_UI::instance()->quit ();
return noErr;
}
static OSStatus
application_event_handler (EventHandlerCallRef nextHandlerRef, EventRef event, void *userData)
{
UInt32 eventKind = GetEventKind (event);
switch (eventKind) {
case kEventAppActivated:
ApplicationActivationChanged (true); // EMIT SIGNAL
return eventNotHandledErr;
case kEventAppDeactivated:
ApplicationActivationChanged (false); // EMIT SIGNAL
return eventNotHandledErr;
default:
// pass-thru all kEventClassApplication events we're not interested in.
break;
}
return eventNotHandledErr;
}
void
ARDOUR_UI::platform_specific ()
{
AEInstallEventHandler (kCoreEventClass, kAEReopenApplication,
handle_reopen_application, 0, true);
AEInstallEventHandler (kCoreEventClass, kAEQuitApplication,
handle_quit_application, 0, true);
Gtk::Widget* widget = ActionManager::get_widget ("/ui/Main/Session/Quit");
if (widget) {
ige_mac_menu_set_quit_menu_item ((GtkMenuItem*) widget->gobj());
}
IgeMacMenuGroup* group = ige_mac_menu_add_app_menu_group ();
widget = ActionManager::get_widget ("/ui/Main/Session/About");
if (widget) {
ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
}
widget = ActionManager::get_widget ("/ui/Main/Session/ToggleOptionsEditor");
if (widget) {
ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
}
EventTypeSpec applicationEventTypes[] = {
{kEventClassApplication, kEventAppActivated },
{kEventClassApplication, kEventAppDeactivated }
};
EventHandlerUPP ehUPP = NewEventHandlerUPP (application_event_handler);
InstallApplicationEventHandler (ehUPP, sizeof(applicationEventTypes) / sizeof(EventTypeSpec),
applicationEventTypes, 0, &application_event_handler_ref);
}
void
ARDOUR_UI::platform_setup ()
{
if (!ARDOUR_COMMAND_LINE::finder_invoked_ardour) {
/* if invoked from the command line, make sure we're visible */
[NSApp activateIgnoringOtherApps:YES];
}
}

View file

@ -637,9 +637,15 @@ CrossfadeEditor::redraw ()
for (list<Point*>::iterator i = fade[current].points.begin(); i != fade[current].points.end(); ++i) {
fade[current].normative_curve.add ((*i)->x, (*i)->y);
fade[current].gain_curve.add (((*i)->x * len), (*i)->y);
double offset;
if (current==In)
offset = xfade->in()->start();
else
offset = xfade->out()->start()+xfade->out()->length()-xfade->length();
fade[current].gain_curve.add (((*i)->x * len) + offset, (*i)->y);
}
size_t npoints = (size_t) effective_width();
float vec[npoints];
@ -1079,6 +1085,11 @@ CrossfadeEditor::make_waves (boost::shared_ptr<AudioRegion> region, WhichFade wh
waveview->property_amplitude_above_axis() = 2.0;
waveview->property_wave_color() = color;
if (which==In)
waveview->property_region_start() = region->start();
else
waveview->property_region_start() = region->start()+region->length()-xfade->length();
waveview->lower_to_bottom();
fade[which].waves.push_back (waveview);
}
@ -1110,13 +1121,13 @@ CrossfadeEditor::audition_both ()
nframes_t left_length;
if (preroll_button.get_active()) {
preroll = ARDOUR_UI::instance()->preroll_clock.current_duration ();
preroll = session.frame_rate() * 2; //2 second hardcoded preroll for now
} else {
preroll = 0;
}
if (postroll_button.get_active()) {
postroll = ARDOUR_UI::instance()->postroll_clock.current_duration ();
postroll = session.frame_rate() * 2; //2 second hardcoded postroll for now
} else {
postroll = 0;
}

View file

@ -18,7 +18,6 @@
*/
/* Changing this order will break the menu */
SNAPTYPE(SnapToFrame)
SNAPTYPE(SnapToCDFrame)
SNAPTYPE(SnapToSMPTEFrame)
SNAPTYPE(SnapToSMPTESeconds)
@ -33,13 +32,13 @@ SNAPTYPE(SnapToAThirdBeat)
SNAPTYPE(SnapToBeat)
SNAPTYPE(SnapToBar)
SNAPTYPE(SnapToMark)
SNAPTYPE(SnapToEditPoint)
SNAPTYPE(SnapToRegionStart)
SNAPTYPE(SnapToRegionEnd)
SNAPTYPE(SnapToRegionSync)
SNAPTYPE(SnapToRegionBoundary)
/* Changing this order will break the menu */
SNAPMODE(SnapOff)
SNAPMODE(SnapNormal)
SNAPMODE(SnapMagnetic)

View file

@ -110,7 +110,6 @@ const double Editor::timebar_height = 15.0;
#include "editor_xpms"
static const gchar *_snap_type_strings[] = {
N_("None"),
N_("CD Frames"),
N_("SMPTE Frames"),
N_("SMPTE Seconds"),
@ -125,7 +124,6 @@ static const gchar *_snap_type_strings[] = {
N_("Beats"),
N_("Bars"),
N_("Marks"),
N_("Edit Point"),
N_("Region starts"),
N_("Region ends"),
N_("Region syncs"),
@ -134,7 +132,8 @@ static const gchar *_snap_type_strings[] = {
};
static const gchar *_snap_mode_strings[] = {
N_("Normal"),
N_("No Grid"),
N_("Grid"),
N_("Magnetic"),
0
};
@ -152,7 +151,7 @@ static const gchar *_zoom_focus_strings[] = {
N_("Center"),
N_("Playhead"),
N_("Mouse"),
N_("Marker"),
N_("Edit Point"),
0
};
@ -186,14 +185,15 @@ Editor::Editor ()
minsec_label (_("Mins:Secs")),
bbt_label (_("Bars:Beats")),
smpte_label (_("Timecode")),
frame_label (_("Frames")),
frame_label (_("Samples")),
tempo_label (_("Tempo")),
meter_label (_("Meter")),
mark_label (_("Location Markers")),
range_mark_label (_("Range Markers")),
transport_mark_label (_("Loop/Punch Ranges")),
cd_mark_label (_("CD Markers")),
edit_packer (3, 3, false),
edit_packer (3, 3, true),
/* the values here don't matter: layout widgets
reset them as needed.
@ -221,7 +221,8 @@ Editor::Editor ()
/* nudge */
nudge_clock (X_("nudge"), false, X_("NudgeClock"), true, true)
nudge_clock (X_("nudge"), false, X_("NudgeClock"), true, true),
meters_running(false)
{
constructed = false;
@ -246,7 +247,6 @@ Editor::Editor ()
clicked_routeview = 0;
clicked_crossfadeview = 0;
clicked_control_point = 0;
latest_regionview = 0;
last_update_frame = 0;
drag_info.item = 0;
current_mixer_strip = 0;
@ -257,15 +257,6 @@ Editor::Editor ()
zoom_focus_strings = I18N (_zoom_focus_strings);
edit_point_strings = I18N (_edit_point_strings);
snap_type = SnapToFrame;
set_snap_to (snap_type);
snap_mode = SnapNormal;
set_snap_mode (snap_mode);
_edit_point = EditAtMouse;
set_edit_point_preference (_edit_point);
snap_threshold = 5.0;
bbt_beat_subdivision = 4;
canvas_width = 0;
@ -292,7 +283,8 @@ Editor::Editor ()
verbose_cursor_on = true;
route_removal = false;
show_automatic_regions_in_region_list = true;
region_list_sort_type = (Editing::RegionListSortType) 0;
region_list_sort_type = (Editing::RegionListSortType) 0;
have_pending_keyboard_selection = false;
_follow_playhead = true;
_xfade_visibility = true;
@ -322,7 +314,7 @@ Editor::Editor ()
entered_marker = 0;
clear_entered_track = false;
_new_regionviews_show_envelope = false;
current_timestretch = 0;
current_timefx = 0;
in_edit_group_row_change = false;
last_canvas_frame = 0;
playhead_cursor = 0;
@ -331,6 +323,8 @@ Editor::Editor ()
_dragging_playhead = false;
_dragging_edit_point = false;
_dragging_hscrollbar = false;
select_new_marker = false;
zoomed_to_region = false;
scrubbing_direction = 0;
@ -350,6 +344,8 @@ Editor::Editor ()
set_midi_edit_mode (MidiEditPencil, true);
set_mouse_mode (MouseObject, true);
last_visual_state.frames_per_unit = 0;
frames_per_unit = 2048; /* too early to use reset_zoom () */
reset_hscrollbar_stepping ();
@ -361,7 +357,7 @@ Editor::Editor ()
initialize_canvas ();
edit_controls_vbox.set_spacing (0);
horizontal_adjustment.signal_value_changed().connect (mem_fun(*this, &Editor::canvas_horizontally_scrolled));
horizontal_adjustment.signal_value_changed().connect (mem_fun(*this, &Editor::canvas_horizontally_scrolled), false);
vertical_adjustment.signal_value_changed().connect (mem_fun(*this, &Editor::tie_vertical_scrolling), true);
track_canvas.set_hadjustment (horizontal_adjustment);
@ -438,6 +434,10 @@ Editor::Editor ()
mark_label.set_size_request (-1, (int)timebar_height);
mark_label.set_alignment (1.0, 0.5);
mark_label.set_padding (5,0);
cd_mark_label.set_name ("EditorTimeButton");
cd_mark_label.set_size_request (-1, (int)timebar_height);
cd_mark_label.set_alignment (1.0, 0.5);
cd_mark_label.set_padding (5,0);
range_mark_label.set_name ("EditorTimeButton");
range_mark_label.set_size_request (-1, (int)timebar_height);
range_mark_label.set_alignment (1.0, 0.5);
@ -510,7 +510,7 @@ Editor::Editor ()
CellRendererToggle* route_list_visible_cell = dynamic_cast<CellRendererToggle*>(route_list_display.get_column_cell_renderer (0));
route_list_visible_cell->property_activatable() = true;
route_list_visible_cell->property_radio() = false;
route_display_model->signal_row_deleted().connect (mem_fun (*this, &Editor::route_list_delete));
route_display_model->signal_row_changed().connect (mem_fun (*this, &Editor::route_list_change));
@ -599,6 +599,10 @@ Editor::Editor ()
region_list_display.append_column (_("Regions"), region_list_columns.name);
region_list_display.set_headers_visible (false);
CellRendererText* region_name_cell = dynamic_cast<CellRendererText*>(region_list_display.get_column_cell_renderer (0));
region_name_cell->property_editable() = true;
region_name_cell->signal_edited().connect (mem_fun (*this, &Editor::region_name_edit));
region_list_display.get_selection()->set_select_function (mem_fun (*this, &Editor::region_list_selection_filter));
TreeViewColumn* tv_col = region_list_display.get_column(0);
@ -675,9 +679,12 @@ Editor::Editor ()
nlabel = manage (new Label (_("Edit Groups")));
nlabel->set_angle (-90);
the_notebook.append_page (*edit_group_display_packer, *nlabel);
nlabel = manage (new Label (_("Chunks")));
nlabel->set_angle (-90);
the_notebook.append_page (named_selection_scroller, *nlabel);
if (!Profile->get_sae()) {
nlabel = manage (new Label (_("Chunks")));
nlabel->set_angle (-90);
the_notebook.append_page (named_selection_scroller, *nlabel);
}
the_notebook.set_show_tabs (true);
the_notebook.set_scrollable (true);
@ -713,7 +720,14 @@ Editor::Editor ()
/* register actions now so that set_state() can find them and set toggles/checks etc */
register_actions ();
snap_type = SnapToBeat;
set_snap_to (snap_type);
snap_mode = SnapOff;
set_snap_mode (snap_mode);
_edit_point = EditAtMouse;
set_edit_point_preference (_edit_point);
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
set_state (*node);
@ -882,19 +896,6 @@ Editor::tie_vertical_scrolling ()
}
controls_layout.get_vadjustment()->set_value (y1);
#ifdef GTKOSX
/* the way idle updates and immediate window flushing work on GTK-Quartz
requires that we force an immediate redraw right here. The controls
layout will do the same all by itself, as does the canvas widget, but
most of the time, the canvas itself hasn't updated itself because its
idle handler hasn't run. consequently, the call that its layout makes
to gdk_window_process_updates() finds nothing to do. here, we force
the update to happen, then request a flush of the new window state.
*/
track_canvas.update_now ();
gdk_window_process_updates (GTK_LAYOUT(track_canvas.gobj())->bin_window, true);
#endif
}
void
@ -1277,6 +1278,8 @@ Editor::connect_to_session (Session *t)
/* register for undo history */
session->register_with_memento_command_factory(_id, this);
start_updating ();
}
void
@ -1320,6 +1323,14 @@ Editor::build_cursors ()
transparent_cursor = new Gdk::Cursor (bits, bits, c, c, 0, 0);
}
{
RefPtr<Bitmap> bits;
char pix[4] = { 0, 0, 0, 0 };
bits = Bitmap::create (pix, 2, 2);
Gdk::Color c;
transparent_cursor = new Gdk::Cursor (bits, bits, c, c, 0, 0);
}
grabber_cursor = new Gdk::Cursor (HAND2);
cross_hair_cursor = new Gdk::Cursor (CROSSHAIR);
trimmer_cursor = new Gdk::Cursor (SB_H_DOUBLE_ARROW);
@ -1602,10 +1613,21 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items)
items.push_back (MenuElem (_("Sync points"), *sync_point_menu));
add_item_with_sensitivity (items, MenuElem (_("Audition"), mem_fun(*this, &Editor::audition_selected_region)), selection->regions.size() == 1);
//add_item_with_sensitivity (items, MenuElem (_("Audition"), mem_fun(*this, &Editor::audition_selected_region)), selection->regions.size() == 1);
add_item_with_sensitivity (items, MenuElem (_("Export"), mem_fun(*this, &Editor::export_region)), selection->regions.size() == 1);
items.push_back (MenuElem (_("Rename"), mem_fun(*this, &Editor::rename_region)));
items.push_back (MenuElem (_("Popup region editor"), mem_fun(*this, &Editor::edit_region)));
items.push_back (MenuElem (_("Raise to top layer"), mem_fun(*this, &Editor::raise_region_to_top)));
items.push_back (MenuElem (_("Lower to bottom layer"), mem_fun (*this, &Editor::lower_region_to_bottom)));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Define sync point"), mem_fun(*this, &Editor::set_region_sync_from_edit_point)));
items.push_back (MenuElem (_("Remove sync point"), mem_fun(*this, &Editor::remove_region_sync)));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Audition"), mem_fun(*this, &Editor::play_selected_region)));
items.push_back (MenuElem (_("Export"), mem_fun(*this, &Editor::export_region)));
items.push_back (MenuElem (_("Bounce"), mem_fun(*this, &Editor::bounce_region_selection)));
#ifdef FFT_ANALYSIS
@ -1779,7 +1801,8 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items)
items.push_back (MenuElem (_("Trim"), *trim_menu));
items.push_back (MenuElem (_("Split"), (mem_fun(*this, &Editor::split_region))));
items.push_back (MenuElem (_("Make mono regions"), (mem_fun(*this, &Editor::split_multichannel_region))));
items.push_back (MenuElem (_("Duplicate"), (bind (mem_fun(*this, &Editor::duplicate_dialog), true))));
items.push_back (MenuElem (_("Duplicate"), (bind (mem_fun(*this, &Editor::duplicate_dialog), false))));
items.push_back (MenuElem (_("Multi-Duplicate"), (bind (mem_fun(*this, &Editor::duplicate_dialog), true))));
items.push_back (MenuElem (_("Fill track"), (mem_fun(*this, &Editor::region_fill_track))));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::remove_selected_regions)));
@ -1990,8 +2013,15 @@ Editor::add_bus_or_audio_track_context_items (Menu_Helpers::MenuList& edit_items
void
Editor::set_snap_to (SnapType st)
{
unsigned int snap_ind = (unsigned int)st;
snap_type = st;
string str = snap_type_strings[(int) st];
if ( snap_ind > snap_type_strings.size() - 1 ) {
snap_ind = 0;
snap_type = (SnapType)snap_ind;
}
string str = snap_type_strings[snap_ind];
if (str != snap_type_selector.get_active_text()) {
snap_type_selector.set_active_text (str);
@ -2029,6 +2059,8 @@ Editor::set_snap_mode (SnapMode mode)
void
Editor::set_edit_point_preference (EditPoint ep)
{
bool changed = _edit_point != ep;
_edit_point = ep;
string str = edit_point_strings[(int)ep];
@ -2036,6 +2068,33 @@ Editor::set_edit_point_preference (EditPoint ep)
edit_point_selector.set_active_text (str);
}
if (!changed) {
return;
}
if (Profile->get_sae()) {
switch (zoom_focus) {
case ZoomFocusMouse:
case ZoomFocusPlayhead:
case ZoomFocusEdit:
switch (_edit_point) {
case EditAtMouse:
set_zoom_focus (ZoomFocusMouse);
break;
case EditAtPlayhead:
set_zoom_focus (ZoomFocusPlayhead);
break;
case EditAtSelectedMarker:
set_zoom_focus (ZoomFocusEdit);
break;
}
break;
default:
break;
}
}
instant_save ();
}
@ -2314,7 +2373,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark)
Location* before = 0;
Location* after = 0;
if (!session) {
if (!session || snap_mode == SnapOff) {
return;
}
@ -2325,9 +2384,6 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark)
nframes64_t presnap = start;
switch (snap_type) {
case SnapToFrame:
break;
case SnapToCDFrame:
if (direction) {
start = (nframes_t) ceil ((double) start / (one_second / 75)) * (one_second / 75);
@ -2429,10 +2485,6 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark)
start = session->tempo_map().round_to_beat_subdivision (start, 3);
break;
case SnapToEditPoint:
start = get_preferred_edit_position ();
break;
case SnapToMark:
if (for_mark) {
return;
@ -2513,6 +2565,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark)
}
default:
/* handled at entry */
return;
}
@ -2563,8 +2616,11 @@ Editor::setup_toolbar ()
{
string pixmap_path;
#ifdef GTKOSX
const guint32 FUDGE = 38; // Combo's are stupid - they steal space from the entry for the button
#else
const guint32 FUDGE = 18; // Combo's are stupid - they steal space from the entry for the button
#endif
/* Mode Buttons (tool selection) */
@ -2573,12 +2629,17 @@ Editor::setup_toolbar ()
mouse_move_button.add (*(manage (new Image (::get_icon("tool_object")))));
mouse_move_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_move_button);
mouse_select_button.add (*(manage (new Image (get_xpm("tool_range.xpm")))));
mouse_select_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_select_button);
mouse_gain_button.add (*(manage (new Image (::get_icon("tool_gain")))));
mouse_gain_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_gain_button);
if (!Profile->get_sae()) {
mouse_select_button.add (*(manage (new Image (get_xpm("tool_range.xpm")))));
mouse_select_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_select_button);
mouse_gain_button.add (*(manage (new Image (::get_icon("tool_gain")))));
mouse_gain_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_gain_button);
}
mouse_zoom_button.add (*(manage (new Image (::get_icon("tool_zoom")))));
mouse_zoom_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_zoom_button);
@ -2599,9 +2660,13 @@ Editor::setup_toolbar ()
mode_box->set_spacing(4);
mouse_mode_button_box.set_spacing(1);
mouse_mode_button_box.pack_start(mouse_move_button, true, true);
mouse_mode_button_box.pack_start(mouse_select_button, true, true);
if (!Profile->get_sae()) {
mouse_mode_button_box.pack_start(mouse_select_button, true, true);
}
mouse_mode_button_box.pack_start(mouse_zoom_button, true, true);
mouse_mode_button_box.pack_start(mouse_gain_button, true, true);
if (!Profile->get_sae()) {
mouse_mode_button_box.pack_start(mouse_gain_button, true, true);
}
mouse_mode_button_box.pack_start(mouse_timefx_button, true, true);
mouse_mode_button_box.pack_start(mouse_audition_button, true, true);
mouse_mode_button_box.pack_start(mouse_note_button, true, true);
@ -2692,7 +2757,7 @@ Editor::setup_toolbar ()
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_full_button, _("Zoom to Session"));
zoom_focus_selector.set_name ("ZoomFocusSelector");
Gtkmm2ext::set_size_request_to_display_given_text (zoom_focus_selector, "Playhead", FUDGE, 0);
Gtkmm2ext::set_size_request_to_display_given_text (zoom_focus_selector, _("Playhead"), FUDGE, 0);
set_popdown_strings (zoom_focus_selector, zoom_focus_strings);
zoom_focus_selector.signal_changed().connect (mem_fun(*this, &Editor::zoom_focus_selection_done));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_focus_selector, _("Zoom focus"));
@ -2706,19 +2771,19 @@ Editor::setup_toolbar ()
snap_box.set_border_width (2);
snap_type_selector.set_name ("SnapTypeSelector");
Gtkmm2ext::set_size_request_to_display_given_text (snap_type_selector, "SMPTE Seconds", 2+FUDGE, 10);
Gtkmm2ext::set_size_request_to_display_given_text (snap_type_selector, _("SMPTE Seconds"), 2+FUDGE, 10);
set_popdown_strings (snap_type_selector, snap_type_strings);
snap_type_selector.signal_changed().connect (mem_fun(*this, &Editor::snap_type_selection_done));
ARDOUR_UI::instance()->tooltips().set_tip (snap_type_selector, _("Snap/Grid Units"));
snap_mode_selector.set_name ("SnapModeSelector");
Gtkmm2ext::set_size_request_to_display_given_text (snap_mode_selector, "Magnetic Snap", 2+FUDGE, 10);
Gtkmm2ext::set_size_request_to_display_given_text (snap_mode_selector, _("Magnetic Snap"), 2+FUDGE, 10);
set_popdown_strings (snap_mode_selector, snap_mode_strings);
snap_mode_selector.signal_changed().connect (mem_fun(*this, &Editor::snap_mode_selection_done));
ARDOUR_UI::instance()->tooltips().set_tip (snap_mode_selector, _("Snap/Grid Mode"));
edit_point_selector.set_name ("SnapModeSelector");
Gtkmm2ext::set_size_request_to_display_given_text (edit_point_selector, "Playhead", 2+FUDGE, 10);
Gtkmm2ext::set_size_request_to_display_given_text (edit_point_selector, _("Playhead"), 2+FUDGE, 10);
set_popdown_strings (edit_point_selector, edit_point_strings);
edit_point_selector.signal_changed().connect (mem_fun(*this, &Editor::edit_point_selection_done));
ARDOUR_UI::instance()->tooltips().set_tip (edit_point_selector, _("Edit point"));
@ -3090,50 +3155,67 @@ Editor::history_changed ()
}
void
Editor::duplicate_dialog (bool dup_region)
Editor::duplicate_dialog (bool with_dialog)
{
if (selection->regions.empty() && (selection->time.length() == 0)) {
return;
float times = 1.0f;
if (mouse_mode == MouseRange) {
if (selection->time.length() == 0) {
return;
}
}
ArdourDialog win ("duplicate dialog");
Label label (_("Duplicate how many times?"));
Adjustment adjustment (1.0, 1.0, 1000000.0, 1.0, 5.0);
SpinButton spinner (adjustment);
if (mouse_mode != MouseRange) {
win.get_vbox()->set_spacing (12);
win.get_vbox()->pack_start (label);
ensure_entered_region_selected (true);
/* dialogs have ::add_action_widget() but that puts the spinner in the wrong
place, visually. so do this by hand.
*/
win.get_vbox()->pack_start (spinner);
spinner.signal_activate().connect (sigc::bind (mem_fun (win, &ArdourDialog::response), RESPONSE_ACCEPT));
label.show ();
spinner.show ();
win.add_button (Stock::CANCEL, RESPONSE_CANCEL);
win.add_button (Stock::OK, RESPONSE_ACCEPT);
win.set_position (WIN_POS_MOUSE);
spinner.grab_focus ();
switch (win.run ()) {
case RESPONSE_ACCEPT:
break;
default:
return;
if (selection->regions.empty()) {
return;
}
}
float times = adjustment.get_value();
if (with_dialog) {
if (!selection->regions.empty()) {
duplicate_some_regions (selection->regions, times);
} else {
ArdourDialog win ("duplicate dialog");
Label label (_("Duplicate how many times?"));
Adjustment adjustment (1.0, 1.0, 1000000.0, 1.0, 5.0);
SpinButton spinner (adjustment);
win.get_vbox()->set_spacing (12);
win.get_vbox()->pack_start (label);
/* dialogs have ::add_action_widget() but that puts the spinner in the wrong
place, visually. so do this by hand.
*/
win.get_vbox()->pack_start (spinner);
spinner.signal_activate().connect (sigc::bind (mem_fun (win, &ArdourDialog::response), RESPONSE_ACCEPT));
label.show ();
spinner.show ();
win.add_button (Stock::OK, RESPONSE_ACCEPT);
win.add_button (Stock::CANCEL, RESPONSE_CANCEL);
win.set_position (WIN_POS_MOUSE);
spinner.grab_focus ();
switch (win.run ()) {
case RESPONSE_ACCEPT:
break;
default:
return;
}
times = adjustment.get_value();
}
if (mouse_mode == MouseRange) {
duplicate_selection (times);
} else {
duplicate_some_regions (selection->regions, times);
}
}
@ -3169,6 +3251,25 @@ Editor::set_verbose_canvas_cursor_text (const string & txt)
verbose_canvas_cursor->property_text() = txt.c_str();
}
void
Editor::set_edit_mode (EditMode m)
{
Config->set_edit_mode (m);
}
void
Editor::cycle_edit_mode ()
{
switch (Config->get_edit_mode()) {
case Slide:
Config->set_edit_mode (Splice);
break;
case Splice:
Config->set_edit_mode (Slide);
break;
}
}
void
Editor::edit_mode_selection_done ()
{
@ -3192,7 +3293,7 @@ void
Editor::snap_type_selection_done ()
{
string choice = snap_type_selector.get_active_text();
SnapType snaptype = SnapToFrame;
SnapType snaptype = SnapToBeat;
if (choice == _("Beats/3")) {
snaptype = SnapToAThirdBeat;
@ -3210,8 +3311,6 @@ Editor::snap_type_selection_done ()
snaptype = SnapToBar;
} else if (choice == _("Marks")) {
snaptype = SnapToMark;
} else if (choice == _("Edit Point")) {
snaptype = SnapToEditPoint;
} else if (choice == _("Region starts")) {
snaptype = SnapToRegionStart;
} else if (choice == _("Region ends")) {
@ -3232,8 +3331,6 @@ Editor::snap_type_selection_done ()
snaptype = SnapToSeconds;
} else if (choice == _("Minutes")) {
snaptype = SnapToMinutes;
} else if (choice == _("None")) {
snaptype = SnapToFrame;
}
RefPtr<RadioAction> ract = snap_type_action (snaptype);
@ -3248,7 +3345,9 @@ Editor::snap_mode_selection_done ()
string choice = snap_mode_selector.get_active_text();
SnapMode mode = SnapNormal;
if (choice == _("Normal")) {
if (choice == _("No Grid")) {
mode = SnapOff;
} else if (choice == _("Grid")) {
mode = SnapNormal;
} else if (choice == _("Magnetic")) {
mode = SnapMagnetic;
@ -3261,6 +3360,26 @@ Editor::snap_mode_selection_done ()
}
}
void
Editor::cycle_edit_point (bool with_marker)
{
switch (_edit_point) {
case EditAtMouse:
set_edit_point_preference (EditAtPlayhead);
break;
case EditAtPlayhead:
if (with_marker) {
set_edit_point_preference (EditAtSelectedMarker);
} else {
set_edit_point_preference (EditAtMouse);
}
break;
case EditAtSelectedMarker:
set_edit_point_preference (EditAtMouse);
break;
}
}
void
Editor::edit_point_selection_done ()
{
@ -3268,11 +3387,11 @@ Editor::edit_point_selection_done ()
EditPoint ep = EditAtSelectedMarker;
if (choice == _("Marker")) {
_edit_point = EditAtSelectedMarker;
set_edit_point_preference (EditAtSelectedMarker);
} else if (choice == _("Playhead")) {
_edit_point = EditAtPlayhead;
set_edit_point_preference (EditAtPlayhead);
} else {
_edit_point = EditAtMouse;
set_edit_point_preference (EditAtMouse);
}
RefPtr<RadioAction> ract = edit_point_action (ep);
@ -3925,6 +4044,13 @@ Editor::on_key_press_event (GdkEventKey* ev)
return key_press_focus_accelerator_handler (*this, ev);
}
bool
Editor::on_key_release_event (GdkEventKey* ev)
{
return Gtk::Window::on_key_release_event (ev);
// return key_press_focus_accelerator_handler (*this, ev);
}
void
Editor::reset_x_origin (nframes_t frame)
{
@ -3944,11 +4070,27 @@ Editor::reposition_and_zoom (nframes_t frame, double fpu)
reset_zoom (fpu);
}
void
Editor::swap_visual_state ()
{
if (last_visual_state.frames_per_unit == 0) {
// never set
return;
}
/* note: the correct functionality here is very dependent on the ordering of
setting zoom focus, horizontal position and finally zoom. this is because
it is set_frames_per_unit() that overwrites last_visual_state.
*/
set_zoom_focus (last_visual_state.zoom_focus);
reposition_and_zoom (last_visual_state.leftmost_frame, last_visual_state.frames_per_unit);
zoomed_to_region = false;
}
void
Editor::set_frames_per_unit (double fpu)
{
nframes_t frames;
/* this is the core function that controls the zoom level of the canvas. it is called
whenever one or more calls are made to reset_zoom(). it executes in an idle handler.
*/
@ -3961,9 +4103,6 @@ Editor::set_frames_per_unit (double fpu)
fpu = 2.0;
}
// convert fpu to frame count
frames = (nframes_t) floor (fpu * canvas_width);
/* don't allow zooms that fit more than the maximum number
of frames into an 800 pixel wide space.
@ -3976,8 +4115,25 @@ Editor::set_frames_per_unit (double fpu)
if (fpu == frames_per_unit) {
return;
}
last_visual_state.frames_per_unit = frames_per_unit;
last_visual_state.leftmost_frame = leftmost_frame;
last_visual_state.zoom_focus = zoom_focus;
frames_per_unit = fpu;
post_zoom ();
}
void
Editor::post_zoom ()
{
// convert fpu to frame count
nframes_t frames = (nframes_t) floor (frames_per_unit * canvas_width);
if (frames_per_unit != zoom_range_clock.current_duration()) {
zoom_range_clock.set (frames);
}
if (mouse_mode == MouseRange && selection->time.start () != selection->time.end_frame ()) {
if (!selection->tracks.empty()) {
@ -3995,7 +4151,7 @@ Editor::set_frames_per_unit (double fpu)
reset_hscrollbar_stepping ();
reset_scrolling_region ();
if (playhead_cursor) playhead_cursor->set_position (playhead_cursor->current_frame);
instant_save ();
@ -4006,7 +4162,7 @@ Editor::queue_visual_change (nframes_t where)
{
pending_visual_change.pending = VisualChange::Type (pending_visual_change.pending | VisualChange::TimeOrigin);
pending_visual_change.time_origin = where;
if (pending_visual_change.idle_handler_id < 0) {
pending_visual_change.idle_handler_id = g_idle_add (_idle_visual_changer, this);
}
@ -4036,7 +4192,7 @@ Editor::idle_visual_changer ()
VisualChange::Type p = pending_visual_change.pending;
pending_visual_change.pending = (VisualChange::Type) 0;
if (p & VisualChange::ZoomLevel) {
set_frames_per_unit (pending_visual_change.frames_per_unit);
@ -4046,9 +4202,11 @@ Editor::idle_visual_changer ()
update_tempo_based_rulers ();
}
if (p & VisualChange::TimeOrigin) {
if (pending_visual_change.time_origin != leftmost_frame) {
nframes_t time_origin = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
if (time_origin != pending_visual_change.time_origin) {
horizontal_adjustment.set_value (pending_visual_change.time_origin/frames_per_unit);
/* the signal handler will do the rest */
} else {
update_fixed_rulers();
redisplay_tempo (true);
@ -4073,22 +4231,35 @@ Editor::sort_track_selection ()
}
nframes64_t
Editor::get_preferred_edit_position()
Editor::get_preferred_edit_position (bool ignore_playhead)
{
bool ignored;
nframes64_t where = 0;
EditPoint ep = _edit_point;
switch (_edit_point) {
if (entered_marker) {
return entered_marker->position();
}
if (ignore_playhead && ep == EditAtPlayhead) {
ep = EditAtSelectedMarker;
}
switch (ep) {
case EditAtPlayhead:
where = session->audible_frame();
break;
case EditAtSelectedMarker:
if (!selection->markers.empty()) {
bool whocares;
Location* loc = find_location_from_marker (selection->markers.front(), whocares);
bool is_start;
Location* loc = find_location_from_marker (selection->markers.front(), is_start);
if (loc) {
where = loc->start();
if (is_start) {
where = loc->start();
} else {
where = loc->end();
}
break;
}
}
@ -4204,6 +4375,48 @@ Editor::get_regions_at (nframes64_t where, const TrackSelection& ts) const
return rs;
}
RegionSelection
Editor::get_regions_after (nframes64_t where, const TrackSelection& ts) const
{
RegionSelection rs;
const TrackSelection* tracks;
if (ts.empty()) {
tracks = &track_views;
} else {
tracks = &ts;
}
for (TrackSelection::const_iterator t = tracks->begin(); t != tracks->end(); ++t) {
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(*t);
if (atv) {
boost::shared_ptr<Diskstream> ds;
boost::shared_ptr<Playlist> pl;
if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()))) {
Playlist::RegionList* regions = pl->regions_touched ((nframes_t) floor ( (double)where * ds->speed()), max_frames);
for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
RegionView* rv = atv->audio_view()->find_view (*i);
if (rv) {
rs.push_back (rv);
}
}
delete regions;
}
}
}
return rs;
}
RegionSelection&
Editor::get_regions_for_action ()
{
@ -4215,3 +4428,37 @@ Editor::get_regions_for_action ()
tmp_regions = get_regions_at (where, selection->tracks);
return tmp_regions;
}
void
Editor::get_regions_corresponding_to (boost::shared_ptr<Region> region, vector<RegionView*>& regions)
{
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
RouteTimeAxisView* tatv;
if ((tatv = dynamic_cast<RouteTimeAxisView*> (*i)) != 0) {
boost::shared_ptr<Playlist> pl;
vector<boost::shared_ptr<Region> > results;
RegionView* marv;
boost::shared_ptr<Diskstream> ds;
if ((ds = tatv->get_diskstream()) == 0) {
/* bus */
continue;
}
if ((pl = (ds->playlist())) != 0) {
pl->get_region_list_equivalent_regions (region, results);
}
for (vector<boost::shared_ptr<Region> >::iterator ir = results.begin(); ir != results.end(); ++ir) {
if ((marv = tatv->view()->find_view (*ir)) != 0) {
regions.push_back (marv);
}
}
}
}
}

View file

@ -46,8 +46,8 @@
#include <pbd/stateful.h>
#include <ardour/session.h>
#include <ardour/stretch.h>
#include <ardour/tempo.h>
#include <ardour/stretch.h>
#include <ardour/location.h>
#include <ardour/audioregion.h>
@ -136,6 +136,8 @@ class Editor : public PublicEditor
return (nframes_t) floor (canvas_width * frames_per_unit);
}
void cycle_snap_mode ();
void cycle_snap_choice ();
void set_snap_to (Editing::SnapType);
void set_snap_mode (Editing::SnapMode);
void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
@ -177,6 +179,7 @@ class Editor : public PublicEditor
/* things that need to be public to be used in the main menubar */
void new_region_from_selection ();
void separate_regions_between (const TimeSelection&);
void separate_region_from_selection ();
void separate_regions_using_location (ARDOUR::Location&);
void toggle_playback (bool with_abort);
@ -222,6 +225,8 @@ class Editor : public PublicEditor
return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit)));
}
void flush_canvas ();
/* selection */
Selection& get_selection() const { return *selection; }
@ -234,6 +239,7 @@ class Editor : public PublicEditor
void select_all (Selection::Operation op);
void invert_selection_in_selected_tracks ();
void invert_selection ();
void deselect_all ();
/* tempo */
@ -260,7 +266,7 @@ class Editor : public PublicEditor
void set_zoom_focus (Editing::ZoomFocus);
Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
gdouble get_current_zoom () { return frames_per_unit; }
double get_current_zoom () const { return frames_per_unit; }
void temporal_zoom_step (bool coarser);
@ -268,8 +274,6 @@ class Editor : public PublicEditor
PlaylistSelector& playlist_selector() const;
void route_name_changed (TimeAxisView *);
gdouble frames_per_unit;
nframes_t leftmost_frame;
void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
void new_playlists (TimeAxisView* v);
@ -330,6 +334,8 @@ class Editor : public PublicEditor
/* layers */
void set_layer_model (ARDOUR::LayerModel);
void update_layering_model ();
void toggle_link_region_and_track_selection ();
/* redirect shared ops menu. caller must free returned menu */
@ -354,11 +360,13 @@ class Editor : public PublicEditor
void reset_zoom (double);
void reposition_and_zoom (nframes_t, double);
nframes64_t get_preferred_edit_position ();
nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
bool update_mouse_speed ();
bool decelerate_mouse_speed ();
void toggle_meter_updating();
protected:
void map_transport_state ();
void map_position_change (nframes_t);
@ -377,9 +385,24 @@ class Editor : public PublicEditor
PlaylistSelector* _playlist_selector;
void set_frames_per_unit (double);
struct VisualState {
double frames_per_unit;
nframes_t leftmost_frame;
Editing::ZoomFocus zoom_focus;
};
VisualState last_visual_state;
Editing::MouseMode mouse_mode;
nframes_t leftmost_frame;
double frames_per_unit;
Editing::ZoomFocus zoom_focus;
void use_visual_state (const VisualState&);
void set_frames_per_unit (double);
void swap_visual_state ();
void post_zoom ();
Editing::MouseMode mouse_mode;
Editing::MidiEditMode midi_edit_mode;
int post_maximal_editor_width;
@ -406,6 +429,7 @@ class Editor : public PublicEditor
void location_gone (ARDOUR::Location *);
void remove_marker (ArdourCanvas::Item&, GdkEvent*);
gint really_remove_marker (ARDOUR::Location* loc);
void goto_nth_marker (int nth);
uint32_t location_marker_color;
uint32_t location_range_color;
@ -438,7 +462,9 @@ class Editor : public PublicEditor
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
void clear_marker_display ();
void mouse_add_new_marker (nframes_t where);
void mouse_add_new_marker (nframes_t where, bool is_cd=false);
void update_cd_marker_display ();
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
TimeAxisView* clicked_axisview;
RouteTimeAxisView* clicked_routeview;
@ -447,8 +473,7 @@ class Editor : public PublicEditor
* editor_canvas_events.cc
*/
RegionView* clicked_regionview;
RegionView* latest_regionview;
RegionSelection latest_regionviews;
uint32_t clicked_selection;
CrossfadeView* clicked_crossfadeview;
ControlPoint* clicked_control_point;
@ -473,11 +498,12 @@ class Editor : public PublicEditor
void catch_vanishing_regionview (RegionView *);
bool set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
void select_all_tracks ();
bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
bool set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
void set_selected_track_as_side_effect (bool force = false);
bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
@ -539,6 +565,7 @@ class Editor : public PublicEditor
ArdourCanvas::Group *marker_group;
ArdourCanvas::Group *range_marker_group;
ArdourCanvas::Group *transport_marker_group;
ArdourCanvas::Group* cd_marker_group;
enum {
ruler_metric_smpte = 0,
@ -551,15 +578,17 @@ class Editor : public PublicEditor
ruler_time_marker = 6,
ruler_time_range_marker = 7,
ruler_time_transport_marker = 8,
ruler_time_cd_marker = 9,
};
static GtkCustomMetric ruler_metrics[4];
bool ruler_shown[9];
bool ruler_shown[10];
bool no_ruler_shown_update;
gint ruler_button_press (GdkEventButton*);
gint ruler_button_release (GdkEventButton*);
gint ruler_mouse_motion (GdkEventMotion*);
bool ruler_scroll (GdkEventScroll* event);
gint ruler_pressed_button;
Gtk::Widget * ruler_grabbed_widget;
@ -655,7 +684,8 @@ class Editor : public PublicEditor
ArdourCanvas::SimpleRect* marker_bar;
ArdourCanvas::SimpleRect* range_marker_bar;
ArdourCanvas::SimpleRect* transport_marker_bar;
ArdourCanvas::SimpleRect* cd_marker_bar;
Gtk::Label minsec_label;
Gtk::Label bbt_label;
Gtk::Label smpte_label;
@ -665,6 +695,7 @@ class Editor : public PublicEditor
Gtk::Label mark_label;
Gtk::Label range_mark_label;
Gtk::Label transport_mark_label;
Gtk::Label cd_mark_label;
Gtk::VBox time_button_vbox;
@ -692,17 +723,23 @@ class Editor : public PublicEditor
Cursor* playhead_cursor;
ArdourCanvas::Group* cursor_group;
void cursor_to_region_boundary (Cursor*, int32_t dir);
void cursor_to_next_region_boundary (Cursor*);
void cursor_to_previous_region_boundary (Cursor*);
void cursor_to_next_region_point (Cursor*, ARDOUR::RegionPoint);
void cursor_to_previous_region_point (Cursor*, ARDOUR::RegionPoint);
void cursor_to_region_point (Cursor*, ARDOUR::RegionPoint, int32_t dir);
void cursor_to_selection_start (Cursor *);
void cursor_to_selection_end (Cursor *);
void edit_point_to_next_region_point (ARDOUR::RegionPoint);
void edit_point_to_previous_region_point (ARDOUR::RegionPoint);
void edit_point_to_region_point (ARDOUR::RegionPoint, int32_t dir);
void edit_point_to_selection_start ();
void edit_point_to_selection_end ();
void selected_marker_to_region_boundary (int32_t dir);
void selected_marker_to_next_region_boundary ();
void selected_marker_to_previous_region_boundary ();
void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
void selected_marker_to_selection_start ();
void selected_marker_to_selection_end ();
void select_all_selectables_using_cursor (Cursor *, bool);
void select_all_selectables_using_edit (bool);
@ -710,6 +747,7 @@ class Editor : public PublicEditor
void select_range_between ();
boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
vector<nframes_t> region_boundary_cache;
void build_region_boundary_cache ();
@ -761,8 +799,7 @@ class Editor : public PublicEditor
void tie_vertical_scrolling ();
void canvas_horizontally_scrolled ();
static int _idle_canvas_horizontally_scrolled (void *arg);
bool idle_canvas_horizontally_scrolled ();
void canvas_scroll_to (nframes64_t);
struct VisualChange {
enum Type {
@ -803,8 +840,7 @@ class Editor : public PublicEditor
RegionListDisplayModelColumns region_list_columns;
Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > region_list_display;
std::list<sigc::connection> region_state_changed_connections;
Glib::RefPtr<Gtk::TreeStore> region_list_model;
Glib::RefPtr<Gtk::ToggleAction> toggle_full_region_list_action;
Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action;
@ -812,6 +848,8 @@ class Editor : public PublicEditor
void region_list_region_changed (ARDOUR::Change, boost::weak_ptr<ARDOUR::Region>);
void region_list_selection_changed ();
bool region_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
void region_name_edit (const Glib::ustring&, const Glib::ustring&);
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
Gtk::Menu *region_list_menu;
Gtk::ScrolledWindow region_list_scroller;
@ -961,14 +999,16 @@ class Editor : public PublicEditor
void toggle_region_lock ();
void toggle_region_opaque ();
void toggle_region_position_lock ();
void raise_region ();
void raise_region_to_top ();
void lower_region ();
void lower_region_to_bottom ();
void split_region ();
void split_region_at (nframes_t);
void split_regions_at (nframes_t, RegionSelection&);
void crop_region_to_selection ();
void crop_region_to (nframes_t start, nframes_t end);
void set_a_regions_sync_position (boost::shared_ptr<ARDOUR::Region>, nframes_t);
void set_sync_point (nframes64_t, const RegionSelection&);
void set_region_sync_from_edit_point ();
void remove_region_sync();
void align_selection (ARDOUR::RegionPoint, nframes_t position, const RegionSelection&);
@ -978,6 +1018,7 @@ class Editor : public PublicEditor
void remove_selected_regions ();
void remove_clicked_region ();
void edit_region ();
void rename_region ();
void duplicate_some_regions (RegionSelection&, float times);
void duplicate_selection (float times);
void region_fill_selection ();
@ -1010,28 +1051,24 @@ class Editor : public PublicEditor
int get_prefix (float&, bool&);
void keyboard_paste ();
void keyboard_duplicate_region ();
void keyboard_duplicate_selection ();
void keyboard_insert_region_list_selection ();
void region_from_selection ();
void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::AudioRegion> >&);
bool region_renamed;
void rename_region ();
void rename_region_finished (bool);
void play_from_start ();
void play_from_edit_point ();
void play_from_edit_point_and_return ();
void play_selected_region ();
void audition_selected_region ();
void play_edit_range ();
void loop_selected_region ();
void play_location (ARDOUR::Location&);
void loop_location (ARDOUR::Location&);
Editing::ZoomFocus zoom_focus;
void temporal_zoom_selection ();
void temporal_zoom_region ();
void toggle_zoom_region ();
bool zoomed_to_region;
void temporal_zoom_session ();
void temporal_zoom (gdouble scale);
void temporal_zoom_by_frame (nframes_t start, nframes_t end, const string & op);
@ -1137,15 +1174,21 @@ class Editor : public PublicEditor
void set_selection_from_loop ();
void set_selection_from_audio_region ();
void add_location_mark (nframes64_t where);
void add_location_from_audio_region ();
void add_location_from_selection ();
void set_loop_from_selection (bool play);
void set_punch_from_selection ();
void set_loop_from_edit_range (bool play);
void set_loop_from_region (bool play);
void set_punch_from_edit_range ();
void set_loop_range (nframes_t start, nframes_t end, std::string cmd);
void set_punch_range (nframes_t start, nframes_t end, std::string cmd);
void add_location_from_playhead_cursor ();
bool select_new_marker;
void reverse_selection ();
void edit_envelope ();
@ -1199,15 +1242,20 @@ class Editor : public PublicEditor
void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
void set_fade_length (bool in);
void toggle_fade_active (bool in);
void set_fade_in_active (bool);
void set_fade_out_active (bool);
std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
RegionSelection pre_drag_region_selection;
void region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
void region_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
void create_region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
void create_region_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
bool check_region_drag_possible (RouteTimeAxisView**);
void possibly_copy_regions_during_grab (GdkEvent*);
void region_drag_splice_motion_callback (ArdourCanvas::Item*, GdkEvent*);
void region_drag_splice_finished_callback (ArdourCanvas::Item*, GdkEvent*);
bool _dragging_playhead;
bool _dragging_edit_point;
@ -1282,6 +1330,7 @@ class Editor : public PublicEditor
bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
@ -1296,12 +1345,15 @@ class Editor : public PublicEditor
bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
bool track_canvas_scroll (GdkEventScroll* event);
bool time_canvas_scroll (GdkEventScroll* event);
bool track_canvas_scroll_event (GdkEventScroll* event);
bool track_canvas_button_press_event (GdkEventButton* event);
bool track_canvas_button_release_event (GdkEventButton* event);
bool track_canvas_motion_notify_event (GdkEventMotion* event);
bool time_canvas_scroll_event (GdkEventScroll* event);
Gtk::Allocation canvas_allocation;
bool canvas_idle_queued;
void track_canvas_allocate (Gtk::Allocation alloc);
@ -1311,11 +1363,8 @@ class Editor : public PublicEditor
void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
void kbd_mute_unmute_region ();
void kbd_set_sync_position ();
void kbd_brush ();
void kbd_audition ();
void kbd_do_set_sync_position (GdkEvent* ev);
void kbd_do_brush (GdkEvent*);
void kbd_do_audition (GdkEvent*);
@ -1396,6 +1445,7 @@ class Editor : public PublicEditor
Gtk::Menu* range_marker_menu;
Gtk::Menu* transport_marker_menu;
Gtk::Menu* new_transport_marker_menu;
Gtk::Menu* cd_marker_menu;
ArdourCanvas::Item* marker_menu_item;
typedef list<Marker*> Marks;
@ -1463,6 +1513,8 @@ class Editor : public PublicEditor
Gtk::ComboBoxText edit_mode_selector;
Gtk::VBox edit_mode_box;
void set_edit_mode (ARDOUR::EditMode);
void cycle_edit_mode ();
void edit_mode_selection_done ();
Gtk::ComboBoxText snap_type_selector;
@ -1553,7 +1605,8 @@ class Editor : public PublicEditor
/* transport range select process */
enum RangeMarkerOp {
CreateRangeMarker,
CreateTransportMarker
CreateTransportMarker,
CreateCDMarker
} range_marker_op;
void start_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event, RangeMarkerOp);
@ -1629,6 +1682,13 @@ class Editor : public PublicEditor
bool ignore_route_order_sync;
bool route_list_display_button_press (GdkEventButton*);
void route_list_display_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
gint x,
gint y,
const Gtk::SelectionData& data,
guint info,
guint time);
bool route_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
void route_list_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
@ -1724,7 +1784,11 @@ class Editor : public PublicEditor
void trim_finished_callback (ArdourCanvas::Item*, GdkEvent*);
void thaw_region_after_trim (RegionView& rv);
void trim_region_front();
void trim_region_back();
void trim_region (bool front);
void trim_region_to_edit_point ();
void trim_region_from_edit_point ();
void trim_region_to_loop ();
@ -1842,7 +1906,7 @@ class Editor : public PublicEditor
/* duplication */
void duplicate_dialog (bool for_region);
void duplicate_dialog (bool with_dialog);
nframes64_t event_frame (GdkEvent*, double* px = 0, double* py = 0) const;
@ -1854,9 +1918,16 @@ class Editor : public PublicEditor
void start_time_fx (ArdourCanvas::Item*, GdkEvent*);
void end_time_fx (ArdourCanvas::Item*, GdkEvent*);
struct TimeStretchDialog : public ArdourDialog {
ARDOUR::TimeStretchRequest request;
struct TimeFXDialog : public ArdourDialog {
ARDOUR::TimeFXRequest request;
Editor& editor;
bool pitching;
Gtk::Adjustment pitch_octave_adjustment;
Gtk::Adjustment pitch_semitone_adjustment;
Gtk::Adjustment pitch_cent_adjustment;
Gtk::SpinButton pitch_octave_spinner;
Gtk::SpinButton pitch_semitone_spinner;
Gtk::SpinButton pitch_cent_spinner;
RegionSelection regions;
Gtk::ProgressBar progress_bar;
Gtk::ToggleButton quick_button;
@ -1867,24 +1938,28 @@ class Editor : public PublicEditor
Gtk::VBox packer;
int status;
TimeStretchDialog (Editor& e);
TimeFXDialog (Editor& e, bool for_pitch);
gint update_progress ();
sigc::connection first_cancel;
sigc::connection first_delete;
void cancel_timestretch_in_progress ();
gint delete_timestretch_in_progress (GdkEventAny*);
void cancel_in_progress ();
gint delete_in_progress (GdkEventAny*);
};
/* "whats mine is yours" */
friend class TimeStretchDialog;
friend class TimeFXDialog;
TimeStretchDialog* current_timestretch;
TimeFXDialog* current_timefx;
static void* timestretch_thread (void *arg);
int run_timestretch (RegionSelection&, float fraction);
void do_timestretch (TimeStretchDialog&);
static void* timefx_thread (void *arg);
void do_timefx (TimeFXDialog&);
int time_stretch (RegionSelection&, float fraction);
int pitch_shift (RegionSelection&, float cents);
void pitch_shift_regions ();
int time_fx (RegionSelection&, float val, bool pitching);
/* editor-mixer strip */
@ -1986,7 +2061,8 @@ class Editor : public PublicEditor
TimeAxisView* entered_track;
RegionView* entered_regionview;
void ensure_entered_selected ();
void ensure_entered_region_selected (bool op_acts_on_objects = false);
void ensure_entered_track_selected (bool op_acts_on_objects = false);
bool clear_entered_track;
gint left_track_canvas (GdkEventCrossing*);
void set_entered_track (TimeAxisView*);
@ -2007,6 +2083,7 @@ class Editor : public PublicEditor
Gtk::CheckMenuItem* region_opaque_item;
bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*);
void session_state_saved (string);
@ -2022,6 +2099,7 @@ class Editor : public PublicEditor
Gtk::ComboBoxText edit_point_selector;
void set_edit_point_preference (Editing::EditPoint ep);
void cycle_edit_point (bool with_marker);
void set_edit_point ();
void edit_point_selection_done ();
void edit_point_chosen (Editing::EditPoint);
@ -2035,6 +2113,7 @@ class Editor : public PublicEditor
bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
RegionSelection get_regions_at (nframes64_t where, const TrackSelection& ts) const;
RegionSelection get_regions_after (nframes64_t where, const TrackSelection& ts) const;
RegionSelection tmp_regions;
@ -2043,10 +2122,11 @@ class Editor : public PublicEditor
sigc::connection fast_screen_update_connection;
gint start_updating ();
gint stop_updating ();
void toggle_meter_updating();
void fast_update_strips ();
bool meters_running;
void select_next_route ();
void select_prev_route ();
};
#endif /* __ardour_editor_h__ */

View file

@ -63,10 +63,13 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps"));
ActionManager::register_action (editor_actions, X_("Pullup"), _("Pullup / Pulldown"));
ActionManager::register_action (editor_actions, X_("Subframes"), _("Subframes"));
ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate To Markers"));
/* 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));
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);
act = ActionManager::register_toggle_action (editor_actions, "show-editor-list", _("Show Editor List"), mem_fun (*this, &Editor::editor_list_button_toggled));
@ -86,6 +89,11 @@ Editor::register_actions ()
act = ActionManager::register_toggle_action (editor_actions, "toggle-auto-xfades", _("Created Automatically"), mem_fun(*this, &Editor::toggle_auto_xfade));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "playhead-to-next-region-boundary", _("Playhead to Next Region Boundary"), bind (mem_fun(*this, &Editor::cursor_to_next_region_boundary), playhead_cursor));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-boundary", _("Playhead to Previous Region Boundary"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_boundary), playhead_cursor));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "playhead-to-next-region-start", _("Playhead to Next Region Start"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), playhead_cursor, RegionPoint (Start)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "playhead-to-next-region-end", _("Playhead to Next Region End"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), playhead_cursor, RegionPoint (End)));
@ -100,23 +108,28 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-sync", _("Playhead to Previous Region Sync"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), playhead_cursor, RegionPoint (SyncPoint)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-start", _("Edit Cursor to Next Region Start"), bind (mem_fun(*this, &Editor::edit_point_to_next_region_point), RegionPoint (Start)));
act = ActionManager::register_action (editor_actions, "selected-marker-to-next-region-boundary", _("to Next Region Boundary"), mem_fun(*this, &Editor::selected_marker_to_next_region_boundary));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-end", _("Edit Cursor to Next Region End"), bind (mem_fun(*this, &Editor::edit_point_to_next_region_point), RegionPoint (End)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-sync", _("Edit Cursor to Next Region Sync"), bind (mem_fun(*this, &Editor::edit_point_to_next_region_point), RegionPoint (SyncPoint)));
act = ActionManager::register_action (editor_actions, "selected-marker-to-previous-region-boundary", _("to Previous Region Boundary"), mem_fun(*this, &Editor::selected_marker_to_previous_region_boundary));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-start", _("Edit Cursor to Previous Region Start"), bind (mem_fun(*this, &Editor::edit_point_to_previous_region_point), RegionPoint (Start)));
act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-start", _("to Next Region Start"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (Start)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-end", _("Edit Cursor to Previous Region End"), bind (mem_fun(*this, &Editor::edit_point_to_previous_region_point), RegionPoint (End)));
act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-end", _("to Next Region End"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (End)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-sync", _("Edit Cursor to Previous Region Sync"), bind (mem_fun(*this, &Editor::edit_point_to_previous_region_point), RegionPoint (SyncPoint)));
act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-sync", _("to Next Region Sync"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (SyncPoint)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("Edit Cursor to Range Start"), mem_fun(*this, &Editor::edit_point_to_selection_start));
act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-start", _("to Previous Region Start"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (Start)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("Edit Cursor to Range End"), mem_fun(*this, &Editor::edit_point_to_selection_end));
act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-end", _("to Previous Region End"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (End)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-sync", _("to Previous Region Sync"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (SyncPoint)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("to Range Start"), mem_fun(*this, &Editor::selected_marker_to_selection_start));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("to Range End"), mem_fun(*this, &Editor::selected_marker_to_selection_end));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "playhead-to-range-start", _("Playhead to Range Start"), bind (mem_fun(*this, &Editor::cursor_to_selection_start), playhead_cursor));
@ -126,9 +139,13 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "select-all", _("Select All"), bind (mem_fun(*this, &Editor::select_all), Selection::Set));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Cursor"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
act = ActionManager::register_action (editor_actions, "deselect-all", _("Deselect All"), mem_fun(*this, &Editor::deselect_all));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Cursor"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
act = ActionManager::register_action (editor_actions, "invert-selection", _("Invert Selection"), mem_fun(*this, &Editor::invert_selection));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
ActionManager::session_sensitive_actions.push_back (act);
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));
@ -137,7 +154,7 @@ Editor::register_actions ()
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 Between 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 Within Playhead & Edit Point"), 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));
@ -147,6 +164,31 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-all-in-loop-range", _("Select All in Loop Range"), mem_fun(*this, &Editor::select_all_selectables_using_loop));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-next-route", _("Select Next Track/Bus"), mem_fun(*this, &Editor::select_next_route));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-prev-route", _("Select Previous Track/Bus"), mem_fun(*this, &Editor::select_prev_route));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-1", _("Locate to Mark 1"), bind (mem_fun (*this, &Editor::goto_nth_marker), 0));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-2", _("Locate to Mark 2"), bind (mem_fun (*this, &Editor::goto_nth_marker), 1));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-3", _("Locate to Mark 3"), bind (mem_fun (*this, &Editor::goto_nth_marker), 2));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-4", _("Locate to Mark 4"), bind (mem_fun (*this, &Editor::goto_nth_marker), 3));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-5", _("Locate to Mark 5"), bind (mem_fun (*this, &Editor::goto_nth_marker), 4));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-6", _("Locate to Mark 6"), bind (mem_fun (*this, &Editor::goto_nth_marker), 5));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-7", _("Locate to Mark 7"), bind (mem_fun (*this, &Editor::goto_nth_marker), 6));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-8", _("Locate to Mark 8"), bind (mem_fun (*this, &Editor::goto_nth_marker), 7));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-mark-9", _("Locate to Mark 9"), bind (mem_fun (*this, &Editor::goto_nth_marker), 8));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "jump-forward-to-mark", _("Jump Forward to Mark"), mem_fun(*this, &Editor::jump_forward_to_mark));
ActionManager::session_sensitive_actions.push_back (act);
@ -164,12 +206,17 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "nudge-next-backward", _("Nudge Next Backward"), bind (mem_fun(*this, &Editor::nudge_backward), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("Zoom Out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "temporal-zoom-in", _("Zoom In"), bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "zoom-to-session", _("Zoom to Session"), mem_fun(*this, &Editor::temporal_zoom_session));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), mem_fun(*this, &Editor::toggle_zoom_region));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up));
ActionManager::session_sensitive_actions.push_back (act);
@ -186,9 +233,9 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "center-playhead", _("Center Playhead"), mem_fun(*this, &Editor::center_playhead));
act = ActionManager::register_action (editor_actions, "center-playhead", _("to Center"), mem_fun(*this, &Editor::center_playhead));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("Center Edit Point"), mem_fun(*this, &Editor::center_edit_point));
act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("to Center"), mem_fun(*this, &Editor::center_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));;
@ -196,11 +243,15 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "scroll-playhead-backward", _("Playhead Backward"), bind (mem_fun(*this, &Editor::scroll_playhead), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("Playhead to Edit"), bind (mem_fun(*this, &Editor::cursor_align), true));
act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("to Edit"), bind (mem_fun(*this, &Editor::cursor_align), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Edit to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "trim-front", _("Trim start at edit point"), mem_fun(*this, &Editor::trim_region_front));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "trim-back", _("Trim end at edit point"), mem_fun(*this, &Editor::trim_region_back));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to edit point"), mem_fun(*this, &Editor::trim_region_from_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
@ -210,11 +261,28 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "trim-region-to-punch", _("Trim To Punch"), mem_fun(*this, &Editor::trim_region_to_punch));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-loop-from-edit-range", _("Set Loop From Edit Range"), bind (mem_fun(*this, &Editor::set_loop_from_edit_range), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-loop-from-region", _("Set Loop From Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "loop-region", _("Loop Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-punch-from-edit-range", _("Set Punch From Edit Range"), mem_fun(*this, &Editor::set_punch_from_edit_range));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "pitch-shift-region", _("Transpose"), mem_fun(*this, &Editor::pitch_shift_regions));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "toggle-fade-in-active", _("Toggle Fade In Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-fade-out-length", _("Set Fade Out Length"), bind (mem_fun(*this, &Editor::set_fade_length), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "toggle-fade-out-active", _("Toggle Fade Out Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "align-regions-start", _("Align Regions Start"), bind (mem_fun(*this, &Editor::align), ARDOUR::Start));
ActionManager::session_sensitive_actions.push_back (act);
@ -229,15 +297,19 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "align-regions-sync-relative", _("Align Regions Sync Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "audition-at-mouse", _("Audition at Mouse"), mem_fun(*this, &Editor::kbd_audition));
act = ActionManager::register_action (editor_actions, "play-from-edit-point", _("Play From Edit Point"), mem_fun(*this, &Editor::play_from_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "play-from-edit-point-and-return", _("Play from Edit Point & Return"), mem_fun(*this, &Editor::play_from_edit_point_and_return));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "play-edit-range", _("Play Edit Range"), mem_fun(*this, &Editor::play_edit_range));
act = ActionManager::register_action (editor_actions, "play-selected-regions", _("Play Selected Region(s)"), mem_fun(*this, &Editor::play_selected_region));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("Set Region Sync Position"), mem_fun(*this, &Editor::kbd_set_sync_position));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-playhead", _("Set Playhead"), mem_fun(*this, &Editor::set_playhead_cursor));
ActionManager::session_sensitive_actions.push_back (act);
@ -245,6 +317,8 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "split-region", _("Split Region"), mem_fun(*this, &Editor::split));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("Set Region Sync Position"), mem_fun(*this, &Editor::set_region_sync_from_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
undo_action = act = ActionManager::register_action (editor_actions, "undo", _("Undo"), bind (mem_fun(*this, &Editor::undo), 1U));
ActionManager::session_sensitive_actions.push_back (act);
@ -256,6 +330,10 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "export-range", _("Export Range"), mem_fun(*this, &Editor::export_selection));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection));
ActionManager::session_sensitive_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);
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 */
@ -265,9 +343,11 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "editor-paste", _("Paste"), mem_fun(*this, &Editor::keyboard_paste));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), mem_fun(*this, &Editor::keyboard_duplicate_region));
act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), mem_fun(*this, &Editor::keyboard_duplicate_selection));
act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "insert-region", _("Insert Region"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection));
ActionManager::session_sensitive_actions.push_back (act);
@ -333,17 +413,27 @@ Editor::register_actions ()
ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-selected-marker"), _("Marker"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change edit point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change edit point (w/Marker)"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), bind (mem_fun (*this, &Editor::set_edit_mode), Splice));
ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), bind (mem_fun (*this, &Editor::set_edit_mode), Slide));
ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Toggle Edit Mode"), mem_fun (*this, &Editor::cycle_edit_mode));
ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap To"));
ActionManager::register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
RadioAction::Group snap_mode_group;
ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Normal"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-off"), _("No Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapOff)));
ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
ActionManager::register_action (editor_actions, X_("cycle-snap-mode"), _("Next Snap Mode"), mem_fun (*this, &Editor::cycle_snap_mode));
ActionManager::register_action (editor_actions, X_("cycle-snap-choice"), _("Next Snap Choice"), mem_fun (*this, &Editor::cycle_snap_choice));
Glib::RefPtr<ActionGroup> snap_actions = ActionGroup::create (X_("Snap"));
RadioAction::Group snap_choice_group;
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-frame"), _("Snap to frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToFrame)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-cd-frame"), _("Snap to cd frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToCDFrame)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-frame"), _("Snap to SMPTE frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTEFrame)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-seconds"), _("Snap to SMPTE seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTESeconds)));
@ -358,7 +448,6 @@ Editor::register_actions ()
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-beat"), _("Snap to beat"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeat)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-bar"), _("Snap to bar"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBar)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-mark"), _("Snap to mark"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMark)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-edit-cursor"), _("Snap to edit point"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToEditPoint)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-start"), _("Snap to region start"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionStart)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-end"), _("Snap to region end"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionEnd)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("Snap to region sync"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionSync)));
@ -567,6 +656,7 @@ Editor::update_crossfade_model ()
}
}
void
Editor::update_smpte_mode ()
{
@ -721,9 +811,6 @@ Editor::snap_type_action (SnapType type)
RefPtr<Action> act;
switch (type) {
case Editing::SnapToFrame:
action = "snap-to-frame";
break;
case Editing::SnapToCDFrame:
action = "snap-to-cd-frame";
break;
@ -766,9 +853,6 @@ Editor::snap_type_action (SnapType type)
case Editing::SnapToMark:
action = "snap-to-mark";
break;
case Editing::SnapToEditPoint:
action = "snap-to-edit-cursor";
break;
case Editing::SnapToRegionStart:
action = "snap-to-region-start";
break;
@ -798,6 +882,67 @@ Editor::snap_type_action (SnapType type)
}
}
void
Editor::cycle_snap_choice()
{
switch (snap_type) {
case Editing::SnapToCDFrame:
set_snap_to (Editing::SnapToSMPTEFrame);
break;
case Editing::SnapToSMPTEFrame:
set_snap_to (Editing::SnapToSMPTESeconds);
break;
case Editing::SnapToSMPTESeconds:
set_snap_to (Editing::SnapToSMPTEMinutes);
break;
case Editing::SnapToSMPTEMinutes:
set_snap_to (Editing::SnapToSeconds);
break;
case Editing::SnapToSeconds:
set_snap_to (Editing::SnapToMinutes);
break;
case Editing::SnapToMinutes:
set_snap_to (Editing::SnapToAThirtysecondBeat);
break;
case Editing::SnapToAThirtysecondBeat:
set_snap_to (Editing::SnapToASixteenthBeat);
break;
case Editing::SnapToASixteenthBeat:
set_snap_to (Editing::SnapToAEighthBeat);
break;
case Editing::SnapToAEighthBeat:
set_snap_to (Editing::SnapToAQuarterBeat);
break;
case Editing::SnapToAQuarterBeat:
set_snap_to (Editing::SnapToAThirdBeat);
break;
case Editing::SnapToAThirdBeat:
set_snap_to (Editing::SnapToBeat);
break;
case Editing::SnapToBeat:
set_snap_to (Editing::SnapToBar);
break;
case Editing::SnapToBar:
set_snap_to (Editing::SnapToMark);
break;
case Editing::SnapToMark:
set_snap_to (Editing::SnapToRegionStart);
break;
case Editing::SnapToRegionStart:
set_snap_to (Editing::SnapToRegionEnd);
break;
case Editing::SnapToRegionEnd:
set_snap_to (Editing::SnapToRegionSync);
break;
case Editing::SnapToRegionSync:
set_snap_to (Editing::SnapToRegionBoundary);
break;
case Editing::SnapToRegionBoundary:
set_snap_to (Editing::SnapToCDFrame);
break;
}
}
void
Editor::snap_type_chosen (SnapType type)
{
@ -820,6 +965,9 @@ Editor::snap_mode_action (SnapMode mode)
RefPtr<Action> act;
switch (mode) {
case Editing::SnapOff:
action = X_("snap-off");
break;
case Editing::SnapNormal:
action = X_("snap-normal");
break;
@ -843,6 +991,22 @@ Editor::snap_mode_action (SnapMode mode)
}
}
void
Editor::cycle_snap_mode ()
{
switch (snap_mode) {
case SnapOff:
set_snap_mode (SnapNormal);
break;
case SnapNormal:
set_snap_mode (SnapMagnetic);
break;
case SnapMagnetic:
set_snap_mode (SnapOff);
break;
}
}
void
Editor::snap_mode_chosen (SnapMode mode)
{
@ -1171,6 +1335,12 @@ Editor::toggle_xfade_visibility ()
ActionManager::toggle_config_state ("Editor", "toggle-xfades-visible", &Configuration::set_xfades_visible, &Configuration::get_xfades_visible);
}
void
Editor::toggle_link_region_and_track_selection ()
{
ActionManager::toggle_config_state ("Editor", "link-region-and-track-selection", &Configuration::set_link_region_and_track_selection, &Configuration::get_link_region_and_track_selection);
}
/** A Configuration parameter has changed.
* @param parameter_name Name of the changed parameter.
*/
@ -1178,7 +1348,7 @@ void
Editor::parameter_changed (const char* parameter_name)
{
#define PARAM_IS(x) (!strcmp (parameter_name, (x)))
//cerr << "Editor::parameter_changed: " << parameter_name << endl;
ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::parameter_changed), parameter_name));
if (PARAM_IS ("auto-loop")) {
@ -1210,7 +1380,9 @@ Editor::parameter_changed (const char* parameter_name)
update_just_smpte ();
} else if (PARAM_IS ("show-track-meters")) {
toggle_meter_updating();
}
} else if (PARAM_IS ("link-region-and-track-selection")) {
ActionManager::map_some_state ("Editor", "link-region-and-track-selection", &Configuration::get_link_region_and_track_selection);
}
#undef PARAM_IS
}

View file

@ -33,37 +33,6 @@
using namespace ARDOUR;
using namespace PBD;
void
Editor::set_loop_from_selection (bool play)
{
if (session == 0 || selection->time.empty()) {
return;
}
nframes_t start = selection->time[clicked_selection].start;
nframes_t end = selection->time[clicked_selection].end;
set_loop_range (start, end, _("set loop range from selection"));
if (play) {
session->request_play_loop (true);
session->request_locate (start, true);
}
}
void
Editor::set_punch_from_selection ()
{
if (session == 0 || selection->time.empty()) {
return;
}
nframes_t start = selection->time[clicked_selection].start;
nframes_t end = selection->time[clicked_selection].end;
set_punch_range (start, end, _("set punch range from selection"));
}
void
Editor::set_show_waveforms (bool yn)
{

View file

@ -113,6 +113,9 @@ Editor::initialize_canvas ()
track_canvas.signal_button_press_event().connect (mem_fun (*this, &Editor::track_canvas_button_press_event));
track_canvas.signal_button_release_event().connect (mem_fun (*this, &Editor::track_canvas_button_release_event));
/* just scroll stuff for the timecanvas */
time_canvas.signal_scroll_event().connect (mem_fun (*this, &Editor::time_canvas_scroll_event));
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));
@ -173,6 +176,7 @@ Editor::initialize_canvas ()
range_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 2.0);
transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 3.0);
marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0);
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);
@ -185,6 +189,10 @@ Editor::initialize_canvas ()
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;
cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
cd_marker_bar->property_outline_what() = (0x1 | 0x8);
cd_marker_bar->property_outline_pixels() = 1;
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);
@ -252,6 +260,7 @@ Editor::initialize_canvas ()
tempo_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_tempo_bar_event), tempo_bar));
meter_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_meter_bar_event), meter_bar));
marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_marker_bar_event), marker_bar));
cd_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_cd_marker_bar_event), cd_marker_bar));
range_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_range_marker_bar_event), range_marker_bar));
transport_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_transport_marker_bar_event), transport_marker_bar));
@ -291,7 +300,6 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc)
}
initial_ruler_update_required = false;
track_canvas_size_allocated ();
}
@ -327,8 +335,10 @@ Editor::track_canvas_size_allocated ()
reset_scrolling_region ();
if (playhead_cursor) playhead_cursor->set_length (canvas_height);
// EDIT CURSOR XXX set line height for selected markers here
for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
(*x)->set_line_length (canvas_height);
}
if (range_marker_drag_rect) {
range_marker_drag_rect->property_y1() = 0.0;
@ -355,6 +365,7 @@ Editor::track_canvas_size_allocated ()
transport_punchout_line->property_y2() = canvas_height;
}
compute_fixed_ruler_scale ();
update_fixed_rulers();
redisplay_tempo (true);
@ -382,12 +393,20 @@ Editor::reset_scrolling_region (Gtk::Allocation* alloc)
}
}
double last_canvas_unit = last_canvas_frame / frames_per_unit;
double last_canvas_unit = max ((last_canvas_frame / frames_per_unit), canvas_width);
track_canvas.set_scroll_region (0.0, 0.0, max (last_canvas_unit, canvas_width), pos);
track_canvas.set_scroll_region (0.0, 0.0, last_canvas_unit, pos);
// XXX what is the correct height value for the time canvas ? this overstates it
time_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_width), canvas_height);
time_canvas.set_scroll_region ( 0.0, 0.0, last_canvas_unit, canvas_height);
range_marker_drag_rect->property_y2() = canvas_height;
transport_loop_range_rect->property_y2() = canvas_height;
transport_punch_range_rect->property_y2() = canvas_height;
transport_punchin_line->property_y2() = canvas_height;
transport_punchout_line->property_y2() = canvas_height;
update_punch_range_view (true);
controls_layout.queue_resize();
}
@ -399,8 +418,8 @@ Editor::controls_layout_size_request (Requisition* req)
TreeModel::Children::iterator i;
double pos;
for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
TimeAxisView *tv = (*i)[route_display_columns.tv];
for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
TimeAxisView *tv = (*i)[route_display_columns.tv];
if (tv != 0) {
pos += tv->effective_height;
}
@ -412,12 +431,9 @@ Editor::controls_layout_size_request (Requisition* req)
screen = Gdk::Screen::get_default();
}
/* never let the width of the controls area shrink horizontally */
edit_controls_vbox.check_resize();
req->width = max (edit_controls_vbox.get_width(), controls_layout.get_width());
/* don't get too big. the fudge factors here are just guesses */
req->width = min (req->width, screen->get_width() - 300);
@ -426,8 +442,13 @@ Editor::controls_layout_size_request (Requisition* req)
/* this one is important: it determines how big the layout thinks it really is, as
opposed to what it displays on the screen
*/
controls_layout.set_size (edit_controls_vbox.get_width(), (gint) pos);
controls_layout.set_size_request(edit_controls_vbox.get_width(), -1);
zoom_box.set_size_request(edit_controls_vbox.get_width(), -1);
time_button_frame.set_size_request(edit_controls_vbox.get_width() + edit_vscrollbar.get_width(), -1);
controls_layout.set_size (req->width, (gint) pos);
//cerr << "sizes = " << req->width << " " << edit_controls_vbox.get_width() << " " << controls_layout.get_width() << " " << zoom_box.get_width() << " " << time_button_frame.get_width() << endl;//DEBUG
}
bool
@ -700,17 +721,19 @@ Editor::left_track_canvas (GdkEventCrossing *ev)
void
Editor::canvas_horizontally_scrolled ()
{
cerr << "chs\n";
nframes64_t time_origin = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
/* this is the core function that controls horizontal scrolling of the canvas. it is called
whenever the horizontal_adjustment emits its "value_changed" signal. it typically executes in an
idle handler, which is important because tempo_map_changed() should issue redraws immediately
and not defer them to an idle handler.
*/
if (time_origin != leftmost_frame) {
canvas_scroll_to (time_origin);
}
}
leftmost_frame = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
void
Editor::canvas_scroll_to (nframes64_t time_origin)
{
leftmost_frame = time_origin;
nframes_t rightmost_frame = leftmost_frame + current_page_frames ();
if (rightmost_frame > last_canvas_frame) {
last_canvas_frame = rightmost_frame;
reset_scrolling_region ();
@ -740,6 +763,9 @@ Editor::color_handler()
marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBar.get();
marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
cd_marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CDMarkerBar.get();
cd_marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
range_marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeMarkerBar.get();
range_marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();

View file

@ -52,10 +52,13 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
{
int x, y;
double wx, wy;
nframes_t xdelta;
int direction = ev->direction;
switch (ev->direction) {
retry:
switch (direction) {
case GDK_SCROLL_UP:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
//if (ev->state == GDK_CONTROL_MASK) {
/* XXX
the ev->x will be out of step with the canvas
@ -75,7 +78,10 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
nframes_t where = event_frame (&event, 0, 0);
temporal_zoom_to_frame (false, where);
return true;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
direction = GDK_SCROLL_LEFT;
goto retry;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
if (!(current_stepping_trackview = trackview_by_y_position (ev->y))) {
@ -90,8 +96,9 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
return true;
}
break;
case GDK_SCROLL_DOWN:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
//if (ev->state == GDK_CONTROL_MASK) {
track_canvas.get_pointer (x, y);
track_canvas.window_to_world (x, y, wx, wy);
@ -106,7 +113,10 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
nframes_t where = event_frame (&event, 0, 0);
temporal_zoom_to_frame (true, where);
return true;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
direction = GDK_SCROLL_RIGHT;
goto retry;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
if (!(current_stepping_trackview = trackview_by_y_position (ev->y))) {
@ -122,8 +132,26 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
}
break;
case GDK_SCROLL_LEFT:
xdelta = (current_page_frames() / 2);
if (leftmost_frame > xdelta) {
reset_x_origin (leftmost_frame - xdelta);
} else {
reset_x_origin (0);
}
break;
case GDK_SCROLL_RIGHT:
xdelta = (current_page_frames() / 2);
if (max_frames - xdelta > leftmost_frame) {
reset_x_origin (leftmost_frame + xdelta);
} else {
reset_x_origin (max_frames - current_page_frames());
}
break;
default:
/* no left/right handling yet */
/* what? */
break;
}
@ -138,9 +166,59 @@ Editor::track_canvas_scroll_event (GdkEventScroll *event)
return false;
}
bool
Editor::time_canvas_scroll (GdkEventScroll* ev)
{
nframes_t xdelta;
int direction = ev->direction;
switch (direction) {
case GDK_SCROLL_UP:
temporal_zoom_step (true);
break;
case GDK_SCROLL_DOWN:
temporal_zoom_step (false);
break;
case GDK_SCROLL_LEFT:
xdelta = (current_page_frames() / 2);
if (leftmost_frame > xdelta) {
reset_x_origin (leftmost_frame - xdelta);
} else {
reset_x_origin (0);
}
break;
case GDK_SCROLL_RIGHT:
xdelta = (current_page_frames() / 2);
if (max_frames - xdelta > leftmost_frame) {
reset_x_origin (leftmost_frame + xdelta);
} else {
reset_x_origin (max_frames - current_page_frames());
}
break;
default:
/* what? */
break;
}
return false;
}
bool
Editor::time_canvas_scroll_event (GdkEventScroll *event)
{
time_canvas.grab_focus();
time_canvas_scroll (event);
return false;
}
bool
Editor::track_canvas_button_press_event (GdkEventButton *event)
{
selection->clear ();
track_canvas.grab_focus();
return false;
}
@ -170,6 +248,11 @@ Editor::track_canvas_motion (GdkEvent *ev)
verbose_canvas_cursor->property_x() = ev->motion.x + 20;
verbose_canvas_cursor->property_y() = ev->motion.y + 20;
}
#ifdef GTKOSX
flush_canvas ();
#endif
return false;
}
@ -235,10 +318,12 @@ Editor::canvas_region_view_event (GdkEvent *event, ArdourCanvas::Item* item, Reg
break;
case GDK_ENTER_NOTIFY:
set_entered_track (&rv->get_time_axis_view ());
set_entered_regionview (rv);
break;
case GDK_LEAVE_NOTIFY:
set_entered_track (0);
set_entered_regionview (0);
break;
@ -274,6 +359,11 @@ Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, Rou
break;
case GDK_ENTER_NOTIFY:
set_entered_track (tv);
break;
case GDK_LEAVE_NOTIFY:
set_entered_track (0);
break;
default:
@ -283,8 +373,6 @@ Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, Rou
return ret;
}
bool
Editor::canvas_automation_track_event (GdkEvent *event, ArdourCanvas::Item* item, AutomationTimeAxisView *atv)
{
@ -805,6 +893,12 @@ Editor::canvas_transport_marker_bar_event (GdkEvent *event, ArdourCanvas::Item*
return typed_event (item, event, TransportMarkerBarItem);
}
bool
Editor::canvas_cd_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
{
return typed_event (item, event, CdMarkerBarItem);
}
bool
Editor::canvas_tempo_marker_event (GdkEvent *event, ArdourCanvas::Item* item, TempoMarker* marker)
{

View file

@ -103,7 +103,7 @@ Editor::export_region ()
ExportDialog* dialog = new ExportRegionDialog (*this, r);
dialog->connect_to_session (session);
dialog->set_range (r->first_frame(), r->last_frame());
dialog->set_range (clicked_regionview->region()->first_frame(), clicked_regionview->region()->last_frame());
dialog->start_export();
}

View file

@ -27,6 +27,7 @@ enum ItemType {
MarkerItem,
MarkerBarItem,
RangeMarkerBarItem,
CdMarkerBarItem,
TransportMarkerBarItem,
SelectionItem,
ControlPointItem,

View file

@ -90,29 +90,6 @@ Editor::kbd_mute_unmute_region ()
}
}
void
Editor::kbd_set_sync_position ()
{
kbd_driver (mem_fun(*this, &Editor::kbd_do_set_sync_position), true, true, false);
}
void
Editor::kbd_do_set_sync_position (GdkEvent* ev)
{
if (entered_regionview) {
nframes64_t where = event_frame (ev);
snap_to (where);
set_a_regions_sync_position (entered_regionview->region(), where);
} else if (entered_marker) {
if (!selection->regions.empty()) {
set_a_regions_sync_position (selection->regions.front()->region(), entered_marker->position());
}
}
}
void
Editor::kbd_do_brush (GdkEvent *ev)
{
@ -125,14 +102,3 @@ Editor::kbd_brush ()
kbd_driver (mem_fun(*this, &Editor::kbd_do_brush), true, true, false);
}
void
Editor::kbd_do_audition (GdkEvent *ignored)
{
audition_selected_region ();
}
void
Editor::kbd_audition ()
{
kbd_driver (mem_fun(*this, &Editor::kbd_do_audition), true, false, true);
}

View file

@ -25,6 +25,7 @@
#include <ardour/session.h>
#include <ardour/region.h>
#include <gtkmm/treeview.h>
#include "ardour_ui.h"
#include "editor.h"
@ -41,8 +42,6 @@ using namespace sigc;
void
Editor::keyboard_selection_finish (bool add)
{
cerr << "here\n";
if (session && have_pending_keyboard_selection) {
nframes64_t end;
@ -86,60 +85,17 @@ Editor::keyboard_selection_begin ()
}
}
void
Editor::keyboard_duplicate_region ()
{
if (selection->regions.empty()) {
return;
}
float prefix = 0;
bool was_floating;
if (get_prefix (prefix, was_floating) == 0) {
duplicate_some_regions (selection->regions, prefix);
} else {
duplicate_some_regions (selection->regions, 1);
}
}
void
Editor::keyboard_duplicate_selection ()
{
float prefix = 0;
bool was_floating;
if (get_prefix (prefix, was_floating) == 0) {
duplicate_selection (prefix);
} else {
duplicate_selection (1);
}
}
void
Editor::keyboard_paste ()
{
float prefix = 0;
bool was_floating;
if (get_prefix (prefix, was_floating) == 0) {
paste (prefix);
} else {
paste (1);
}
ensure_entered_track_selected (true);
paste (1);
}
void
Editor::keyboard_insert_region_list_selection ()
{
float prefix = 0;
bool was_floating;
if (get_prefix (prefix, was_floating) == 0) {
insert_region_list_selection (prefix);
} else {
insert_region_list_selection (1);
}
insert_region_list_selection (1);
}
int

View file

@ -26,6 +26,7 @@
#include <gtkmm2ext/window_title.h>
#include <ardour/location.h>
#include <ardour/profile.h>
#include <pbd/memento_command.h>
#include "editor.h"
@ -77,9 +78,15 @@ Editor::add_new_location (Location *location)
}
if (location->is_mark()) {
lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
lam->end = 0;
if (location->is_cd_marker() && ruler_shown[ruler_time_cd_marker]) {
lam->start = new Marker (*this, *cd_marker_group, color, location->name(), Marker::Mark, location->start());
}
else {
lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
}
lam->end = 0;
} else if (location->is_auto_loop()) {
// transport marker
lam->start = new Marker (*this, *transport_marker_group, color,
@ -95,12 +102,20 @@ Editor::add_new_location (Location *location)
location->name(), Marker::PunchOut, location->end());
} else {
// range marker
lam->start = new Marker (*this, *range_marker_group, color,
location->name(), Marker::Start, location->start());
lam->end = new Marker (*this, *range_marker_group, color,
location->name(), Marker::End, location->end());
if (location->is_cd_marker() && ruler_shown[ruler_time_cd_marker]) {
lam->start = new Marker (*this, *cd_marker_group, color,
location->name(), Marker::Start, location->start());
lam->end = new Marker (*this, *cd_marker_group, color,
location->name(), Marker::End, location->end());
}
else {
lam->start = new Marker (*this, *range_marker_group, color,
location->name(), Marker::Start, location->start());
lam->end = new Marker (*this, *range_marker_group, color,
location->name(), Marker::End, location->end());
}
}
if (location->is_hidden ()) {
@ -121,6 +136,11 @@ Editor::add_new_location (Location *location)
newpair.second = lam;
location_markers.insert (newpair);
if (select_new_marker && location->is_mark()) {
selection->set (lam->start);
select_new_marker = false;
}
}
void
@ -157,6 +177,9 @@ Editor::location_flags_changed (Location *location, void *src)
return;
}
// move cd markers to/from cd marker bar as appropriate
ensure_cd_marker_updated (lam, location);
if (location->is_cd_marker()) {
lam->set_color_rgba (location_cd_marker_color);
} else if (location->is_mark()) {
@ -176,6 +199,52 @@ Editor::location_flags_changed (Location *location, void *src)
}
}
void Editor::update_cd_marker_display ()
{
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
LocationMarkers * lam = i->second;
Location * location = i->first;
ensure_cd_marker_updated (lam, location);
}
}
void Editor::ensure_cd_marker_updated (LocationMarkers * lam, Location * location)
{
if (location->is_cd_marker()
&& (ruler_shown[ruler_time_cd_marker] && lam->start->get_parent() != cd_marker_group))
{
//cerr << "reparenting non-cd marker so it can be relocated: " << location->name() << endl;
if (lam->start) {
lam->start->reparent (*cd_marker_group);
}
if (lam->end) {
lam->end->reparent (*cd_marker_group);
}
}
else if ( (!location->is_cd_marker() || !ruler_shown[ruler_time_cd_marker])
&& (lam->start->get_parent() == cd_marker_group))
{
//cerr << "reparenting non-cd marker so it can be relocated: " << location->name() << endl;
if (location->is_mark()) {
if (lam->start) {
lam->start->reparent (*marker_group);
}
if (lam->end) {
lam->end->reparent (*marker_group);
}
}
else {
if (lam->start) {
lam->start->reparent (*range_marker_group);
}
if (lam->end) {
lam->end->reparent (*range_marker_group);
}
}
}
}
Editor::LocationMarkers::~LocationMarkers ()
{
if (start) {
@ -319,12 +388,14 @@ Editor::LocationMarkers::set_color_rgba (uint32_t rgba)
}
void
Editor::mouse_add_new_marker (nframes_t where)
Editor::mouse_add_new_marker (nframes_t where, bool is_cd)
{
string markername;
int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
if (session) {
session->locations()->next_available_name(markername,"mark");
Location *location = new Location (where, where, markername, Location::IsMark);
Location *location = new Location (where, where, markername, (Location::Flags) flags);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
@ -353,6 +424,10 @@ Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
/*NOTREACHED*/
}
if (entered_marker == marker) {
entered_marker = NULL;
}
Location* loc = find_location_from_marker (marker, is_start);
if (session && loc) {
@ -535,19 +610,21 @@ Editor::build_range_marker_menu (bool loop_or_punch)
MenuList& items = markerMenu->items();
markerMenu->set_name ("ArdourContextMenu");
items.push_back (MenuElem (_("Play Range"), mem_fun(*this, &Editor::marker_menu_play_range)));
items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
if (! loop_or_punch) {
items.push_back (MenuElem (_("Play Range"), mem_fun(*this, &Editor::marker_menu_play_range)));
items.push_back (MenuElem (_("Loop Range"), mem_fun(*this, &Editor::marker_menu_loop_range)));
}
items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
}
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
if (! loop_or_punch) {
items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
items.push_back (MenuElem (_("Rename Range"), mem_fun(*this, &Editor::marker_menu_rename)));
items.push_back (MenuElem (_("Remove Range"), mem_fun(*this, &Editor::marker_menu_remove)));
}
@ -556,8 +633,9 @@ Editor::build_range_marker_menu (bool loop_or_punch)
items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
items.push_back (MenuElem (_("Select Range"), mem_fun(*this, &Editor::marker_menu_select_using_range)));
if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Select Range"), mem_fun(*this, &Editor::marker_menu_select_using_range)));
}
}
void
@ -736,13 +814,13 @@ Editor::marker_menu_set_from_playhead ()
if ((l = find_location_from_marker (marker, is_start)) != 0) {
if (l->is_mark()) {
l->set_start (session->transport_frame ());
l->set_start (session->audible_frame ());
}
else {
if (is_start) {
l->set_start (session->transport_frame ());
l->set_start (session->audible_frame ());
} else {
l->set_end (session->transport_frame ());
l->set_end (session->audible_frame ());
}
}
}
@ -1027,9 +1105,15 @@ Editor::update_punch_range_view (bool visibility)
double x1 = frame_to_pixel (tpl->start());
double x2 = frame_to_pixel (tpl->end());
guint track_canvas_width,track_canvas_height;
track_canvas.get_size(track_canvas_width,track_canvas_height);
transport_punch_range_rect->property_x1() = x1;
transport_punch_range_rect->property_x2() = x2;
transport_punch_range_rect->property_x1() = (Config->get_punch_in() ? x1 : 0);
transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? x2 : track_canvas_width);
if (visibility) {
transport_punch_range_rect->show();
}
@ -1108,3 +1192,33 @@ Editor::selected_marker_moved (Location* loc)
{
edit_point_clock.set (loc->start());
}
struct SortLocationsByPosition {
bool operator() (Location* a, Location* b) {
return a->start() < b->start();
}
};
void
Editor::goto_nth_marker (int n)
{
if (!session) {
return;
}
const Locations::LocationList& l (session->locations()->list());
Locations::LocationList ordered;
ordered = l;
SortLocationsByPosition cmp;
ordered.sort (cmp);
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_start()) {
if (n == 0) {
session->request_locate ((*i)->start(), session->transport_rolling());
break;
}
--n;
}
}
}

View file

@ -198,7 +198,7 @@ Editor::update_current_screen ()
/* only update if the playhead is on screen or we are following it */
if (_follow_playhead) {
if (_follow_playhead && session->requested_return_frame() < 0) {
playhead_cursor->canvas_item.show();
@ -316,7 +316,6 @@ Editor::session_going_away ()
clicked_crossfadeview = 0;
entered_regionview = 0;
entered_track = 0;
latest_regionview = 0;
last_update_frame = 0;
drag_info.item = 0;
last_canvas_frame = 0;

View file

@ -271,7 +271,11 @@ Editor::set_mouse_mode (MouseMode m, bool force)
case MouseObject:
mouse_move_button.set_active (true);
current_canvas_cursor = grabber_cursor;
if (Profile->get_sae()) {
current_canvas_cursor = timebar_cursor;
} else {
current_canvas_cursor = grabber_cursor;
}
break;
case MouseGain:
@ -445,8 +449,6 @@ Editor::set_midi_edit_cursor (MidiEditMode m)
void
Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{
bool commit = false;
/* in object/audition/timefx mode, any button press sets
the selection if the object can be selected. this is a
bit of hack, because we want to avoid this if the
@ -485,18 +487,18 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
switch (item_type) {
case RegionItem:
if (mouse_mode != MouseRange) {
commit = set_selected_regionview_from_click (press, op, true);
set_selected_regionview_from_click (press, op, true);
} else if (event->type == GDK_BUTTON_PRESS) {
commit = set_selected_track_from_click (press, op, false);
set_selected_track_as_side_effect ();
}
break;
case RegionViewNameHighlight:
case RegionViewName:
if (mouse_mode != MouseRange) {
commit = set_selected_regionview_from_click (press, op, true);
set_selected_regionview_from_click (press, op, true);
} else if (event->type == GDK_BUTTON_PRESS) {
commit = set_selected_track_from_click (press, op, false);
set_selected_track_as_side_effect ();
}
break;
@ -506,43 +508,35 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
case FadeOutHandleItem:
case FadeOutItem:
if (mouse_mode != MouseRange) {
commit = set_selected_regionview_from_click (press, op, true);
set_selected_regionview_from_click (press, op, true);
} else if (event->type == GDK_BUTTON_PRESS) {
commit = set_selected_track_from_click (press, op, false);
set_selected_track_as_side_effect ();
}
break;
case CrossfadeViewItem:
commit = set_selected_track_from_click (press, op, false);
break;
case ControlPointItem:
commit = set_selected_track_from_click (press, op, true);
set_selected_track_as_side_effect ();
if (mouse_mode != MouseRange) {
commit |= set_selected_control_point_from_click (op, false);
set_selected_control_point_from_click (op, false);
}
break;
case StreamItem:
/* for context click or range selection, select track */
if (event->button.button == 3) {
commit = set_selected_track_from_click (press, op, true);
set_selected_track_as_side_effect ();
} else if (event->type == GDK_BUTTON_PRESS && mouse_mode == MouseRange) {
commit = set_selected_track_from_click (press, op, false);
set_selected_track_as_side_effect ();
}
break;
case AutomationTrackItem:
commit = set_selected_track_from_click (press, op, true);
set_selected_track_as_side_effect (true);
break;
default:
break;
}
// if (commit) {
// commit_reversible_command ();
// }
}
bool
@ -586,7 +580,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
case MarkerItem:
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask(Keyboard::Control|Keyboard::Shift))) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
hide_marker (item, event);
} else {
start_marker_grab (item, event);
@ -594,7 +588,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
case TempoMarkerItem:
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) {
start_tempo_marker_copy_grab (item, event);
} else {
start_tempo_marker_grab (item, event);
@ -602,7 +596,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
case MeterMarkerItem:
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) {
start_meter_marker_copy_grab (item, event);
} else {
start_meter_marker_grab (item, event);
@ -620,6 +614,11 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
break;
case CdMarkerBarItem:
start_range_markerbar_op (item, event, CreateCDMarker);
return true;
break;
case TransportMarkerBarItem:
start_range_markerbar_op (item, event, CreateTransportMarker);
return true;
@ -643,10 +642,10 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
case SelectionItem:
if (Keyboard::modifier_state_contains
(event->button.state, Keyboard::ModifierMask(Keyboard::Alt))) {
(event->button.state, Keyboard::ModifierMask(Keyboard::SecondaryModifier))) {
// contains and not equals because I can't use alt as a modifier alone.
start_selection_grab (item, event);
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Control)) {
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
/* grab selection for moving */
start_selection_op (item, event, SelectionMove);
} else {
@ -663,7 +662,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
break;
case MouseObject:
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::ModifierMask(Keyboard::Control|Keyboard::Alt)) &&
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) &&
event->type == GDK_BUTTON_PRESS) {
start_rubberband_select (item, event);
@ -680,7 +679,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
case RegionItem:
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) {
start_region_copy_grab (item, event);
} else if (Keyboard::the_keyboard().key_is_down (GDK_b)) {
start_region_brush_grab (item, event);
@ -832,12 +831,12 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
if (event->type == GDK_BUTTON_PRESS) {
switch (item_type) {
case RegionItem:
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) {
start_region_copy_grab (item, event);
} else {
start_region_grab (item, event);
}
return true;
break;
case ControlPointItem:
start_control_point_grab (item, event);
@ -876,7 +875,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
case MouseZoom:
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
temporal_zoom_session();
} else {
temporal_zoom_to_frame (true, event_frame(event));
@ -990,7 +989,8 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case MarkerBarItem:
case RangeMarkerBarItem:
case TransportMarkerBarItem:
case TransportMarkerBarItem:
case CdMarkerBarItem:
case TempoBarItem:
case MeterBarItem:
popup_ruler_menu (pixel_to_frame(event->button.x), item_type);
@ -1088,6 +1088,14 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
mouse_add_new_marker (where);
return true;
case CdMarkerBarItem:
// if we get here then a dragged range wasn't done
if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
snap_to (where, 0, true);
}
mouse_add_new_marker (where, true);
return true;
case TempoBarItem:
if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
snap_to (where);
@ -1151,7 +1159,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
/* no drag, just a click */
switch (item_type) {
case RegionItem:
audition_selected_region ();
play_selected_region ();
break;
default:
break;
@ -1174,6 +1182,25 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case 2:
switch (mouse_mode) {
case MouseObject:
switch (item_type) {
case RegionItem:
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
raise_region ();
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::TertiaryModifier|Keyboard::SecondaryModifier))) {
lower_region ();
} else {
// Button2 click is unused
}
return true;
break;
default:
break;
}
break;
case MouseRange:
// x_style_paste (where, 1.0);
@ -1220,12 +1247,12 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
set_verbose_canvas_cursor (cp->line().get_verbose_cursor_string (fraction), at_x, at_y);
show_verbose_canvas_cursor ();
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
if (is_drawable() && !_scrubbing) {
track_canvas.get_window()->set_cursor (*fader_cursor);
}
}
break;
case GainLineItem:
if (mouse_mode == MouseGain) {
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
@ -1317,6 +1344,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case MarkerBarItem:
case RangeMarkerBarItem:
case TransportMarkerBarItem:
case CdMarkerBarItem:
case MeterBarItem:
case TempoBarItem:
if (is_drawable()) {
@ -1442,6 +1470,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case RangeMarkerBarItem:
case TransportMarkerBarItem:
case CdMarkerBarItem:
case MeterBarItem:
case TempoBarItem:
case MarkerBarItem:
@ -1508,19 +1537,21 @@ Editor::left_automation_track ()
bool
Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type, bool from_autoscroll)
{
gint x, y;
if (event->motion.is_hint) {
gint x, y;
/* We call this so that MOTION_NOTIFY events continue to be
delivered to the canvas. We need to do this because we set
Gdk::POINTER_MOTION_HINT_MASK on the canvas. This reduces
the density of the events, at the expense of a round-trip
to the server. Given that this will mostly occur on cases
where DISPLAY = :0.0, and given the cost of what the motion
event might do, its a good tradeoff.
*/
track_canvas.get_pointer (x, y);
}
/* We call this so that MOTION_NOTIFY events continue to be
delivered to the canvas. We need to do this because we set
Gdk::POINTER_MOTION_HINT_MASK on the canvas. This reduces
the density of the events, at the expense of a round-trip
to the server. Given that this will mostly occur on cases
where DISPLAY = :0.0, and given the cost of what the motion
event might do, its a good tradeoff.
*/
track_canvas.get_pointer (x, y);
if (current_stepping_trackview) {
/* don't keep the persistent stepped trackview if the mouse moves */
current_stepping_trackview = 0;
@ -1727,7 +1758,7 @@ Editor::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
// if dragging with button2, the motion is x constrained, with Alt-button2 it is y constrained
if (event->button.button == 2) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Alt)) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) {
drag_info.y_constrained = true;
drag_info.x_constrained = false;
} else {
@ -2102,7 +2133,7 @@ Editor::cursor_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
}
if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
if (cursor == playhead_cursor && snap_type != SnapToEditPoint) {
if (cursor == playhead_cursor) {
snap_to (adjusted_frame);
}
}
@ -2255,7 +2286,7 @@ Editor::marker_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
f_delta = copy_location->end() - copy_location->start();
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
move_both = true;
}
@ -2681,7 +2712,7 @@ Editor::control_point_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent*
double dx = drag_info.current_pointer_x - drag_info.last_pointer_x;
double dy = drag_info.current_pointer_y - drag_info.last_pointer_y;
if (event->button.state & Keyboard::Alt) {
if (event->button.state & Keyboard::SecondaryModifier) {
dx *= 0.1;
dy *= 0.1;
}
@ -2728,7 +2759,7 @@ Editor::control_point_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent*
bool push;
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::PrimaryModifier)) {
push = true;
} else {
push = false;
@ -2750,7 +2781,7 @@ Editor::control_point_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent
/* just a click */
if ((event->type == GDK_BUTTON_RELEASE) && (event->button.button == 1) && Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift)) {
if ((event->type == GDK_BUTTON_RELEASE) && (event->button.button == 1) && Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
reset_point_selection ();
}
@ -2831,7 +2862,7 @@ Editor::line_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
double dy = drag_info.current_pointer_y - drag_info.last_pointer_y;
if (event->button.state & Keyboard::Alt) {
if (event->button.state & Keyboard::SecondaryModifier) {
dy *= 0.1;
}
@ -2861,7 +2892,7 @@ Editor::line_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
bool push;
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::PrimaryModifier)) {
push = false;
} else {
push = true;
@ -2890,8 +2921,14 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event)
drag_info.copy = false;
drag_info.item = item;
drag_info.data = clicked_regionview;
drag_info.motion_callback = &Editor::region_drag_motion_callback;
drag_info.finished_callback = &Editor::region_drag_finished_callback;
if (Config->get_edit_mode() == Splice) {
drag_info.motion_callback = &Editor::region_drag_splice_motion_callback;
drag_info.finished_callback = &Editor::region_drag_splice_finished_callback;
} else {
drag_info.motion_callback = &Editor::region_drag_motion_callback;
drag_info.finished_callback = &Editor::region_drag_finished_callback;
}
start_grab (event);
@ -2961,7 +2998,7 @@ Editor::start_region_copy_grab (ArdourCanvas::Item* item, GdkEvent* event)
void
Editor::start_region_brush_grab (ArdourCanvas::Item* item, GdkEvent* event)
{
if (selection->regions.empty() || clicked_regionview == 0) {
if (selection->regions.empty() || clicked_regionview == 0 || Config->get_edit_mode() == Splice) {
return;
}
@ -2992,18 +3029,8 @@ Editor::start_region_brush_grab (ArdourCanvas::Item* item, GdkEvent* event)
}
void
Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
Editor::possibly_copy_regions_during_grab (GdkEvent* event)
{
double x_delta;
double y_delta = 0;
RegionView* rv = reinterpret_cast<RegionView*> (drag_info.data);
nframes_t pending_region_position = 0;
int32_t pointer_y_span = 0, canvas_pointer_y_span = 0, original_pointer_order;
int32_t visible_y_high = 0, visible_y_low = 512; //high meaning higher numbered.. not the height on the screen
bool clamp_y_axis = false;
vector<int32_t> height_list(512) ;
vector<int32_t>::iterator j;
if (drag_info.copy && drag_info.move_threshold_passed && drag_info.want_move_threshold) {
drag_info.want_move_threshold = false; // don't copy again
@ -3049,24 +3076,123 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
swap_grab (new_regionviews.front()->get_canvas_group (), 0, event->motion.time);
}
}
bool
Editor::check_region_drag_possible (RouteTimeAxisView** tv)
{
/* Which trackview is this ? */
TimeAxisView* tvp = trackview_by_y_position (drag_info.current_pointer_y);
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
(*tv) = dynamic_cast<RouteTimeAxisView*>(tvp);
/* The region motion is only processed if the pointer is over
an audio track.
*/
if (!tv || !tv->is_track()) {
if (!(*tv) || !(*tv)->is_track()) {
/* To make sure we hide the verbose canvas cursor when the mouse is
not held over a track.
not held over and audiotrack.
*/
hide_verbose_canvas_cursor ();
return;
return false;
}
return true;
}
struct RegionSelectionByPosition {
bool operator() (RegionView*a, RegionView* b) {
return a->region()->position () < b->region()->position();
}
};
void
Editor::region_drag_splice_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
RouteTimeAxisView* tv;
if (!check_region_drag_possible (&tv)) {
return;
}
if (!drag_info.move_threshold_passed) {
return;
}
int dir;
if (drag_info.current_pointer_x - drag_info.grab_x > 0) {
dir = 1;
} else {
dir = -1;
}
RegionSelection copy (selection->regions);
RegionSelectionByPosition cmp;
copy.sort (cmp);
for (RegionSelection::iterator i = copy.begin(); i != copy.end(); ++i) {
RouteTimeAxisView* atv = dynamic_cast<RouteTimeAxisView*> (&(*i)->get_time_axis_view());
if (!atv) {
continue;
}
boost::shared_ptr<Playlist> playlist;
if ((playlist = atv->playlist()) == 0) {
continue;
}
if (!playlist->region_is_shuffle_constrained ((*i)->region())) {
continue;
}
if (dir > 0) {
if (drag_info.current_pointer_frame < (*i)->region()->last_frame() + 1) {
continue;
}
} else {
if (drag_info.current_pointer_frame > (*i)->region()->first_frame()) {
continue;
}
}
playlist->shuffle ((*i)->region(), dir);
drag_info.grab_x = drag_info.current_pointer_x;
}
}
void
Editor::region_drag_splice_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
}
void
Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
double x_delta;
double y_delta = 0;
RegionView* rv = reinterpret_cast<RegionView*> (drag_info.data);
nframes_t pending_region_position = 0;
int32_t pointer_y_span = 0, canvas_pointer_y_span = 0, original_pointer_order;
int32_t visible_y_high = 0, visible_y_low = 512; //high meaning higher numbered.. not the height on the screen
bool clamp_y_axis = false;
vector<int32_t> height_list(512) ;
vector<int32_t>::iterator j;
RouteTimeAxisView* tv;
possibly_copy_regions_during_grab (event);
if (!check_region_drag_possible (&tv)) {
return;
}
original_pointer_order = drag_info.last_trackview->order;
/************************************************************
@ -3078,7 +3204,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
pointer_y_span = 0;
goto y_axis_done;
}
if ((pointer_y_span = (drag_info.last_trackview->order - tv->order)) != 0) {
int32_t children = 0, numtracks = 0;
@ -3253,7 +3379,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
}
if (sync_frame - sync_offset <= sync_frame) {
pending_region_position = sync_frame - (sync_dir*sync_offset);
pending_region_position = sync_frame + (sync_dir*sync_offset);
} else {
pending_region_position = 0;
}
@ -3270,7 +3396,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
if (pending_region_position != drag_info.last_frame_position && !drag_info.x_constrained) {
/* now compute the canvas unit distance we need to move the regiondrag_info.last_trackview->order
/* now compute the canvas unit distance we need to move the regionview
to make it appear at the new location.
*/
@ -3449,7 +3575,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
rv->fake_set_opaque (true);
}
if (drag_info.brushing) {
mouse_brush_insert_region (rv, pending_region_position);
} else {
@ -3503,6 +3629,11 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
region_drag_motion_callback (item, event);
if (Config->get_edit_mode() == Splice && !pre_drag_region_selection.empty()) {
selection->set (pre_drag_region_selection);
pre_drag_region_selection.clear ();
}
if (drag_info.brushing) {
/* all changes were made during motion event handlers */
@ -3551,6 +3682,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
/* moved to a different audio track. */
vector<RegionView*> new_selection;
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) {
RegionView* rv = (*i);
@ -3624,9 +3757,17 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
copies.push_back (rv);
}
latest_regionview = 0;
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));
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());
}
/* 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
@ -3723,12 +3864,16 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
/* add it */
to_playlist->add_region (newregion, (nframes_t) (where * from_rtv->get_diskstream()->speed()));
/* if the original region was locked, we don't care for the new one */
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 ();
newregion->set_locked (false);
copies.push_back (rv);
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 {
@ -3833,7 +3978,7 @@ Editor::region_view_item_click (AudioRegionView& rv, GdkEventButton* event)
this is an alignment click (control used)
*/
if (Keyboard::modifier_state_contains (event->state, Keyboard::Control)) {
if (Keyboard::modifier_state_contains (event->state, Keyboard::PrimaryModifier)) {
TimeAxisView* tv = &rv.get_time_axis_view();
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
double speed = 1.0;
@ -3845,11 +3990,11 @@ Editor::region_view_item_click (AudioRegionView& rv, GdkEventButton* event)
if (where >= 0) {
if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Alt))) {
if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
align_region (rv.region(), SyncPoint, (nframes_t) (where * speed));
} else if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Shift))) {
} else if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
align_region (rv.region(), End, (nframes_t) (where * speed));
@ -3988,14 +4133,14 @@ Editor::show_verbose_duration_cursor (nframes_t start, nframes_t end, double off
void
Editor::collect_new_region_view (RegionView* rv)
{
latest_regionview = rv;
latest_regionviews.push_back (rv);
}
void
Editor::collect_and_select_new_region_view (RegionView* rv)
{
selection->add(rv);
latest_regionview = rv;
latest_regionviews.push_back (rv);
}
void
@ -4025,7 +4170,7 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event)
set the regionview we want to then drag.
*/
latest_regionview = 0;
latest_regionviews.clear();
sigc::connection c = clicked_routeview->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
/* A selection grab currently creates two undo/redo operations, one for
@ -4045,24 +4190,25 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event)
c.disconnect ();
if (latest_regionview == 0) {
if (latest_regionviews.empty()) {
/* something went wrong */
return;
}
/* we need to deselect all other regionviews, and select this one
i'm ignoring undo stuff, because the region creation will take care of it */
//selection->set (latest_regionview);
i'm ignoring undo stuff, because the region creation will take care of it
*/
selection->set (latest_regionviews);
drag_info.item = latest_regionview->get_canvas_group();
drag_info.data = latest_regionview;
drag_info.item = latest_regionviews.front()->get_canvas_group();
drag_info.data = latest_regionviews.front();
drag_info.motion_callback = &Editor::region_drag_motion_callback;
drag_info.finished_callback = &Editor::region_drag_finished_callback;
start_grab (event);
drag_info.last_trackview = clicked_axisview;
drag_info.last_frame_position = latest_regionview->region()->position();
drag_info.last_frame_position = latest_regionviews.front()->region()->position();
drag_info.pointer_frame_offset = drag_info.grab_frame - drag_info.last_frame_position;
show_verbose_time_cursor (drag_info.last_frame_position, 10);
@ -4074,10 +4220,8 @@ Editor::cancel_selection ()
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->hide_selection ();
}
begin_reversible_command (_("cancel selection"));
selection->clear ();
clicked_selection = 0;
commit_reversible_command ();
}
void
@ -4098,7 +4242,7 @@ Editor::start_selection_op (ArdourCanvas::Item* item, GdkEvent* event, Selection
switch (op) {
case CreateSelection:
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift)) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
drag_info.copy = true;
} else {
drag_info.copy = false;
@ -4313,7 +4457,7 @@ Editor::start_trim (ArdourCanvas::Item* item, GdkEvent* event)
start_grab (event, trimmer_cursor);
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
trim_op = ContentsTrim;
} else {
/* These will get overridden for a point trim.*/
@ -4441,7 +4585,7 @@ Editor::trim_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
bool swap_direction = false;
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
swap_direction = true;
}
@ -4582,7 +4726,7 @@ Editor::trim_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
if (!drag_info.first_move) {
trim_motion_callback (item, event);
if (!clicked_regionview->get_selected()) {
if (!selection->selected (clicked_regionview)) {
thaw_region_after_trim (*clicked_regionview);
} else {
@ -4624,7 +4768,7 @@ Editor::point_trim (GdkEvent* event)
trim_op = StartTrim;
begin_reversible_command (_("Start point trim"));
if (rv->get_selected()) {
if (selection->selected (rv)) {
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin();
i != selection->regions.by_layer().end(); ++i)
@ -4656,7 +4800,7 @@ Editor::point_trim (GdkEvent* event)
trim_op = EndTrim;
begin_reversible_command (_("End point trim"));
if (rv->get_selected()) {
if (selection->selected (rv)) {
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i)
{
@ -4742,8 +4886,9 @@ Editor::start_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event, Ran
switch (op) {
case CreateRangeMarker:
case CreateTransportMarker:
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift)) {
case CreateCDMarker:
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
drag_info.copy = true;
} else {
drag_info.copy = false;
@ -4776,6 +4921,7 @@ Editor::drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
switch (range_marker_op) {
case CreateRangeMarker:
case CreateTransportMarker:
case CreateCDMarker:
if (drag_info.first_move) {
snap_to (drag_info.grab_frame);
}
@ -4833,17 +4979,25 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
{
Location * newloc = 0;
string rangename;
int flags;
if (!drag_info.first_move) {
drag_range_markerbar_op (item, event);
switch (range_marker_op) {
case CreateRangeMarker:
case CreateCDMarker:
{
begin_reversible_command (_("new range marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->next_available_name(rangename,"unnamed");
newloc = new Location(temp_location->start(), temp_location->end(), rangename, Location::IsRangeMarker);
if (range_marker_op == CreateCDMarker) {
flags = Location::IsRangeMarker|Location::IsCDMarker;
}
else {
flags = Location::IsRangeMarker;
}
newloc = new Location(temp_location->start(), temp_location->end(), rangename, (Location::Flags) flags);
session->locations()->add (newloc, true);
XMLNode &after = session->locations()->get_state();
session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
@ -4863,7 +5017,7 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
} else {
/* just a click, no pointer movement. remember that context menu stuff was handled elsewhere */
if (Keyboard::no_modifier_keys_pressed (&event->button)) {
if (Keyboard::no_modifier_keys_pressed (&event->button) && range_marker_op != CreateCDMarker) {
nframes_t start;
nframes_t end;
@ -5179,11 +5333,20 @@ Editor::end_time_fx (ArdourCanvas::Item* item, GdkEvent* event)
}
nframes_t newlen = drag_info.last_pointer_frame - clicked_regionview->region()->position();
#ifdef USE_RUBBERBAND
float percentage = (float) ((double) newlen / (double) clicked_regionview->region()->length());
#else
float percentage = (float) ((double) newlen - (double) clicked_regionview->region()->length()) / ((double) newlen) * 100.0f;
#endif
begin_reversible_command (_("timestretch"));
if (run_timestretch (selection->regions, percentage) == 0) {
// XXX how do timeFX on multiple regions ?
RegionSelection rs;
rs.add (clicked_regionview);
if (time_stretch (rs, percentage) == 0) {
session->commit_reversible_command ();
}
}
@ -5205,9 +5368,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, nframes_t pos)
}
switch (snap_type) {
case SnapToFrame:
case SnapToMark:
case SnapToEditPoint:
return;
default:

File diff suppressed because it is too large Load diff

View file

@ -38,6 +38,7 @@
#include "ardour_ui.h"
#include "gui_thread.h"
#include "actions.h"
#include "region_view.h"
#include "utils.h"
#include "i18n.h"
@ -89,10 +90,6 @@ Editor::add_region_to_region_display (boost::shared_ptr<Region> region)
Gdk::Color c;
bool missing_source;
region_state_changed_connections.push_back (
region->StateChanged.connect (bind (mem_fun (*this, &Editor::region_list_region_changed), boost::weak_ptr<Region> (region)))
);
missing_source = boost::dynamic_pointer_cast<SilentFileSource>(region->source());
if (!show_automatic_regions_in_region_list && region->automatic()) {
@ -309,13 +306,6 @@ Editor::redisplay_regions ()
{
if (session) {
for (std::list<connection>::iterator i = region_state_changed_connections.begin();
i != region_state_changed_connections.end();
++i)
{
i->disconnect ();
}
region_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
region_list_model->clear ();
@ -419,6 +409,8 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
int cellx;
int celly;
cerr << "Button press release, button = " << ev->button << endl;
if (region_list_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
if ((iter = region_list_model->get_iter (path))) {
region = (*iter)[region_list_columns.region];
@ -427,27 +419,25 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
if (Keyboard::is_context_menu_event (ev)) {
show_region_list_display_context_menu (ev->button, ev->time);
cerr << "\tcontext menu event, event handled\n";
return true;
}
if (region == 0) {
cerr << "\tno region, event not handled\n";
return false;
}
switch (ev->button) {
case 1:
/* audition on double click */
if (ev->type == GDK_2BUTTON_PRESS) {
consider_auditioning (region);
return true;
}
return false;
break;
case 2:
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
// audition on middle click (stop audition too)
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
consider_auditioning (region);
}
cerr << "\taudition, event handled\n";
return true;
break;
@ -455,6 +445,7 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
break;
}
cerr << "\tnot handled\n";
return false;
}
@ -674,6 +665,12 @@ Editor::region_list_display_drag_data_received (const RefPtr<Gdk::DragContext>&
{
vector<ustring> paths;
if (data.get_target() == "GTK_TREE_MODEL_ROW") {
cerr << "Delete drag data drop to treeview\n";
region_list_display.on_drag_data_received (context, x, y, data, info, time);
return;
}
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
nframes64_t pos = 0;
do_embed (paths, Editing::ImportDistinctFiles, ImportAsRegion, pos);
@ -697,3 +694,30 @@ Editor::region_list_selection_filter (const RefPtr<TreeModel>& model, const Tree
return true;
}
void
Editor::region_name_edit (const Glib::ustring& path, const Glib::ustring& new_text)
{
boost::shared_ptr<Region> region;
TreeIter iter;
if ((iter = region_list_model->get_iter (path))) {
region = (*iter)[region_list_columns.region];
(*iter)[region_list_columns.name] = new_text;
}
/* now mapover everything */
if (region) {
vector<RegionView*> equivalents;
get_regions_corresponding_to (region, equivalents);
for (vector<RegionView*>::iterator i = equivalents.begin(); i != equivalents.end(); ++i) {
if (new_text != (*i)->region()->name()) {
(*i)->region()->set_name (new_text);
}
}
}
}

View file

@ -41,6 +41,7 @@ using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Glib;
void
@ -70,7 +71,7 @@ Editor::handle_new_route (Session::RouteList& routes)
tv = new MidiTimeAxisView (*this, *session, route, track_canvas);
else
throw unknown_type();
//cerr << "Editor::handle_new_route() called on " << route->name() << endl;//DEBUG
#if 0
if (route_display_model->children().size() == 0) {
@ -155,42 +156,10 @@ Editor::remove_route (TimeAxisView *tv)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::remove_route), tv));
TrackViewList::iterator i;
TreeModel::Children rows = route_display_model->children();
TreeModel::Children::iterator ri;
/* find the track view that's being deleted */
TrackViewList::iterator i = find (track_views.begin(), track_views.end(), tv);
/* set up `nearby' to be a suitable nearby track to select once
this one has gone */
TrackViewList::iterator nearby = track_views.end ();
if (i != track_views.end()) {
nearby = i;
if (nearby != track_views.begin()) {
/* go to the previous track if there is one */
nearby--;
} else {
/* otherwise the next track */
nearby++;
}
/* and remove the track view that's going */
track_views.erase (i);
if (nearby != track_views.end()) {
/* we've got another track to select, so select it */
set_selected_track (**nearby, Selection::Set);
} else {
/* we've got no other track, so the editor mixer will disappear */
editor_mixer_button.set_active (false);
ActionManager::uncheck_toggleaction ("<Actions>/Editor/show-editor-mixer");
editor_mixer_button.set_sensitive (false);
editor_list_button.set_sensitive (false);
}
}
/* Decrement old order keys for tracks `above' the one that is being removed */
for (ri = rows.begin(); ri != rows.end(); ++ri) {
TimeAxisView* v = (*ri)[route_display_columns.tv];
@ -205,6 +174,23 @@ Editor::remove_route (TimeAxisView *tv)
break;
}
}
if ((i = find (track_views.begin(), track_views.end(), tv)) != track_views.end()) {
track_views.erase (i);
}
/* since the editor mixer goes away when you remove a route, set the
* button to inactive and untick the menu option
*/
editor_mixer_button.set_active(false);
ActionManager::uncheck_toggleaction ("<Actions>/Editor/show-editor-mixer");
/* and disable if all tracks and/or routes are gone */
if (track_views.size() == 0) {
editor_mixer_button.set_sensitive(false);
}
}
void
@ -609,3 +595,21 @@ Editor::route_list_delete (const Gtk::TreeModel::Path& path)
session->set_remote_control_ids();
redisplay_route_list ();
}
void
Editor::route_list_display_drag_data_received (const RefPtr<Gdk::DragContext>& context,
int x, int y,
const SelectionData& data,
guint info, guint time)
{
cerr << "RouteLD::dddr target = " << data.get_target() << endl;
if (data.get_target() == "GTK_TREE_MODEL_ROW") {
cerr << "Delete drag data drop to treeview\n";
route_list_display.on_drag_data_received (context, x, y, data, info, time);
return;
}
cerr << "some other kind of drag\n";
context->drag_finish (true, false, time);
}

View file

@ -23,6 +23,7 @@
#include <string>
#include <ardour/tempo.h>
#include <ardour/profile.h>
#include <gtkmm2ext/gtk_ui.h>
#include "editor.h"
@ -91,33 +92,64 @@ Editor::initialize_rulers ()
ruler_shown[ruler_time_marker] = true;
ruler_shown[ruler_time_range_marker] = true;
ruler_shown[ruler_time_transport_marker] = true;
if (Profile->get_sae()) {
ruler_shown[ruler_time_cd_marker] = false;
} else {
ruler_shown[ruler_time_cd_marker] = true;
}
ruler_shown[ruler_metric_frames] = false;
ruler_shown[ruler_metric_minsec] = false;
smpte_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
bbt_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
frames_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
minsec_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
smpte_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
bbt_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
frames_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
minsec_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
smpte_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
bbt_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
frames_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
minsec_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
smpte_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
bbt_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
frames_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
minsec_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
visible_timebars = 7; /* 4 here, 3 in time_canvas */
ruler_pressed_button = 0;
}
bool
Editor::ruler_scroll (GdkEventScroll* event)
{
nframes_t xdelta;
int direction = event->direction;
bool handled = false;
switch (direction) {
case GDK_SCROLL_UP:
temporal_zoom_step (true);
handled = true;
break;
case GDK_SCROLL_DOWN:
temporal_zoom_step (false);
handled = true;
break;
case GDK_SCROLL_LEFT:
xdelta = (current_page_frames() / 2);
if (leftmost_frame > xdelta) {
reset_x_origin (leftmost_frame - xdelta);
} else {
reset_x_origin (0);
}
handled = true;
break;
case GDK_SCROLL_RIGHT:
xdelta = (current_page_frames() / 2);
if (max_frames - xdelta > leftmost_frame) {
reset_x_origin (leftmost_frame + xdelta);
} else {
reset_x_origin (max_frames - current_page_frames());
}
handled = true;
break;
default:
/* what? */
break;
}
return handled;
}
gint
Editor::ruler_button_press (GdkEventButton* ev)
@ -165,9 +197,7 @@ Editor::ruler_button_press (GdkEventButton* ev)
case 2:
/* edit point */
if (snap_type != Editing::SnapToEditPoint) {
snap_to (where);
}
snap_to (where);
break;
default:
@ -206,9 +236,7 @@ Editor::ruler_button_release (GdkEventButton* ev)
case 2:
/* edit point */
if (snap_type != Editing::SnapToEditPoint) {
snap_to (where);
}
snap_to (where);
break;
case 3:
@ -338,7 +366,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
switch (t) {
case MarkerBarItem:
ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where)));
ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, false)));
ruler_items.push_back (MenuElem (_("Clear all locations"), mem_fun(*this, &Editor::clear_markers)));
ruler_items.push_back (MenuElem (_("Unhide locations"), mem_fun(*this, &Editor::unhide_markers)));
ruler_items.push_back (SeparatorElem ());
@ -353,7 +381,13 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
case TransportMarkerBarItem:
break;
case CdMarkerBarItem:
// TODO
ruler_items.push_back (MenuElem (_("New CD track marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, true)));
break;
case TempoBarItem:
ruler_items.push_back (MenuElem (_("New Tempo"), bind ( mem_fun(*this, &Editor::mouse_add_new_tempo_event), where)));
ruler_items.push_back (MenuElem (_("Clear tempo")));
@ -382,7 +416,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
mitem->set_active(true);
}
ruler_items.push_back (CheckMenuElem (_("Frames"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_frames)));
ruler_items.push_back (CheckMenuElem (_("Samples"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_frames)));
mitem = (CheckMenuItem *) &ruler_items.back();
if (ruler_shown[ruler_metric_frames]) {
mitem->set_active(true);
@ -414,9 +448,17 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
mitem->set_active(true);
}
ruler_items.push_back (CheckMenuElem (_("Range Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_range_marker)));
if (!Profile->get_sae()) {
ruler_items.push_back (CheckMenuElem (_("Range Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_range_marker)));
mitem = (CheckMenuItem *) &ruler_items.back();
if (ruler_shown[ruler_time_range_marker]) {
mitem->set_active(true);
}
}
ruler_items.push_back (CheckMenuElem (_("CD Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_cd_marker)));
mitem = (CheckMenuItem *) &ruler_items.back();
if (ruler_shown[ruler_time_range_marker]) {
if (ruler_shown[ruler_time_cd_marker]) {
mitem->set_active(true);
}
@ -468,6 +510,7 @@ Editor::store_ruler_visibility ()
node->add_property (X_("marker"), ruler_shown[ruler_time_marker] ? "yes": "no");
node->add_property (X_("rangemarker"), ruler_shown[ruler_time_range_marker] ? "yes": "no");
node->add_property (X_("transportmarker"), ruler_shown[ruler_time_transport_marker] ? "yes": "no");
node->add_property (X_("cdmarker"), ruler_shown[ruler_time_cd_marker] ? "yes": "no");
session->add_extra_xml (*node);
session->set_dirty ();
@ -528,6 +571,7 @@ Editor::restore_ruler_visibility ()
else
ruler_shown[ruler_time_range_marker] = false;
}
if ((prop = node->property ("transportmarker")) != 0) {
if (prop->value() == "yes")
ruler_shown[ruler_time_transport_marker] = true;
@ -535,6 +579,29 @@ Editor::restore_ruler_visibility ()
ruler_shown[ruler_time_transport_marker] = false;
}
if ((prop = node->property ("cdmarker")) != 0) {
if (prop->value() == "yes")
ruler_shown[ruler_time_cd_marker] = true;
else
ruler_shown[ruler_time_cd_marker] = false;
cerr << "cd marker ruler set to " << ruler_shown[ruler_time_cd_marker] << endl;
} else {
// this session doesn't yet know about the cdmarker ruler
// as a benefit to the user who doesn't know the feature exists, show the ruler if
// any cd marks exist
ruler_shown[ruler_time_cd_marker] = false;
const Locations::LocationList & locs = session->locations()->list();
for (Locations::LocationList::const_iterator i = locs.begin(); i != locs.end(); ++i) {
if ((*i)->is_cd_marker()) {
ruler_shown[ruler_time_cd_marker] = true;
break;
}
}
cerr << "cd marker ruler default to " << ruler_shown[ruler_time_cd_marker] << endl;
}
}
update_ruler_visibility ();
@ -583,11 +650,10 @@ Editor::update_ruler_visibility ()
minsec_ruler->set_size_request (-1, (int)timebar_height);
gtk_custom_ruler_set_metric (GTK_CUSTOM_RULER(_minsec_ruler), &ruler_metrics[ruler_metric_minsec]);
smpte_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
bbt_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
frames_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
minsec_ruler->set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
smpte_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
bbt_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
frames_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
minsec_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
smpte_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
bbt_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
@ -606,6 +672,13 @@ Editor::update_ruler_visibility ()
ruler_children.insert (canvaspos, Element(*_ruler_separator, PACK_SHRINK, PACK_START));
smpte_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
bbt_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
frames_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
minsec_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
ruler_children.insert (canvaspos, Element(*_ruler_separator, PACK_SHRINK, PACK_START));
if (ruler_shown[ruler_metric_minsec]) {
lab_children.push_back (Element(minsec_label, PACK_SHRINK, PACK_START));
ruler_children.insert (canvaspos, Element(*minsec_ruler, PACK_SHRINK, PACK_START));
@ -662,7 +735,7 @@ Editor::update_ruler_visibility ()
tempo_group->hide();
}
if (ruler_shown[ruler_time_range_marker]) {
if (!Profile->get_sae() && ruler_shown[ruler_time_range_marker]) {
lab_children.push_back (Element(range_mark_label, PACK_SHRINK, PACK_START));
old_unit_pos = range_marker_group->property_y();
if (tbpos != old_unit_pos) {
@ -671,8 +744,7 @@ Editor::update_ruler_visibility ()
range_marker_group->show();
tbpos += timebar_height;
visible_timebars++;
}
else {
} else {
range_marker_group->hide();
}
@ -689,6 +761,24 @@ Editor::update_ruler_visibility ()
else {
transport_marker_group->hide();
}
if (ruler_shown[ruler_time_cd_marker]) {
lab_children.push_back (Element(cd_mark_label, PACK_SHRINK, PACK_START));
old_unit_pos = cd_marker_group->property_y();
if (tbpos != old_unit_pos) {
cd_marker_group->move (0.0, tbpos - old_unit_pos);
}
cd_marker_group->show();
tbpos += timebar_height;
visible_timebars++;
// make sure all cd markers show up in their respective places
update_cd_marker_display();
}
else {
cd_marker_group->hide();
// make sure all cd markers show up in their respective places
update_cd_marker_display();
}
if (ruler_shown[ruler_time_marker]) {
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));

View file

@ -17,6 +17,9 @@
*/
#include <algorithm>
#include <stdlib.h>
#include <pbd/stacktrace.h>
#include <ardour/diskstream.h>
@ -160,36 +163,47 @@ Editor::select_all_tracks ()
selection->set (track_views);
}
bool
void
Editor::set_selected_track_as_side_effect (bool force)
{
if (!clicked_routeview) {
return;
}
if (!selection->tracks.empty()) {
if (!selection->selected (clicked_routeview)) {
selection->add (clicked_routeview);
}
} else if (force) {
selection->set (clicked_routeview);
}
}
void
Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no_remove)
{
bool commit = false;
switch (op) {
case Selection::Toggle:
if (selection->selected (&view)) {
if (!no_remove) {
selection->remove (&view);
commit = true;
}
} else {
selection->add (&view);
commit = false;
}
break;
case Selection::Add:
if (!selection->selected (&view)) {
selection->add (&view);
commit = true;
}
break;
case Selection::Set:
if (selection->selected (&view) && selection->tracks.size() == 1) {
/* no commit necessary */
} else {
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
@ -199,34 +213,30 @@ Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no
if (selection->tracks.empty()) {
selection->set (&view);
commit = true;
} else if (selection->tracks.size() == 1 || !no_remove) {
selection->set (&view);
commit = true;
}
}
break;
case Selection::Extend:
commit = extend_selection_to_track (view);
extend_selection_to_track (view);
break;
}
return commit;
}
bool
void
Editor::set_selected_track_from_click (bool press, Selection::Operation op, bool no_remove)
{
if (!clicked_routeview) {
return false;
return;
}
if (!press) {
return false;
return;
}
return set_selected_track (*clicked_routeview, op, no_remove);
set_selected_track (*clicked_routeview, op, no_remove);
}
bool
@ -386,7 +396,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
switch (op) {
case Selection::Toggle:
if (clicked_regionview->get_selected()) {
if (selection->selected (clicked_regionview)) {
if (press) {
/* whatever was clicked was selected already; do nothing here but allow
@ -436,7 +446,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
break;
case Selection::Set:
if (!clicked_regionview->get_selected()) {
if (!selection->selected (clicked_regionview)) {
selection->set (clicked_regionview);
commit = true;
} else {
@ -455,6 +465,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
list<Selectable*> results;
nframes_t last_frame;
nframes_t first_frame;
bool same_track = false;
/* 1. find the last selected regionview in the track that was clicked in */
@ -471,63 +482,183 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
if ((*x)->region()->first_frame() < first_frame) {
first_frame = (*x)->region()->first_frame();
}
same_track = true;
}
}
/* 2. figure out the boundaries for our search for new objects */
if (same_track) {
switch (clicked_regionview->region()->coverage (first_frame, last_frame)) {
case OverlapNone:
if (last_frame < clicked_regionview->region()->first_frame()) {
first_frame = last_frame;
last_frame = clicked_regionview->region()->last_frame();
} else {
last_frame = first_frame;
first_frame = clicked_regionview->region()->first_frame();
/* 2. figure out the boundaries for our search for new objects */
switch (clicked_regionview->region()->coverage (first_frame, last_frame)) {
case OverlapNone:
if (last_frame < clicked_regionview->region()->first_frame()) {
first_frame = last_frame;
last_frame = clicked_regionview->region()->last_frame();
} else {
last_frame = first_frame;
first_frame = clicked_regionview->region()->first_frame();
}
break;
case OverlapExternal:
if (last_frame < clicked_regionview->region()->first_frame()) {
first_frame = last_frame;
last_frame = clicked_regionview->region()->last_frame();
} else {
last_frame = first_frame;
first_frame = clicked_regionview->region()->first_frame();
}
break;
case OverlapInternal:
if (last_frame < clicked_regionview->region()->first_frame()) {
first_frame = last_frame;
last_frame = clicked_regionview->region()->last_frame();
} else {
last_frame = first_frame;
first_frame = clicked_regionview->region()->first_frame();
}
break;
case OverlapStart:
case OverlapEnd:
/* nothing to do except add clicked region to selection, since it
overlaps with the existing selection in this track.
*/
break;
}
break;
case OverlapExternal:
if (last_frame < clicked_regionview->region()->first_frame()) {
first_frame = last_frame;
last_frame = clicked_regionview->region()->last_frame();
} else {
last_frame = first_frame;
first_frame = clicked_regionview->region()->first_frame();
}
break;
} else {
case OverlapInternal:
if (last_frame < clicked_regionview->region()->first_frame()) {
first_frame = last_frame;
last_frame = clicked_regionview->region()->last_frame();
} else {
last_frame = first_frame;
first_frame = clicked_regionview->region()->first_frame();
}
break;
case OverlapStart:
case OverlapEnd:
/* nothing to do except add clicked region to selection, since it
overlaps with the existing selection in this track.
/* click in a track that has no regions selected, so extend vertically
to pick out all regions that are defined by the existing selection
plus this one.
*/
break;
first_frame = entered_regionview->region()->position();
last_frame = entered_regionview->region()->last_frame();
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
if ((*i)->region()->position() < first_frame) {
first_frame = (*i)->region()->position();
}
if ((*i)->region()->last_frame() + 1 > last_frame) {
last_frame = (*i)->region()->last_frame();
}
}
}
/* 2. find all selectable objects (regionviews in this case) between that one and the end of the
one that was clicked.
*/
/* 2. find all the tracks we should select in */
set<RouteTimeAxisView*> relevant_tracks;
set<RouteTimeAxisView*> already_in_selection;
get_relevant_tracks (relevant_tracks);
if (relevant_tracks.empty()) {
/* no relevant tracks -> no tracks selected .. thus .. if
the regionview we're in isn't selected (i.e. we're
about to extend to it), then find all tracks between
the this one and any selected ones.
*/
if (!selection->selected (entered_regionview)) {
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&entered_regionview->get_time_axis_view());
if (rtv) {
/* add this track to the ones we will search */
relevant_tracks.insert (rtv);
/* find the track closest to this one that
already a selected region.
*/
RouteTimeAxisView* closest = 0;
int distance = INT_MAX;
int key = rtv->route()->order_key ("editor");
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
RouteTimeAxisView* artv = dynamic_cast<RouteTimeAxisView*>(&(*x)->get_time_axis_view());
if (artv && artv != rtv) {
pair<set<RouteTimeAxisView*>::iterator,bool> result;
result = already_in_selection.insert (artv);
if (result.second) {
/* newly added to already_in_selection */
int d = artv->route()->order_key ("editor");
d -= key;
if (abs (d) < distance) {
distance = abs (d);
closest = artv;
}
}
}
}
if (closest) {
/* now add all tracks between that one and this one */
int okey = closest->route()->order_key ("editor");
if (okey > key) {
swap (okey, key);
}
for (TrackViewList::iterator x = track_views.begin(); x != track_views.end(); ++x) {
RouteTimeAxisView* artv = dynamic_cast<RouteTimeAxisView*>(*x);
if (artv && artv != rtv) {
int k = artv->route()->order_key ("editor");
if (k >= okey && k <= key) {
/* in range but don't add it if
it already has tracks selected.
this avoids odd selection
behaviour that feels wrong.
*/
if (find (already_in_selection.begin(),
already_in_selection.end(),
artv) == already_in_selection.end()) {
relevant_tracks.insert (artv);
}
}
}
}
}
}
}
}
/* 3. find all selectable objects (regionviews in this case) between that one and the end of the
one that was clicked.
*/
get_relevant_tracks (relevant_tracks);
for (set<RouteTimeAxisView*>::iterator t = relevant_tracks.begin(); t != relevant_tracks.end(); ++t) {
(*t)->get_selectables (first_frame, last_frame, -1.0, -1.0, results);
}
/* 3. convert to a vector of audio regions */
/* 4. convert to a vector of regions */
vector<RegionView*> regions;
@ -549,40 +680,18 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
return commit;
}
void
Editor::set_selected_regionview_from_region_list (boost::shared_ptr<Region> region, Selection::Operation op)
{
vector<RegionView*> all_equivalent_regions;
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
RouteTimeAxisView* tatv;
if ((tatv = dynamic_cast<RouteTimeAxisView*> (*i)) != 0) {
boost::shared_ptr<Playlist> pl;
vector<boost::shared_ptr<Region> > results;
RegionView* marv;
boost::shared_ptr<Diskstream> ds;
if ((ds = tatv->get_diskstream()) == 0) {
/* bus */
continue;
}
if ((pl = (ds->playlist())) != 0) {
pl->get_region_list_equivalent_regions (region, results);
}
for (vector<boost::shared_ptr<Region> >::iterator ir = results.begin(); ir != results.end(); ++ir) {
if ((marv = tatv->view()->find_view (*ir)) != 0) {
all_equivalent_regions.push_back (marv);
}
}
}
get_regions_corresponding_to (region, all_equivalent_regions);
if (all_equivalent_regions.empty()) {
return;
}
begin_reversible_command (_("set selected regions"));
switch (op) {
@ -655,6 +764,8 @@ Editor::region_selection_changed ()
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->set_selected_regionviews (selection->regions);
}
zoomed_to_region = false;
}
void
@ -1031,7 +1142,7 @@ Editor::select_range_between ()
}
set_mouse_mode (MouseRange);
selection->set (0, start, end);
selection->set ((TimeAxisView*) 0, start, end);
}
bool
@ -1077,10 +1188,36 @@ Editor::get_edit_op_range (nframes64_t& start, nframes64_t& end) const
break;
case EditAtMouse:
/* use mouse + selected marker */
if (selection->markers.empty()) {
start = m;
end = session->audible_frame();
} else {
start = selection->markers.front()->position();
end = m;
}
break;
case EditAtSelectedMarker:
/* use mouse + selected marker */
if (selection->markers.empty()) {
return false;
MessageDialog win (_("No edit range defined"),
false,
MESSAGE_INFO,
BUTTONS_OK);
win.set_secondary_text (
_("the edit point is Selected Marker\nbut there is no selected marker."));
win.set_default_response (RESPONSE_CLOSE);
win.set_position (Gtk::WIN_POS_MOUSE);
win.show_all();
win.run ();
return false; // NO RANGE
}
start = selection->markers.front()->position();
end = m;
@ -1098,3 +1235,9 @@ Editor::get_edit_op_range (nframes64_t& start, nframes64_t& end) const
return true;
}
void
Editor::deselect_all ()
{
selection->clear ();
}

View file

@ -235,13 +235,14 @@ Editor::mouse_add_new_tempo_event (nframes_t frame)
BBT_Time requested;
bpm = tempo_dialog.get_bpm ();
double nt = tempo_dialog.get_note_type();
bpm = max (0.01, bpm);
tempo_dialog.get_bbt_time (requested);
begin_reversible_command (_("add tempo mark"));
XMLNode &before = map.get_state();
map.add_tempo (Tempo (bpm), requested);
map.add_tempo (Tempo (bpm,nt), requested);
XMLNode &after = map.get_state();
session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
commit_reversible_command ();
@ -356,13 +357,14 @@ Editor::edit_tempo_section (TempoSection* section)
}
double bpm = tempo_dialog.get_bpm ();
double nt = tempo_dialog.get_note_type ();
BBT_Time when;
tempo_dialog.get_bbt_time(when);
bpm = max (0.01, bpm);
begin_reversible_command (_("replace tempo mark"));
XMLNode &before = session->tempo_map().get_state();
session->tempo_map().replace_tempo (*section, Tempo (bpm));
session->tempo_map().replace_tempo (*section, Tempo (bpm,nt));
session->tempo_map().move_tempo (*section, when);
XMLNode &after = session->tempo_map().get_state();
session->add_command (new MementoCommand<TempoMap>(session->tempo_map(), &before, &after));

View file

@ -40,6 +40,7 @@
#include <ardour/audioregion.h>
#include <ardour/audio_diskstream.h>
#include <ardour/stretch.h>
#include <ardour/pitch.h>
#include "i18n.h"
@ -49,50 +50,88 @@ using namespace sigc;
using namespace Gtk;
using namespace Gtkmm2ext;
Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
: ArdourDialog ("time stretch dialog"),
Editor::TimeFXDialog::TimeFXDialog (Editor& e, bool pitch)
: ArdourDialog (X_("time fx dialog")),
editor (e),
pitching (pitch),
pitch_octave_adjustment (0.0, 0.0, 4.0, 1, 2.0),
pitch_semitone_adjustment (0.0, 0.0, 12.0, 1.0, 4.0),
pitch_cent_adjustment (0.0, 0.0, 150.0, 5.0, 15.0),
pitch_octave_spinner (pitch_octave_adjustment),
pitch_semitone_spinner (pitch_semitone_adjustment),
pitch_cent_spinner (pitch_cent_adjustment),
quick_button (_("Quick but Ugly")),
antialias_button (_("Skip Anti-aliasing"))
{
set_modal (true);
set_position (Gtk::WIN_POS_MOUSE);
set_name (N_("TimeStretchDialog"));
set_name (N_("TimeFXDialog"));
WindowTitle title(Glib::get_application_name());
title += _("Timestretch");
if (pitching) {
title += _("Pitch Shift");
} else {
title += _("Time Stretch");
}
set_title(title.get_string());
get_vbox()->set_spacing (5);
get_vbox()->set_border_width (5);
get_vbox()->pack_start (upper_button_box);
get_vbox()->pack_start (progress_bar);
upper_button_box.set_homogeneous (true);
upper_button_box.set_spacing (5);
upper_button_box.set_border_width (5);
upper_button_box.pack_start (quick_button, true, true);
upper_button_box.pack_start (antialias_button, true, true);
action_button = add_button (_("Stretch/Shrink it"), Gtk::RESPONSE_ACCEPT);
cancel_button = add_button (_("Cancel"), Gtk::RESPONSE_CANCEL);
quick_button.set_name (N_("TimeStretchButton"));
antialias_button.set_name (N_("TimeStretchButton"));
progress_bar.set_name (N_("TimeStretchProgress"));
get_vbox()->set_spacing (5);
get_vbox()->set_border_width (12);
get_vbox()->pack_start (upper_button_box, false, false);
get_vbox()->pack_start (progress_bar);
if (pitching) {
upper_button_box.set_spacing (5);
upper_button_box.set_border_width (5);
Gtk::Label* l;
l = manage (new Label (_("Octaves")));
upper_button_box.pack_start (*l, false, false);
upper_button_box.pack_start (pitch_octave_spinner, false, false);
l = manage (new Label (_("Semitones (12TET)")));
upper_button_box.pack_start (*l, false, false);
upper_button_box.pack_start (pitch_semitone_spinner, false, false);
l = manage (new Label (_("Cents")));
upper_button_box.pack_start (*l, false, false);
upper_button_box.pack_start (pitch_cent_spinner, false, false);
pitch_cent_spinner.set_digits (1);
add_button (_("Shift"), Gtk::RESPONSE_ACCEPT);
} else {
upper_button_box.set_homogeneous (true);
upper_button_box.set_spacing (5);
upper_button_box.set_border_width (5);
upper_button_box.pack_start (quick_button, true, true);
upper_button_box.pack_start (antialias_button, true, true);
add_button (_("Stretch/Shrink"), Gtk::RESPONSE_ACCEPT);
}
quick_button.set_name (N_("TimeFXButton"));
antialias_button.set_name (N_("TimeFXButton"));
progress_bar.set_name (N_("TimeFXProgress"));
show_all_children ();
}
gint
Editor::TimeStretchDialog::update_progress ()
Editor::TimeFXDialog::update_progress ()
{
progress_bar.set_fraction (request.progress);
return !request.done;
}
void
Editor::TimeStretchDialog::cancel_timestretch_in_progress ()
Editor::TimeFXDialog::cancel_in_progress ()
{
status = -2;
request.cancel = true;
@ -100,7 +139,7 @@ Editor::TimeStretchDialog::cancel_timestretch_in_progress ()
}
gint
Editor::TimeStretchDialog::delete_timestretch_in_progress (GdkEventAny* ev)
Editor::TimeFXDialog::delete_in_progress (GdkEventAny* ev)
{
status = -2;
request.cancel = true;
@ -109,72 +148,121 @@ Editor::TimeStretchDialog::delete_timestretch_in_progress (GdkEventAny* ev)
}
int
Editor::run_timestretch (RegionSelection& regions, float fraction)
Editor::time_stretch (RegionSelection& regions, float fraction)
{
if (current_timestretch == 0) {
current_timestretch = new TimeStretchDialog (*this);
return time_fx (regions, fraction, false);
}
int
Editor::pitch_shift (RegionSelection& regions, float fraction)
{
return time_fx (regions, fraction, true);
}
int
Editor::time_fx (RegionSelection& regions, float val, bool pitching)
{
if (current_timefx != 0) {
delete current_timefx;
}
current_timestretch->progress_bar.set_fraction (0.0f);
current_timefx = new TimeFXDialog (*this, pitching);
switch (current_timestretch->run ()) {
current_timefx->progress_bar.set_fraction (0.0f);
switch (current_timefx->run ()) {
case RESPONSE_ACCEPT:
break;
default:
current_timestretch->hide ();
current_timefx->hide ();
return 1;
}
current_timestretch->status = 0;
current_timestretch->regions = regions;
current_timestretch->request.fraction = fraction;
current_timestretch->request.quick_seek = current_timestretch->quick_button.get_active();
current_timestretch->request.antialias = !current_timestretch->antialias_button.get_active();
current_timestretch->request.progress = 0.0f;
current_timestretch->request.done = false;
current_timestretch->request.cancel = false;
current_timefx->status = 0;
current_timefx->regions = regions;
if (pitching) {
float cents = current_timefx->pitch_octave_adjustment.get_value() * 1200.0;
cents += current_timefx->pitch_semitone_adjustment.get_value() * 100.0;
cents += current_timefx->pitch_cent_adjustment.get_value();
if (cents == 0.0) {
// user didn't change anything
current_timefx->hide ();
return 0;
}
// we now have the pitch shift in cents. divide by 1200 to get octaves
// then multiply by 2.0 because 1 octave == doubling the frequency
cents /= 1200.0;
cents /= 2.0;
// add 1.0 to convert to RB scale
cents += 1.0;
current_timefx->request.time_fraction = 1.0;
current_timefx->request.pitch_fraction = cents;
} else {
current_timefx->request.time_fraction = val;
current_timefx->request.pitch_fraction = 1.0;
}
current_timefx->request.quick_seek = current_timefx->quick_button.get_active();
current_timefx->request.antialias = !current_timefx->antialias_button.get_active();
current_timefx->request.progress = 0.0f;
current_timefx->request.done = false;
current_timefx->request.cancel = false;
/* re-connect the cancel button and delete events */
current_timestretch->first_cancel.disconnect();
current_timestretch->first_delete.disconnect();
current_timefx->first_cancel.disconnect();
current_timefx->first_delete.disconnect();
current_timestretch->first_cancel = current_timestretch->cancel_button->signal_clicked().connect
(mem_fun (current_timestretch, &TimeStretchDialog::cancel_timestretch_in_progress));
current_timestretch->first_delete = current_timestretch->signal_delete_event().connect
(mem_fun (current_timestretch, &TimeStretchDialog::delete_timestretch_in_progress));
current_timefx->first_cancel = current_timefx->cancel_button->signal_clicked().connect
(mem_fun (current_timefx, &TimeFXDialog::cancel_in_progress));
current_timefx->first_delete = current_timefx->signal_delete_event().connect
(mem_fun (current_timefx, &TimeFXDialog::delete_in_progress));
if (pthread_create_and_store ("timestretch", &current_timestretch->request.thread, 0, timestretch_thread, current_timestretch)) {
current_timestretch->hide ();
error << _("timestretch cannot be started - thread creation error") << endmsg;
if (pthread_create_and_store ("timefx", &current_timefx->request.thread, 0, timefx_thread, current_timefx)) {
current_timefx->hide ();
error << _("timefx cannot be started - thread creation error") << endmsg;
return -1;
}
pthread_detach (current_timestretch->request.thread);
pthread_detach (current_timefx->request.thread);
sigc::connection c = Glib::signal_timeout().connect (mem_fun (current_timestretch, &TimeStretchDialog::update_progress), 100);
sigc::connection c = Glib::signal_timeout().connect (mem_fun (current_timefx, &TimeFXDialog::update_progress), 100);
while (!current_timestretch->request.done) {
while (!current_timefx->request.done) {
gtk_main_iteration ();
}
c.disconnect ();
current_timestretch->hide ();
return current_timestretch->status;
current_timefx->hide ();
return current_timefx->status;
}
void
Editor::do_timestretch (TimeStretchDialog& dialog)
Editor::do_timefx (TimeFXDialog& dialog)
{
Track* t;
boost::shared_ptr<Playlist> playlist;
boost::shared_ptr<Region> new_region;
bool in_command = false;
for (RegionSelection::iterator i = dialog.regions.begin(); i != dialog.regions.end(); ) {
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*i);
if (!arv)
if (!arv) {
continue;
}
boost::shared_ptr<AudioRegion> region (arv->audio_region());
TimeAxisView* tv = &(arv->get_time_axis_view());
@ -205,16 +293,28 @@ Editor::do_timestretch (TimeStretchDialog& dialog)
return;
}
Stretch stretch (*session, dialog.request);
Filter* fx;
if (stretch.run (region)) {
if (dialog.pitching) {
fx = new Pitch (*session, dialog.request);
} else {
fx = new Stretch (*session, dialog.request);
}
if (fx->run (region)) {
dialog.status = -1;
dialog.request.done = true;
delete fx;
return;
}
if (!stretch.results.empty()) {
new_region = stretch.results.front();
if (!fx->results.empty()) {
new_region = fx->results.front();
if (!in_command) {
begin_reversible_command (dialog.pitching ? _("pitch shift") : _("time stretch"));
in_command = true;
}
XMLNode &before = playlist->get_state();
playlist->replace_region (region, new_region, region->position());
@ -223,6 +323,11 @@ Editor::do_timestretch (TimeStretchDialog& dialog)
}
i = tmp;
delete fx;
}
if (in_command) {
commit_reversible_command ();
}
dialog.status = 0;
@ -230,15 +335,15 @@ Editor::do_timestretch (TimeStretchDialog& dialog)
}
void*
Editor::timestretch_thread (void *arg)
Editor::timefx_thread (void *arg)
{
PBD::ThreadCreated (pthread_self(), X_("TimeFX"));
TimeStretchDialog* tsd = static_cast<TimeStretchDialog*>(arg);
TimeFXDialog* tsd = static_cast<TimeFXDialog*>(arg);
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
tsd->editor.do_timestretch (*tsd);
tsd->editor.do_timefx (*tsd);
return 0;
}

91
gtk2_ardour/evtest.cc Normal file
View file

@ -0,0 +1,91 @@
#include <gtkmm.h>
#include <iostream>
using namespace std;
bool
print_event (GdkEvent* event)
{
cerr << hex;
cerr << "Event: type = " << event->type << ' ';
switch (event->type) {
case GDK_BUTTON_PRESS:
cerr << "Button press, button = "
<< event->button.button
<< " state "
<< event->button.state
<< endl;
break;
case GDK_BUTTON_RELEASE:
cerr << "Button release, button = "
<< event->button.button
<< " state "
<< event->button.state
<< endl;
break;
case GDK_SCROLL:
cerr << "Scroll: direction = "
<< event->scroll.direction
<< " state = "
<< event->scroll.state
<< endl;
break;
case GDK_KEY_PRESS:
cerr << "Key press, keycode = "
<< event->key.keyval
<< " name "
<< gdk_keyval_name (event->key.keyval)
<< " state = "
<< event->key.state
<< " hw keycode = "
<< event->key.hardware_keycode
<< " string = "
<< (event->key.string ? event->key.string : "not defined")
<< endl;
break;
case GDK_KEY_RELEASE:
cerr << "Key release, keycode = "
<< event->key.keyval
<< " name "
<< gdk_keyval_name (event->key.keyval)
<< " state = "
<< event->key.state
<< " hw keycode = "
<< event->key.hardware_keycode
<< " string = "
<< (event->key.string ? event->key.string : "not defined")
<< endl;
break;
default:
cerr << endl;
break;
}
cerr << dec;
return false;
}
int
main (int argc, char* argv[])
{
Gtk::Main app (&argc, &argv);
Gtk::Window window;
Gtk::EventBox eventbox;
window.add (eventbox);
window.set_size_request (250, 250);
eventbox.signal_event().connect (sigc::ptr_fun (print_event));
eventbox.add_events (Gdk::SCROLL_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
eventbox.set_flags (Gtk::CAN_FOCUS);
eventbox.show ();
window.show ();
app.run();
}

View file

@ -24,7 +24,6 @@
#include <fstream>
#include <samplerate.h>
#include <pbd/convert.h>
#include <pbd/xml++.h>
@ -40,6 +39,7 @@
#include <ardour/audiofilesource.h>
#include <ardour/gdither.h>
#include <ardour/utils.h>
#include <ardour/profile.h>
#include "export_dialog.h"
#include "ardour_ui.h"
@ -338,8 +338,12 @@ ExportDialog::ExportDialog(PublicEditor& e)
format_table.set_col_spacings (5);
format_table.set_row_spacings (5);
format_table.attach (channel_count_label, 0, 1, 0, 1, FILL, FILL);
format_table.attach (channel_count_combo, 1, 2, 0, 1, FILL, FILL);
int row = 0;
format_table.attach (channel_count_label, 0, 1, row, row+1);
format_table.attach (channel_count_combo, 1, 2, row, row+1);
row++;
format_table.attach (header_format_label, 0, 1, 1, 2, FILL, FILL);
format_table.attach (header_format_combo, 1, 2, 1, 2, FILL, FILL);
@ -347,21 +351,42 @@ ExportDialog::ExportDialog(PublicEditor& e)
format_table.attach (bitdepth_format_label, 0, 1, 2, 3, FILL, FILL);
format_table.attach (bitdepth_format_combo, 1, 2, 2, 3, FILL, FILL);
format_table.attach (endian_format_label, 0, 1, 3, 4, FILL, FILL);
format_table.attach (endian_format_combo, 1, 2, 3, 4, FILL, FILL);
format_table.attach (bitdepth_format_label, 0, 1, row, row+1);
format_table.attach (bitdepth_format_combo, 1, 2, row, row+1);
row++;
if (!Profile->get_sae()) {
format_table.attach (endian_format_label, 0, 1, row, row+1);
format_table.attach (endian_format_combo, 1, 2, row, row+1);
row++;
}
format_table.attach (sample_rate_label, 0, 1, 4, 5, FILL, FILL);
format_table.attach (sample_rate_combo, 1, 2, 4, 5, FILL, FILL);
format_table.attach (sample_rate_label, 0, 1, row, row+1);
format_table.attach (sample_rate_combo, 1, 2, row, row+1);
format_table.attach (src_quality_label, 0, 1, 5, 6, FILL, FILL);
format_table.attach (src_quality_combo, 1, 2, 5, 6, FILL, FILL);
row++;
format_table.attach (dither_type_label, 0, 1, 6, 7, FILL, FILL);
format_table.attach (dither_type_combo, 1, 2, 6, 7, FILL, FILL);
if (!Profile->get_sae()) {
format_table.attach (src_quality_label, 0, 1, row, row+1);
format_table.attach (src_quality_combo, 1, 2, row, row+1);
row++;
}
format_table.attach (cue_file_label, 0, 1, 7, 8, FILL, FILL);
format_table.attach (cue_file_combo, 1, 2, 7, 8, FILL, FILL);
format_table.attach (cuefile_only_checkbox, 0, 2, 8, 9, FILL, FILL);
format_table.attach (dither_type_label, 0, 1, row, row+1);
format_table.attach (dither_type_combo, 1, 2, row, row+1);
row++;
if (!Profile->get_sae()) {
format_table.attach (cue_file_label, 0, 1, row, row+1);
format_table.attach (cue_file_combo, 1, 2, row, row+1);
row++;
format_table.attach (cuefile_only_checkbox, 0, 2, row, row+1);
}
file_entry.set_name ("ExportFileDisplay");
signal_delete_event().connect (mem_fun(*this, &ExportDialog::window_closed));
@ -651,10 +676,9 @@ ExportDialog::export_toc_file (Locations::LocationList& locations, const string&
return;
}
string filepath = path + ".toc";
string filepath = path + ".toc";
ofstream out (filepath.c_str());
long unsigned int last_end_time = spec.start_frame, last_start_time = spec.start_frame;
int numtracks = 0;
gchar buf[18];
if (!out) {
@ -669,102 +693,110 @@ ExportDialog::export_toc_file (Locations::LocationList& locations, const string&
Locations::LocationList temp;
for (i = locations.begin(); i != locations.end(); ++i) {
if ((*i)->start() >= spec.start_frame && (*i)->end() <= spec.end_frame && (*i)->is_cd_marker() && !(*i)->is_end()) {
temp.push_back (*i);
if (!(*i)->is_mark()) {
numtracks ++;
}
}
if ((*i)->start() >= spec.start_frame && (*i)->end() <= spec.end_frame && (*i)->is_cd_marker() && !(*i)->is_end()) {
temp.push_back (*i);
}
}
if (numtracks == 0 ) {
/* the user supplied no track markers.
we now treat the session as one track.*/
out << endl << "TRACK AUDIO" << endl;
out << "COPY" << endl;
out << "NO PRE_EMPHASIS" << endl;
/* XXX add session properties for catalog etc.
(so far only the session name is used) */
out << "CD_TEXT {" << endl << " LANGUAGE 0 {" << endl << " TITLE \"" << session->name() << "\"" << endl;
out << " }" << endl << "}" << endl;
out << "FILE \"" << path << "\" ";
out << "00:00:00 " ;
frames_to_cd_frames_string (buf, spec.end_frame - spec.start_frame, session->frame_rate());
out << buf << endl;
out << "START 00:00:00" << endl;
last_start_time = spec.start_frame;
last_end_time = spec.end_frame;
}
if (temp.size()) {
if (temp.size() > 0) {
LocationSortByStart cmp;
temp.sort (cmp);
Location * curr_range = 0;
Locations::LocationList::iterator nexti;
for (i = temp.begin(); i != temp.end(); ++i) {
if (!(*i)->is_mark()) {
/*this is a track */
out << endl << "TRACK AUDIO" << endl;
if ((*i)->cd_info.find("scms") != (*i)->cd_info.end()) {
out << "NO ";
if ((*i)->start() >= last_end_time)
{
/* this is a track, defined by a cd range marker or a cd location marker outside of a cd range */
out << endl << "TRACK AUDIO" << endl;
if ((*i)->cd_info.find("scms") != (*i)->cd_info.end()) {
out << "NO ";
}
out << "COPY" << endl;
if ((*i)->cd_info.find("preemph") != (*i)->cd_info.end()) {
out << "PRE_EMPHASIS" << endl;
} else {
out << "NO PRE_EMPHASIS" << endl;
}
if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {
out << "ISRC \"" << (*i)->cd_info["isrc"] << "\"" << endl;
}
out << "CD_TEXT {" << endl << " LANGUAGE 0 {" << endl << " TITLE \"" << (*i)->name() << "\"" << endl;
if ((*i)->cd_info.find("performer") != (*i)->cd_info.end()) {
out << " PERFORMER \"" << (*i)->cd_info["performer"] << "\"" << endl;
}
if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
out << " COMPOSER \"" << (*i)->cd_info["string_composer"] << "\"" << endl;
}
if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {
out << " ISRC \"";
out << (*i)->cd_info["isrc"].substr(0,2) << "-";
out << (*i)->cd_info["isrc"].substr(2,3) << "-";
out << (*i)->cd_info["isrc"].substr(5,2) << "-";
out << (*i)->cd_info["isrc"].substr(7,5) << "\"" << endl;
}
out << " }" << endl << "}" << endl;
frames_to_cd_frames_string (buf, last_end_time - spec.start_frame, session->frame_rate());
out << "FILE \"" << path << "\" " << buf;
if ((*i)->is_mark()) {
// a mark track location needs to look ahead to the next marker's start to determine length
nexti = i;
++nexti;
if (nexti != temp.end()) {
frames_to_cd_frames_string (buf, (*nexti)->start() - last_end_time, session->frame_rate());
out << buf << endl;
frames_to_cd_frames_string (buf, (*i)->start() - last_end_time, session->frame_rate());
out << "START" << buf << endl;
last_start_time = (*i)->start();
last_end_time = (*nexti)->start();
}
else {
// this was the last marker, use session end
frames_to_cd_frames_string (buf, spec.end_frame - last_end_time, session->frame_rate());
out << buf << endl;
frames_to_cd_frames_string (buf, (*i)->start() - last_end_time, session->frame_rate());
out << "START" << buf << endl;
last_start_time = (*i)->start();
last_end_time = spec.end_frame;
}
curr_range = 0;
}
else {
// range
frames_to_cd_frames_string (buf, (*i)->end() - last_end_time, session->frame_rate());
out << buf << endl;
frames_to_cd_frames_string (buf, (*i)->start() - last_end_time, session->frame_rate());
out << "START" << buf << endl;
last_start_time = (*i)->start();
last_end_time = (*i)->end();
curr_range = (*i);
}
}
out << "COPY" << endl;
if ((*i)->cd_info.find("preemph") != (*i)->cd_info.end()) {
out << "PRE_EMPHASIS" << endl;
} else {
out << "NO PRE_EMPHASIS" << endl;
else if ((*i)->is_mark())
{
/* this is an index within a track */
frames_to_cd_frames_string (buf, (*i)->start() - last_start_time, session->frame_rate());
out << "INDEX" << buf << endl;
}
if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {
out << "ISRC \"" << (*i)->cd_info["isrc"] << "\"" << endl;
}
out << "CD_TEXT {" << endl << " LANGUAGE 0 {" << endl << " TITLE \"" << (*i)->name() << "\"" << endl;
if ((*i)->cd_info.find("performer") != (*i)->cd_info.end()) {
out << " PERFORMER \"" << (*i)->cd_info["performer"] << "\"" << endl;
}
if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
out << " COMPOSER \"" << (*i)->cd_info["string_composer"] << "\"" << endl;
}
if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {
out << " ISRC \"";
out << (*i)->cd_info["isrc"].substr(0,2) << "-";
out << (*i)->cd_info["isrc"].substr(2,3) << "-";
out << (*i)->cd_info["isrc"].substr(5,2) << "-";
out << (*i)->cd_info["isrc"].substr(7,5) << "\"" << endl;
}
out << " }" << endl << "}" << endl;
frames_to_cd_frames_string (buf, last_end_time - spec.start_frame, session->frame_rate());
out << "FILE \"" << path << "\" " << buf;
frames_to_cd_frames_string (buf, (*i)->end() - last_end_time, session->frame_rate());
out << buf << endl;
frames_to_cd_frames_string (buf, (*i)->start() - last_end_time, session->frame_rate());
out << "START" << buf << endl;
last_start_time = (*i)->start();
last_end_time = (*i)->end();
} else if ((*i)->start() < last_end_time) {
/* this is an index within a track */
frames_to_cd_frames_string (buf, (*i)->start() - last_start_time, session->frame_rate());
out << "INDEX" << buf << endl;
}
}
}
@ -809,7 +841,7 @@ ExportDialog::export_cue_file (Locations::LocationList& locations, const string&
out << "FILE " << path << ' ' << (header_format_combo.get_active_text()) << endl;
}
if (numtracks == 0) {
if (false && numtracks == 0) {
/* the user has supplied no track markers.
the entire export is treated as one track.
*/
@ -840,58 +872,78 @@ ExportDialog::export_cue_file (Locations::LocationList& locations, const string&
if (temp.size()) {
LocationSortByStart cmp;
temp.sort (cmp);
Location * curr_range = 0;
Locations::LocationList::iterator nexti;
for ( i = temp.begin(); i != temp.end(); ++i) {
if (!(*i)->is_mark() && ((*i)->start() >= last_track_end)) {
/* this is a track and it doesn't start inside another one*/
tracknum++;
indexnum = 0;
out << endl << "TRACK " << tracknum << " AUDIO" << endl;
out << "FLAGS " ;
if ((*i)->cd_info.find("scms") != (*i)->cd_info.end()) {
out << "SCMS ";
} else {
out << "DCP ";
}
if ((*i)->cd_info.find("preemph") != (*i)->cd_info.end()) {
out << "PRE";
}
out << endl;
if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {
out << "ISRC " << (*i)->cd_info["isrc"] << endl;
}
if ((*i)->name() != "") {
out << "TITLE \"" << (*i)->name() << "\"" << endl;
}
if ((*i)->cd_info.find("performer") != (*i)->cd_info.end()) {
out << "PERFORMER \"" << (*i)->cd_info["performer"] << "\"" << endl;
}
if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
out << "SONGWRITER \"" << (*i)->cd_info["string_composer"] << "\"" << endl;
}
snprintf (buf, sizeof(buf), "INDEX %02d", indexnum);
out << buf;
frames_to_cd_frames_string (buf, last_track_end - spec.start_frame, session->frame_rate());
out << buf << endl;
indexnum++;
last_track_end = (*i)->end();
}
if ((tracknum > 0) && ((*i)->start() < last_track_end)) {
/*this is an index and it lies within a track*/
snprintf (buf, sizeof(buf), "INDEX %02d", indexnum);
out << buf;
frames_to_cd_frames_string (buf,(*i)->start() - spec.start_frame, session->frame_rate());
out << buf << endl;
indexnum++;
}
if ((*i)->start() >= last_track_end)
{
/* this is a track and it doesn't start inside another one*/
tracknum++;
indexnum = 0;
out << endl << "TRACK " << tracknum << " AUDIO" << endl;
out << "FLAGS " ;
if ((*i)->cd_info.find("scms") != (*i)->cd_info.end()) {
out << "SCMS ";
} else {
out << "DCP ";
}
if ((*i)->cd_info.find("preemph") != (*i)->cd_info.end()) {
out << "PRE";
}
out << endl;
if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {
out << "ISRC " << (*i)->cd_info["isrc"] << endl;
}
if ((*i)->name() != "") {
out << "TITLE \"" << (*i)->name() << "\"" << endl;
}
if ((*i)->cd_info.find("performer") != (*i)->cd_info.end()) {
out << "PERFORMER \"" << (*i)->cd_info["performer"] << "\"" << endl;
}
if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
out << "SONGWRITER \"" << (*i)->cd_info["string_composer"] << "\"" << endl;
}
snprintf (buf, sizeof(buf), "INDEX %02d", indexnum);
out << buf;
frames_to_cd_frames_string (buf, last_track_end - spec.start_frame, session->frame_rate());
out << buf << endl;
indexnum++;
if ((*i)->is_mark()) {
// need to find the next start to define the end
nexti = i;
++nexti;
if (nexti != temp.end()) {
last_track_end = (*nexti)->start();
}
else {
last_track_end = spec.end_frame;
}
curr_range = 0;
}
else {
last_track_end = (*i)->end();
curr_range = (*i);
}
}
if ((tracknum > 0) && ((*i)->start() < last_track_end)) {
/*this is an index and it lies within a track*/
snprintf (buf, sizeof(buf), "INDEX %02d", indexnum);
out << buf;
frames_to_cd_frames_string (buf,(*i)->start() - spec.start_frame, session->frame_rate());
out << buf << endl;
indexnum++;
}
}
}
@ -912,12 +964,24 @@ void
ExportDialog::do_export ()
{
string filepath = file_chooser.get_filename();
if (!ARDOUR_UI::instance()->the_engine().connected()) {
MessageDialog msg (*this,
_("Not connected to audioengine"),
true,
MESSAGE_ERROR,
BUTTONS_OK);
msg.set_secondary_text (_("Ardour cannot export audio when disconnected"));
msg.present ();
msg.run ();
return;
}
if(!is_filepath_valid(filepath)){
return;
}
if (export_cd_markers_allowed) {
if (!Profile->get_sae() && export_cd_markers_allowed) {
if (cue_file_combo.get_active_text () != _("None")) {
do_export_cd_markers (file_chooser.get_filename(), cue_file_combo.get_active_text ());
}
@ -1303,10 +1367,12 @@ ExportDialog::initSpec(string &filepath)
spec.format = 0;
spec.format |= sndfile_header_format_from_string (header_format_combo.get_active_text ());
if ((spec.format & SF_FORMAT_WAV) == 0) {
/* RIFF/WAV specifies endianess */
spec.format |= sndfile_endian_format_from_string (endian_format_combo.get_active_text ());
if (!Profile->get_sae()) {
if ((spec.format & SF_FORMAT_WAV) == 0) {
/* RIFF/WAV specifies endianess */
spec.format |= sndfile_endian_format_from_string (endian_format_combo.get_active_text ());
}
}
spec.format |= sndfile_bitdepth_format_from_string (bitdepth_format_combo.get_active_text ());
@ -1328,17 +1394,21 @@ ExportDialog::initSpec(string &filepath)
spec.sample_rate = session->frame_rate();
}
string src_str = src_quality_combo.get_active_text();
if (src_str == _("fastest")) {
spec.src_quality = SRC_ZERO_ORDER_HOLD;
} else if (src_str == _("linear")) {
spec.src_quality = SRC_LINEAR;
} else if (src_str == _("better")) {
spec.src_quality = SRC_SINC_FASTEST;
} else if (src_str == _("intermediate")) {
spec.src_quality = SRC_SINC_MEDIUM_QUALITY;
} else {
if (Profile->get_sae()) {
spec.src_quality = SRC_SINC_BEST_QUALITY;
} else {
string src_str = src_quality_combo.get_active_text();
if (src_str == _("fastest")) {
spec.src_quality = SRC_ZERO_ORDER_HOLD;
} else if (src_str == _("linear")) {
spec.src_quality = SRC_LINEAR;
} else if (src_str == _("better")) {
spec.src_quality = SRC_SINC_FASTEST;
} else if (src_str == _("intermediate")) {
spec.src_quality = SRC_SINC_MEDIUM_QUALITY;
} else {
spec.src_quality = SRC_SINC_BEST_QUALITY;
}
}
string dither_str = dither_type_combo.get_active_text();

View file

@ -156,12 +156,11 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
/*
if we have a route (ie. we're not the click),
if we have a non-hidden route (ie. we're not the click or the auditioner),
pack some route-dependent stuff.
*/
gain_display_box.pack_end (peak_display, true, true);
hbox.pack_end (meter_packer, true, true);
using namespace Menu_Helpers;
@ -218,35 +217,14 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
ResetGroupPeakDisplays.connect (mem_fun(*this, &GainMeter::reset_group_peak_display));
UI::instance()->theme_changed.connect (mem_fun(*this, &GainMeter::on_theme_changed));
fader_centering_box->show();
fader_vbox->show();
gain_slider->show();
hbox.show();
meter_packer.show();
gain_display.show();
peak_display.show();
gain_display_box.show();
fader_box.show();
meter_metric_area.show();
gain_automation_style_button.show();
gain_automation_state_button.show();
show();
ColorsChanged.connect (mem_fun (*this, &GainMeter::color_handler));
//hide_all();
}
void
GainMeter::set_width (Width w, int len)
{
switch (w) {
case Wide:
peak_display.show();
break;
case Narrow:
peak_display.hide();
break;
}
_width = w;
setup_meters (len);
}
@ -478,15 +456,21 @@ GainMeter::setup_meters (int len)
/* pack them backwards */
if (_width == Wide) {
meter_packer.pack_end (meter_metric_area, false, false);
meter_metric_area.show_all ();
}
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) {
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);
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);
@ -497,6 +481,7 @@ GainMeter::setup_meters (int len)
meters[n].meter->show_all ();
meters[n].packed = true;
}
color_changed = false;
}
int
@ -522,9 +507,9 @@ GainMeter::peak_button_release (GdkEventButton* ev)
{
/* reset peak label */
if (ev->button == 1 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control|Keyboard::Shift)) {
if (ev->button == 1 && Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier|Keyboard::TertiaryModifier)) {
ResetAllPeakDisplays ();
} else if (ev->button == 1 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
} else if (ev->button == 1 && Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
Route* r;
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
ResetGroupPeakDisplays (r->mix_group());
@ -733,10 +718,10 @@ GainMeter::meter_press(GdkEventButton* ev)
if (ev->button == 2) {
// ctrl-button2 click is the midi binding click
// Primary-button2 click is the midi binding click
// button2-click is "momentary"
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control))) {
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier))) {
wait_for_release = true;
old_meter_point = _route->meter_point ();
}
@ -744,9 +729,9 @@ GainMeter::meter_press(GdkEventButton* ev)
if (ev->button == 1 || ev->button == 2) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Shift))) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
/* ctrl-shift-click applies change to all routes */
/* Primary+Tertiary-click applies change to all routes */
_session.begin_reversible_command (_("meter point change"));
Session::GlobalMeteringStateCommand *cmd = new Session::GlobalMeteringStateCommand (_session, this);
@ -756,10 +741,10 @@ GainMeter::meter_press(GdkEventButton* ev)
_session.commit_reversible_command ();
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
/* ctrl-click: solo mix group.
ctrl-button2 is MIDI learn.
/* Primary-click: solo mix group.
NOTE: Primary-button2 is MIDI learn.
*/
if (ev->button == 1) {
@ -985,3 +970,32 @@ GainMeter::gain_automation_state_changed ()
gain_watching = ARDOUR_UI::RapidScreenUpdate.connect (mem_fun (*this, &GainMeter::effective_gain_display));
}
}
void GainMeter::setup_atv_meter (int len)
{
set_no_show_all();
regular_meter_width = 3;
set_width(Narrow, len);
hide_all();
//cerr << "Config->get_show_track_meters() = " << Config->get_show_track_meters() << endl;//DEBUG
if (Config->get_show_track_meters()) {
meter_packer.show_all();
hbox.show();
show();
}
}
void GainMeter::clear_meters ()
{
for (vector<MeterInfo>::iterator i = meters.begin(); i < meters.end(); i++) {
(*i).meter->clear();
}
}
void GainMeter::color_handler()
{
color_changed = true;
setup_meters();
}

View file

@ -75,6 +75,9 @@ class GainMeter : public Gtk::VBox
void set_meter_strip_name (const char * name);
void set_fader_name (const char * name);
void setup_atv_meter (int);
void clear_meters ();
private:
friend class MixerStrip;
@ -129,9 +132,9 @@ class GainMeter : public Gtk::VBox
struct MeterInfo {
Gtkmm2ext::FastMeter *meter;
gint16 width;
int length;
bool packed;
gint16 width;
int length;
bool packed;
MeterInfo() {
meter = 0;
@ -191,6 +194,8 @@ class GainMeter : public Gtk::VBox
void on_theme_changed ();
bool style_changed;
bool color_changed;
void color_handler();
};
#endif /* __ardour_gtk_gain_meter_h__ */

View file

@ -57,8 +57,8 @@ using namespace Gtkmm2ext;
using namespace Gtk;
using namespace sigc;
LadspaPluginUI::LadspaPluginUI (boost::shared_ptr<PluginInsert> pi, nframes64_t sample_rate, nframes64_t period_size, bool scrollable)
: PlugUIBase (pi, sample_rate, period_size),
GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrollable)
: PlugUIBase (pi),
button_table (initial_button_rows, initial_button_cols),
output_table (initial_output_rows, initial_output_cols),
hAdjustment(0.0, 0.0, 0.0),
@ -108,14 +108,14 @@ LadspaPluginUI::LadspaPluginUI (boost::shared_ptr<PluginInsert> pi, nframes64_t
pack_start (hpacker, false, false);
}
pi->ActiveChanged.connect (bind(mem_fun(*this, &LadspaPluginUI::processor_active_changed),
pi->ActiveChanged.connect (bind(mem_fun(*this, &GenericPluginUI::processor_active_changed),
boost::weak_ptr<Processor>(pi)));
bypass_button.set_active (!pi->active());
build ();
}
LadspaPluginUI::~LadspaPluginUI ()
GenericPluginUI::~GenericPluginUI ()
{
if (output_controls.size() > 0) {
screen_update_connection.disconnect();
@ -123,7 +123,7 @@ LadspaPluginUI::~LadspaPluginUI ()
}
void
LadspaPluginUI::build ()
GenericPluginUI::build ()
{
guint32 i = 0;
@ -290,7 +290,7 @@ LadspaPluginUI::build ()
button_table.show_all ();
}
LadspaPluginUI::ControlUI::ControlUI ()
GenericPluginUI::ControlUI::ControlUI ()
: automate_button (X_("")) // force creation of a label
{
automate_button.set_name ("PluginAutomateButton");
@ -310,7 +310,7 @@ LadspaPluginUI::ControlUI::ControlUI ()
meterinfo = 0;
}
LadspaPluginUI::ControlUI::~ControlUI()
GenericPluginUI::ControlUI::~ControlUI()
{
if (meterinfo) {
delete meterinfo->meter;
@ -319,7 +319,7 @@ LadspaPluginUI::ControlUI::~ControlUI()
}
void
LadspaPluginUI::automation_state_changed (ControlUI* cui)
GenericPluginUI::automation_state_changed (ControlUI* cui)
{
/* update button label */
@ -352,13 +352,13 @@ static void integer_printer (char buf[32], Adjustment &adj, void *arg)
}
void
LadspaPluginUI::print_parameter (char *buf, uint32_t len, uint32_t param)
GenericPluginUI::print_parameter (char *buf, uint32_t len, uint32_t param)
{
plugin->print_parameter (param, buf, len);
}
LadspaPluginUI::ControlUI*
LadspaPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<AutomationControl> mcontrol)
GenericPluginUI::ControlUI*
GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<AutomationControl> mcontrol)
{
ControlUI* control_ui = NULL;
if (!mcontrol)
@ -387,15 +387,17 @@ LadspaPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automati
if ((lp = boost::dynamic_pointer_cast<LadspaPlugin>(plugin)) != 0) {
lrdf_defaults* defaults = lrdf_get_scale_values(lp->unique_id(), port_index);
// FIXME: not all plugins have a numeric unique ID
uint32_t id = atol (lp->unique_id().c_str());
lrdf_defaults* defaults = lrdf_get_scale_values(id, port_index);
if (defaults && defaults->count > 0) {
control_ui->combo = new Gtk::ComboBoxText;
//control_ui->combo->set_value_in_list(true, false);
set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui));
control_ui->combo->signal_changed().connect (bind (mem_fun(*this, &LadspaPluginUI::control_combo_changed), control_ui));
mcontrol->Changed.connect (bind (mem_fun (*this, &LadspaPluginUI::parameter_changed), control_ui));
control_ui->combo->signal_changed().connect (bind (mem_fun(*this, &GenericPluginUI::control_combo_changed), control_ui));
mcontrol->Changed.connect (bind (mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui));
control_ui->pack_start(control_ui->label, true, true);
control_ui->pack_start(*control_ui->combo, false, true);
@ -418,7 +420,7 @@ LadspaPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automati
control_ui->pack_start (*control_ui->button, false, true);
control_ui->pack_start (control_ui->automate_button, false, false);
control_ui->button->signal_clicked().connect (bind (mem_fun(*this, &LadspaPluginUI::control_port_toggled), control_ui));
control_ui->button->signal_clicked().connect (bind (mem_fun(*this, &GenericPluginUI::control_port_toggled), control_ui));
if(plugin->get_parameter (port_index) == 1){
control_ui->button->set_active(true);
@ -461,15 +463,15 @@ LadspaPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automati
Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2);
control_ui->clickbox->set_print_func (integer_printer, 0);
} else {
//sigc::slot<void,char*,uint32_t> pslot = sigc::bind (mem_fun(*this, &LadspaPluginUI::print_parameter), (uint32_t) port_index);
//sigc::slot<void,char*,uint32_t> pslot = sigc::bind (mem_fun(*this, &GenericPluginUI::print_parameter), (uint32_t) port_index);
control_ui->controller->set_size_request (200, req.height);
control_ui->controller->set_name (X_("PluginSlider"));
control_ui->controller->set_style (BarController::LeftToRight);
control_ui->controller->set_use_parent (true);
control_ui->controller->StartGesture.connect (bind (mem_fun(*this, &LadspaPluginUI::start_touch), control_ui));
control_ui->controller->StopGesture.connect (bind (mem_fun(*this, &LadspaPluginUI::stop_touch), control_ui));
control_ui->controller->StartGesture.connect (bind (mem_fun(*this, &GenericPluginUI::start_touch), control_ui));
control_ui->controller->StopGesture.connect (bind (mem_fun(*this, &GenericPluginUI::stop_touch), control_ui));
}
@ -492,13 +494,13 @@ LadspaPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automati
}
control_ui->pack_start (control_ui->automate_button, false, false);
control_ui->automate_button.signal_clicked().connect (bind (mem_fun(*this, &LadspaPluginUI::astate_clicked), control_ui, (uint32_t) port_index));
control_ui->automate_button.signal_clicked().connect (bind (mem_fun(*this, &GenericPluginUI::astate_clicked), control_ui, (uint32_t) port_index));
automation_state_changed (control_ui);
mcontrol->Changed.connect (bind (mem_fun (*this, &LadspaPluginUI::parameter_changed), control_ui));
mcontrol->Changed.connect (bind (mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui));
mcontrol->list()->automation_state_changed.connect
(bind (mem_fun(*this, &LadspaPluginUI::automation_state_changed), control_ui));
(bind (mem_fun(*this, &GenericPluginUI::automation_state_changed), control_ui));
} else if (plugin->parameter_is_output (port_index)) {
@ -547,25 +549,25 @@ LadspaPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automati
output_controls.push_back (control_ui);
}
mcontrol->Changed.connect (bind (mem_fun (*this, &LadspaPluginUI::parameter_changed), control_ui));
mcontrol->Changed.connect (bind (mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui));
return control_ui;
}
void
LadspaPluginUI::start_touch (LadspaPluginUI::ControlUI* cui)
GenericPluginUI::start_touch (GenericPluginUI::ControlUI* cui)
{
cui->control->list()->start_touch ();
}
void
LadspaPluginUI::stop_touch (LadspaPluginUI::ControlUI* cui)
GenericPluginUI::stop_touch (GenericPluginUI::ControlUI* cui)
{
cui->control->list()->stop_touch ();
}
void
LadspaPluginUI::astate_clicked (ControlUI* cui, uint32_t port)
GenericPluginUI::astate_clicked (ControlUI* cui, uint32_t port)
{
using namespace Menu_Helpers;
@ -578,34 +580,34 @@ LadspaPluginUI::astate_clicked (ControlUI* cui, uint32_t port)
items.clear ();
items.push_back (MenuElem (_("Manual"),
bind (mem_fun(*this, &LadspaPluginUI::set_automation_state), (AutoState) Off, cui)));
bind (mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Off, cui)));
items.push_back (MenuElem (_("Play"),
bind (mem_fun(*this, &LadspaPluginUI::set_automation_state), (AutoState) Play, cui)));
bind (mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Play, cui)));
items.push_back (MenuElem (_("Write"),
bind (mem_fun(*this, &LadspaPluginUI::set_automation_state), (AutoState) Write, cui)));
bind (mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Write, cui)));
items.push_back (MenuElem (_("Touch"),
bind (mem_fun(*this, &LadspaPluginUI::set_automation_state), (AutoState) Touch, cui)));
bind (mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Touch, cui)));
automation_menu->popup (1, gtk_get_current_event_time());
}
void
LadspaPluginUI::set_automation_state (AutoState state, ControlUI* cui)
GenericPluginUI::set_automation_state (AutoState state, ControlUI* cui)
{
insert->set_parameter_automation_state (cui->parameter(), state);
}
void
LadspaPluginUI::parameter_changed (ControlUI* cui)
GenericPluginUI::parameter_changed (ControlUI* cui)
{
if (!cui->update_pending) {
cui->update_pending = true;
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun(*this, &LadspaPluginUI::update_control_display), cui));
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun(*this, &GenericPluginUI::update_control_display), cui));
}
}
void
LadspaPluginUI::update_control_display (ControlUI* cui)
GenericPluginUI::update_control_display (ControlUI* cui)
{
/* XXX how do we handle logarithmic stuff here ? */
@ -646,7 +648,7 @@ LadspaPluginUI::update_control_display (ControlUI* cui)
}
void
LadspaPluginUI::control_port_toggled (ControlUI* cui)
GenericPluginUI::control_port_toggled (ControlUI* cui)
{
if (!cui->ignore_change) {
insert->set_parameter (cui->parameter(), cui->button->get_active());
@ -654,7 +656,7 @@ LadspaPluginUI::control_port_toggled (ControlUI* cui)
}
void
LadspaPluginUI::control_combo_changed (ControlUI* cui)
GenericPluginUI::control_combo_changed (ControlUI* cui)
{
if (!cui->ignore_change) {
string value = cui->combo->get_active_text();
@ -665,9 +667,9 @@ LadspaPluginUI::control_combo_changed (ControlUI* cui)
}
void
LadspaPluginUI::processor_active_changed (boost::weak_ptr<Processor> weak_processor)
GenericPluginUI::processor_active_changed (boost::weak_ptr<Processor> weak_processor)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &LadspaPluginUI::processor_active_changed), weak_processor));
ENSURE_GUI_THREAD(bind (mem_fun(*this, &GenericPluginUI::processor_active_changed), weak_processor));
boost::shared_ptr<Processor> processor = weak_processor.lock();
@ -675,18 +677,18 @@ LadspaPluginUI::processor_active_changed (boost::weak_ptr<Processor> weak_proces
}
bool
LadspaPluginUI::start_updating (GdkEventAny* ignored)
GenericPluginUI::start_updating (GdkEventAny* ignored)
{
if (output_controls.size() > 0 ) {
screen_update_connection.disconnect();
screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect
(mem_fun(*this, &LadspaPluginUI::output_update));
(mem_fun(*this, &GenericPluginUI::output_update));
}
return false;
}
bool
LadspaPluginUI::stop_updating (GdkEventAny* ignored)
GenericPluginUI::stop_updating (GdkEventAny* ignored)
{
if (output_controls.size() > 0 ) {
screen_update_connection.disconnect();
@ -695,7 +697,7 @@ LadspaPluginUI::stop_updating (GdkEventAny* ignored)
}
void
LadspaPluginUI::output_update ()
GenericPluginUI::output_update ()
{
for (vector<ControlUI*>::iterator i = output_controls.begin(); i != output_controls.end(); ++i) {
float val = plugin->get_parameter ((*i)->parameter().id());
@ -729,13 +731,17 @@ LadspaPluginUI::output_update ()
}
vector<string>
LadspaPluginUI::setup_scale_values(guint32 port_index, ControlUI* cui)
GenericPluginUI::setup_scale_values(guint32 port_index, ControlUI* cui)
{
vector<string> enums;
boost::shared_ptr<LadspaPlugin> lp = boost::dynamic_pointer_cast<LadspaPlugin> (plugin);
cui->combo_map = new std::map<string, float>;
lrdf_defaults* defaults = lrdf_get_scale_values(lp->unique_id(), port_index);
// FIXME: not all plugins have a numeric unique ID
uint32_t id = atol (lp->unique_id().c_str());
lrdf_defaults* defaults = lrdf_get_scale_values(id, port_index);
if (defaults) {
for (uint32_t i = 0; i < defaults->count; ++i) {
enums.push_back(defaults->items[i].label);

BIN
gtk2_ardour/icons/sae.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -43,10 +43,19 @@ guint Keyboard::delete_but = 3;
guint Keyboard::delete_mod = GDK_SHIFT_MASK;
guint Keyboard::snap_mod = GDK_MOD3_MASK;
uint32_t Keyboard::Control = GDK_CONTROL_MASK;
uint32_t Keyboard::Shift = GDK_SHIFT_MASK;
uint32_t Keyboard::Alt = GDK_MOD1_MASK;
uint32_t Keyboard::Meta;
#ifdef GTKOSX
guint Keyboard::PrimaryModifier = GDK_MOD1_MASK; // Command
guint Keyboard::SecondaryModifier = GDK_MOD5_MASK; // Alt/Option
guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift
guint Keyboard::CopyModifier = GDK_MOD5_MASK; // Alt/Option
guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
#else
guint Keyboard::PrimaryModifier = GDK_CONTROL_MASK; // Control
guint Keyboard::SecondaryModifier = GDK_MOD1_MASK; // Alt/Option
guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift
guint Keyboard::CopyModifier = GDK_CONTROL_MASK;
guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
#endif
Keyboard* Keyboard::_the_keyboard = 0;
Gtk::Window* Keyboard::current_window = 0;
@ -82,17 +91,11 @@ Keyboard::Keyboard ()
RelevantModifierKeyMask = (GdkModifierType) gtk_accelerator_get_default_mod_mask ();
/* figure out Meta */
uint32_t possible_meta[] = { GDK_MOD2_MASK, GDK_MOD3_MASK, GDK_MOD4_MASK, GDK_MOD5_MASK, 0};
int i;
for (i = 0; possible_meta[i]; ++i) {
if (!(RelevantModifierKeyMask & possible_meta[i])) {
break;
}
}
Meta = possible_meta[i];
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | PrimaryModifier);
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | SecondaryModifier);
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | TertiaryModifier);
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | CopyModifier);
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | RangeSelectModifier);
snooper_id = gtk_key_snooper_install (_snooper, (gpointer) this);
@ -164,6 +167,12 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
{
uint32_t keyval;
#if 0
cerr << "snoop widget " << widget << " key " << event->keyval << " type: " << event->type
<< " state " << std::hex << event->state << std::dec
<< endl;
#endif
#if KBD_DEBUG
if (debug_keyboard) {
cerr << "snoop widget " << widget << " key " << event->keyval << " type: " << event->type
@ -186,7 +195,7 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
if (find (state.begin(), state.end(), keyval) == state.end()) {
state.push_back (keyval);
sort (state.begin(), state.end());
}
}
} else if (event->type == GDK_KEY_RELEASE) {
@ -199,7 +208,7 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
}
if (event->type == GDK_KEY_RELEASE && event->keyval == GDK_w && modifier_state_equals (event->state, Control)) {
if (event->type == GDK_KEY_RELEASE && event->keyval == GDK_w && modifier_state_equals (event->state, PrimaryModifier)) {
if (current_window) {
current_window->hide ();
current_window = 0;
@ -279,15 +288,11 @@ Keyboard::set_delete_modifier (guint mod)
}
void
Keyboard::set_meta_modifier (guint mod)
Keyboard::set_modifier (uint32_t newval, uint32_t& var)
{
/* we don't include Meta in the RelevantModifierKeyMask because its not used
in the same way as snap_mod, delete_mod etc. the only reason we allow it to be
set at all is that X Window has no convention for the keyboard modifier
that Meta should use. Some Linux distributions bind NumLock to Mod2, which
is our default Meta modifier, and this causes severe problems.
*/
Meta = mod;
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~var);
var = newval;
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | var);
}
void
@ -346,9 +351,9 @@ Keyboard::selection_type (guint state)
{
/* note that there is no modifier for "Add" */
if (modifier_state_equals (state, Shift)) {
if (modifier_state_equals (state, RangeSelectModifier)) {
return Selection::Extend;
} else if (modifier_state_equals (state, Control)) {
} else if (modifier_state_equals (state, PrimaryModifier)) {
return Selection::Toggle;
} else {
return Selection::Set;

View file

@ -46,10 +46,27 @@ class Keyboard : public sigc::trackable, PBD::Stateful
typedef vector<uint32_t> State;
typedef uint32_t ModifierMask;
static uint32_t Control;
static uint32_t Shift;
static uint32_t Alt;
static uint32_t Meta;
static uint32_t PrimaryModifier;
static uint32_t SecondaryModifier;
static uint32_t TertiaryModifier;
static uint32_t CopyModifier;
static uint32_t RangeSelectModifier;
static void set_primary_modifier (uint32_t newval) {
set_modifier (newval, PrimaryModifier);
}
static void set_secondary_modifier (uint32_t newval) {
set_modifier (newval, SecondaryModifier);
}
static void set_tertiary_modifier (uint32_t newval) {
set_modifier (newval, TertiaryModifier);
}
static void set_copy_modifier (uint32_t newval) {
set_modifier (newval, CopyModifier);
}
static void set_range_select_modifier (uint32_t newval) {
set_modifier (newval, RangeSelectModifier);
}
bool key_is_down (uint32_t keyval);
@ -69,8 +86,6 @@ class Keyboard : public sigc::trackable, PBD::Stateful
static bool no_modifiers_active (guint state);
static void set_meta_modifier (guint);
static void set_snap_modifier (guint);
static ModifierMask snap_modifier () { return ModifierMask (snap_mod); }
@ -110,6 +125,8 @@ class Keyboard : public sigc::trackable, PBD::Stateful
static gint _snooper (GtkWidget*, GdkEventKey*, gpointer);
gint snooper (GtkWidget*, GdkEventKey*);
static void set_modifier (uint32_t newval, uint32_t& variable);
static bool _some_magic_widget_has_focus;
};

View file

@ -1,11 +1,14 @@
#include <map>
#include <ardour/profile.h>
#include <gtkmm/stock.h>
#include <gtkmm/accelkey.h>
#include <gtkmm/accelmap.h>
#include <gtkmm/uimanager.h>
#include <pbd/strsplit.h>
#include <pbd/replace_all.h>
#include "actions.h"
#include "keyboard.h"
@ -16,6 +19,7 @@
using namespace std;
using namespace Gtk;
using namespace Gdk;
using namespace PBD;
KeyEditor::KeyEditor ()
: ArdourDialog (_("Keybinding Editor"), false)
@ -31,11 +35,11 @@ KeyEditor::KeyEditor ()
view.set_headers_visible (true);
view.get_selection()->set_mode (SELECTION_SINGLE);
view.set_reorderable (false);
view.set_size_request (300,200);
view.set_size_request (500,300);
view.set_enable_search (false);
view.set_rules_hint (true);
view.set_name (X_("KeyEditorTree"));
view.get_selection()->signal_changed().connect (mem_fun (*this, &KeyEditor::action_selected));
scroller.add (view);
@ -78,7 +82,7 @@ KeyEditor::on_key_press_event (GdkEventKey* ev)
bool
KeyEditor::on_key_release_event (GdkEventKey* ev)
{
if (!can_bind || ev->state != last_state) {
if (ARDOUR::Profile->get_sae() || !can_bind || ev->state != last_state) {
return false;
}
@ -137,7 +141,7 @@ KeyEditor::populate ()
model->clear ();
for (l = labels.begin(), k = keys.begin(), p = paths.begin(); l != labels.end(); ++k, ++p, ++l) {
TreeModel::Row row;
vector<string> parts;
@ -178,7 +182,16 @@ KeyEditor::populate ()
if (*k == ActionManager::unbound_string) {
row[columns.binding] = string();
} else {
#ifdef GTKOSX
string label = (*k);
replace_all (label, "<Mod5>", _("Command-"));
replace_all (label, "<Alt>", _("Option-"));
replace_all (label, "<Shift>", _("Shift-"));
row[columns.binding] = label;
#else
row[columns.binding] = (*k);
#endif
}
}
}

View file

@ -25,6 +25,7 @@
#include <ardour/session.h>
#include <ardour/session_route.h>
#include <ardour/dB.h>
#include <ardour/meter.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/fastmeter.h>
@ -43,7 +44,6 @@
#include <ardour/session.h>
#include <ardour/route.h>
#include <ardour/meter.h>
#include "i18n.h"
@ -146,12 +146,10 @@ LevelMeter::setup_meters (int len)
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
switch (r->meter_point()) {
case MeterPreFader:
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;

View file

@ -678,6 +678,11 @@ LocationUI::~LocationUI()
{
}
void LocationUI::on_show()
{
ArdourDialog::on_show();
refresh_location_list();
}
gint LocationUI::do_location_remove (ARDOUR::Location *loc)
@ -856,6 +861,9 @@ LocationUI::refresh_location_list ()
ENSURE_GUI_THREAD(mem_fun(*this, &LocationUI::refresh_location_list));
using namespace Box_Helpers;
// this is just too expensive to do when window is not shown
if (!is_visible()) return;
BoxList & loc_children = location_rows.children();
BoxList & range_children = range_rows.children();

View file

@ -145,6 +145,8 @@ class LocationUI : public ArdourDialog
void set_session (ARDOUR::Session *);
void on_show();
private:
ARDOUR::LocationStack* locations;

View file

@ -23,6 +23,7 @@
#include <gtkmm/settings.h>
#include <pbd/error.h>
#include <pbd/file_utils.h>
#include <pbd/textreceiver.h>
#include <pbd/failed_constructor.h>
#include <pbd/pthread_utils.h>
@ -33,13 +34,15 @@
#include <ardour/ardour.h>
#include <ardour/audioengine.h>
#include <ardour/session_utils.h>
#include <ardour/filesystem_paths.h>
#include <gtkmm/main.h>
#include <gtkmm2ext/popup.h>
#include <gtkmm2ext/utils.h>
#include "svn_revision.h"
#include "../svn_revision.h"
#include "version.h"
#include "utils.h"
#include "ardour_ui.h"
#include "opts.h"
#include "enums.h"
@ -222,6 +225,63 @@ fixup_bundle_environment ()
#endif
static void
setup_keybindings (ARDOUR_UI* ui)
{
Glib::ustring path;
if (keybindings_path.empty()) {
keybindings_path = "ardour";
}
std::string kbpath;
if (keybindings_path.find (".bindings") == string::npos) {
// just a style name - allow user to
// specify the layout type.
char* layout;
if ((layout = getenv ("ARDOUR_KEYBOARD_LAYOUT")) != 0) {
keybindings_path += '-';
keybindings_path += layout;
}
keybindings_path += ".bindings";
}
// XXX timbyr - we need a portable test for "is-absolute" here
if (keybindings_path[0] != '/' && keybindings_path[0] != '.') {
/* not absolute - look in the usual places */
sys::path key_bindings_file;
find_file_in_search_path (ardour_search_path() + system_config_search_path(),
keybindings_path, key_bindings_file);
path = key_bindings_file.to_string();
if (path.empty()) {
warning << string_compose (_("Key bindings file \"%1\" not found. Default bindings used instead"),
keybindings_path) << endmsg;
}
} else {
// absolute path from user - use it as is
path = keybindings_path;
}
if (!path.empty()) {
ui->set_keybindings_path (path);
}
}
#ifdef VST_SUPPORT
/* this is called from the entry point of a wine-compiled
executable that is linked against gtk2_ardour built
@ -310,9 +370,7 @@ int main (int argc, char *argv[])
}
}
if (!keybindings_path.empty()) {
ui->set_keybindings_path (keybindings_path);
}
setup_keybindings (ui);
ui->run (text_receiver);
ui = 0;

View file

@ -33,7 +33,7 @@ using namespace ARDOUR;
Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, const string& annotation,
Type type, nframes_t frame, bool handle_events)
: editor (ed), _type(type)
: editor (ed), _parent(&parent), _type(type)
{
double label_offset = 0;
bool annotate_left = false;
@ -273,6 +273,7 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
}
Marker::~Marker ()
{
drop_references ();
@ -288,6 +289,21 @@ Marker::~Marker ()
}
}
void Marker::reparent(ArdourCanvas::Group & parent)
{
group->reparent(parent);
_parent = &parent;
}
void
Marker::set_line_length (double len)
{
if (line) {
line_points->back().set_y (len);
line->property_points() = *line_points;
}
}
void
Marker::add_line (ArdourCanvas::Group* group, double initial_height)
{
@ -301,12 +317,13 @@ Marker::add_line (ArdourCanvas::Group* group, double initial_height)
line->property_width_pixels() = 1;
line->property_points() = *line_points;
line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EditPoint.get();
#if 0
line->property_first_arrowhead() = TRUE;
line->property_last_arrowhead() = TRUE;
line->property_arrow_shape_a() = 11.0;
line->property_arrow_shape_b() = 0.0;
line->property_arrow_shape_c() = 9.0;
#endif
line->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this));
}
@ -383,6 +400,7 @@ void
Marker::set_color_rgba (uint32_t color)
{
mark->property_fill_color_rgba() = color;
mark->property_outline_color_rgba() = color;
}
/***********************************************************************/

View file

@ -60,6 +60,7 @@ class Marker : public PBD::Destructible
void add_line (ArdourCanvas::Group*, double initial_height);
void show_line ();
void hide_line ();
void set_line_length (double);
void set_position (nframes_t);
void set_name (const string&);
@ -67,14 +68,18 @@ class Marker : public PBD::Destructible
nframes64_t position() const { return frame_position; }
ArdourCanvas::Group * get_parent() { return _parent; }
void reparent (ArdourCanvas::Group & parent);
void hide ();
void show ();
Type type () { return _type; }
protected:
PublicEditor& editor;
ArdourCanvas::Group * _parent;
ArdourCanvas::Group *group;
ArdourCanvas::Polygon *mark;
ArdourCanvas::Text *text;

View file

@ -41,6 +41,7 @@
#include <ardour/panner.h>
#include <ardour/send.h>
#include <ardour/processor.h>
#include <ardour/profile.h>
#include <ardour/ladspa_plugin.h>
#include <ardour/auto_bundle.h>
#include <ardour/user_bundle.h>
@ -448,10 +449,6 @@ MixerStrip::set_width (Width w, void* owner)
_width_owner = owner;
if (_width == w) {
return;
}
ensure_xml_node ();
_width = w;
@ -819,12 +816,14 @@ void
MixerStrip::input_changed (IOChange change, void *src)
{
Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &MixerStrip::update_input_display));
set_width(_width, this);
}
void
MixerStrip::output_changed (IOChange change, void *src)
{
Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &MixerStrip::update_output_display));
set_width(_width, this);
}
@ -1056,7 +1055,9 @@ MixerStrip::build_route_ops_menu ()
build_remote_control_menu ();
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
}
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
@ -1297,5 +1298,6 @@ MixerStrip::meter_changed (void *src)
}
gpm.setup_meters ();
set_width(_width, this);
}

View file

@ -422,7 +422,7 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
if (_selection.selected (strip->route())) {
_selection.remove (strip->route());
} else {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
_selection.add (strip->route());
} else {
_selection.set (strip->route());

View file

@ -344,10 +344,6 @@ NewSessionDialog::NewSessionDialog()
open_session_vbox->pack_start(*open_session_hbox, Gtk::PACK_SHRINK, 12);
m_notebook->set_flags(Gtk::CAN_FOCUS);
m_notebook->set_scrollable(true);
m_notebook->append_page(*new_session_table, _("New Session"));
m_notebook->pages().back().set_tab_label_packing(false, true, Gtk::PACK_START);
m_notebook->append_page(*open_session_vbox, _("Open Session"));
m_notebook->pages().back().set_tab_label_packing(false, true, Gtk::PACK_START);
get_vbox()->set_homogeneous(false);
get_vbox()->set_spacing(0);
get_vbox()->pack_start(*m_notebook, Gtk::PACK_SHRINK, 0);
@ -430,6 +426,8 @@ NewSessionDialog::NewSessionDialog()
m_open_filechooser->signal_selection_changed ().connect (mem_fun (*this, &NewSessionDialog::file_chosen));
m_template->signal_selection_changed ().connect (mem_fun (*this, &NewSessionDialog::template_chosen));
m_name->grab_focus();
page_set = Pages (0);
}
NewSessionDialog::~NewSessionDialog()
@ -437,32 +435,74 @@ NewSessionDialog::~NewSessionDialog()
in_destructor = true;
}
int
NewSessionDialog::run ()
{
if (!page_set) {
/* nothing to display */
return Gtk::RESPONSE_OK;
}
return ArdourDialog::run ();
}
void
NewSessionDialog::set_have_engine (bool yn)
{
if (yn) {
m_notebook->remove_page (engine_control);
} else {
// XXX this is a bit of crude hack. if we ever add or remove
// pages from the notebook, this is going to break.
if (m_notebook->get_n_pages () != 3) {
m_notebook->append_page (engine_control, _("Audio Setup"));
m_notebook->show_all_children();
}
}
if (yn) {
m_notebook->remove_page (engine_control);
page_set = Pages (page_set & ~EnginePage);
} else {
if (!(page_set & EnginePage)) {
m_notebook->append_page (engine_control, _("Audio Setup"));
m_notebook->show_all_children();
page_set = Pages (page_set | EnginePage);
}
}
}
void
NewSessionDialog::set_session_name(const Glib::ustring& name)
NewSessionDialog::set_existing_session (bool yn)
{
m_name->set_text(name);
if (yn) {
if (page_set & NewPage) {
m_notebook->remove_page (*new_session_table);
page_set = Pages (page_set & ~NewPage);
}
if (page_set & OpenPage) {
m_notebook->remove_page (*open_session_vbox);
page_set = Pages (page_set & ~OpenPage);
}
} else {
if (!(page_set & NewPage)) {
m_notebook->append_page(*new_session_table, _("New Session"));
m_notebook->pages().back().set_tab_label_packing(false, true, Gtk::PACK_START);
page_set = Pages (page_set | NewPage);
}
if (!(page_set & OpenPage)) {
m_notebook->append_page(*open_session_vbox, _("Open Session"));
m_notebook->pages().back().set_tab_label_packing(false, true, Gtk::PACK_START);
page_set = Pages (page_set | OpenPage);
}
m_notebook->show_all_children();
}
}
void
NewSessionDialog::set_session_name (const Glib::ustring& name)
{
m_name->set_text (name);
}
void
NewSessionDialog::set_session_folder(const Glib::ustring& dir)
{
// XXX DO SOMETHING
m_folder->set_current_folder (dir);
}
std::string
@ -682,7 +722,8 @@ NewSessionDialog::file_chosen ()
m_treeview->get_selection()->unselect_all();
get_window()->set_cursor(Gdk::Cursor(Gdk::WATCH));
if (get_window())
get_window()->set_cursor(Gdk::Cursor(Gdk::WATCH));
if (!m_open_filechooser->get_filename().empty()) {
set_response_sensitive (Gtk::RESPONSE_OK, true);

View file

@ -57,6 +57,8 @@ public:
NewSessionDialog();
~NewSessionDialog ();
int run ();
void set_session_name(const Glib::ustring& name);
void set_session_folder(const Glib::ustring& folder);
@ -95,6 +97,7 @@ public:
EngineControl engine_control;
void set_have_engine (bool yn);
void set_existing_session (bool yn);
protected:
@ -167,6 +170,14 @@ protected:
Gtk::Notebook* m_notebook;
private:
enum Pages {
NewPage = 0x1,
OpenPage = 0x2,
EnginePage = 0x4
};
Pages page_set;
struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
RecentSessionModelColumns() {
add (visible_name);

View file

@ -1079,6 +1079,23 @@ static const struct {
const char *name;
guint modifier;
} modifiers[] = {
#ifdef GTKOSX
/* Command = Mod1
Option/Alt = Mod5
*/
{ "Shift", GDK_SHIFT_MASK },
{ "Command", GDK_MOD1_MASK },
{ "Control", GDK_CONTROL_MASK },
{ "Option", GDK_MOD5_MASK },
{ "Command-Shift", GDK_MOD1_MASK|GDK_SHIFT_MASK },
{ "Command-Option", GDK_MOD1_MASK|GDK_MOD5_MASK },
{ "Shift-Option", GDK_SHIFT_MASK|GDK_MOD5_MASK },
{ "Shift-Command-Option", GDK_MOD5_MASK|GDK_SHIFT_MASK|GDK_MOD1_MASK },
#else
{ "Shift", GDK_SHIFT_MASK },
{ "Control", GDK_CONTROL_MASK },
{ "Alt (Mod1)", GDK_MOD1_MASK },
@ -1090,6 +1107,7 @@ static const struct {
{ "Mod3", GDK_MOD3_MASK },
{ "Mod4", GDK_MOD4_MASK },
{ "Mod5", GDK_MOD5_MASK },
#endif
{ 0, 0 }
};

View file

@ -21,6 +21,8 @@
#include <iostream>
#include <cstdlib>
#include <ardour/session.h>
#include "opts.h"
#include "i18n.h"
@ -38,6 +40,7 @@ char* ARDOUR_COMMAND_LINE::curvetest_file = 0;
bool ARDOUR_COMMAND_LINE::try_hw_optimization = true;
string ARDOUR_COMMAND_LINE::keybindings_path = ""; /* empty means use builtin default */
Glib::ustring ARDOUR_COMMAND_LINE::menus_file = "ardour.menus";
bool ARDOUR_COMMAND_LINE::finder_invoked_ardour = false;
using namespace ARDOUR_COMMAND_LINE;
@ -48,8 +51,9 @@ print_help (const char *execname)
<< _(" -v, --version Show version information\n")
<< _(" -h, --help Print this message\n")
<< _(" -b, --bindings Print all possible keyboard binding names\n")
<< _(" -n, --show-splash Show splash screen\n")
<< _(" -c, --name name Use a specific jack client name, default is ardour\n")
<< _(" -d, --disable-plugins Disable all plugins in an existing session\n")
<< _(" -n, --show-splash Show splash screen\n")
<< _(" -m, --menus file Use \"file\" for Ardour menus\n")
<< _(" -N, --new session-name Create a new session from the command line\n")
<< _(" -O, --no-hw-optimizations Disable h/w specific optimizations\n")
@ -69,11 +73,12 @@ int
ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{
const char *optstring = "U:hSbvVnOc:C:m:N:k:";
const char *optstring = "U:hSbvVnOdc:C:m:N:k:p:";
const char *execname = strrchr (argv[0], '/');
if (getenv ("ARDOUR_SAE")) {
menus_file = "ardour-sae.menus";
keybindings_path = "ardour-sae";
}
if (execname == 0) {
@ -122,6 +127,10 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
case 'b':
show_key_actions = true;
break;
case 'd':
ARDOUR::Session::set_disable_all_loaded_plugins (true);
break;
case 'm':
@ -131,6 +140,11 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
case 'n':
no_splash = false;
break;
case 'p':
//undocumented OS X finder -psn_XXXXX argument
finder_invoked_ardour = true;
break;
case 'S':
// ; just pass this through to gtk it will figure it out
@ -144,11 +158,6 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
case 'O':
try_hw_optimization = false;
break;
case 'p':
//undocumented OS X finder -psn_XXXXX argument
break;
case 'V':
#ifdef VST_SUPPORT

View file

@ -39,6 +39,7 @@ extern bool try_hw_optimization;
extern bool use_gtk_theme;
extern string keybindings_path;
extern Glib::ustring menus_file;
extern bool finder_invoked_ardour;
extern int32_t parse_opts (int argc, char *argv[]);

View file

@ -534,7 +534,7 @@ Panner2d::on_button_release_event (GdkEventButton *ev)
y = (int) floor (ev->y);
state = (GdkModifierType) ev->state;
if (drag_is_puck && (Keyboard::modifier_state_contains (state, Keyboard::Shift))) {
if (drag_is_puck && (Keyboard::modifier_state_contains (state, Keyboard::TertiaryModifier))) {
for (Targets::iterator i = pucks.begin(); i != pucks.end(); ++i) {
Target* puck = i->second;

View file

@ -65,20 +65,20 @@ PluginSelector::PluginSelector (PluginManager *mgr)
manager = mgr;
session = 0;
current_selection = ARDOUR::LADSPA;
lmodel = Gtk::ListStore::create(lcols);
ladspa_display.set_model (lmodel);
ladspa_display.append_column (_("Available LADSPA Plugins"), lcols.name);
ladspa_display.append_column (_("Type"), lcols.type);
ladspa_display.append_column (_("# Inputs"),lcols.ins);
ladspa_display.append_column (_("# Outputs"), lcols.outs);
ladspa_display.set_headers_visible (true);
ladspa_display.set_headers_clickable (true);
ladspa_display.set_reorderable (false);
lscroller.set_border_width(10);
lscroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
lscroller.add(ladspa_display);
plugin_model = Gtk::ListStore::create (plugin_columns);
plugin_display.set_model (plugin_model);
plugin_display.append_column (_("Available Plugins"), plugin_columns.name);
plugin_display.append_column (_("Type"), plugin_columns.type_name);
plugin_display.append_column (_("Category"), plugin_columns.category);
plugin_display.append_column (_("Creator"), plugin_columns.creator);
plugin_display.append_column (_("# Inputs"),plugin_columns.ins);
plugin_display.append_column (_("# Outputs"), plugin_columns.outs);
plugin_display.set_headers_visible (true);
plugin_display.set_headers_clickable (true);
plugin_display.set_reorderable (false);
scroller.set_border_width(10);
scroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
scroller.add(plugin_display);
amodel = Gtk::ListStore::create(acols);
added_list.set_model (amodel);
@ -87,48 +87,10 @@ PluginSelector::PluginSelector (PluginManager *mgr)
added_list.set_reorderable (false);
for (int i = 0; i <=3; i++) {
Gtk::TreeView::Column* column = ladspa_display.get_column(i);
Gtk::TreeView::Column* column = plugin_display.get_column(i);
column->set_sort_column(i);
}
#ifdef VST_SUPPORT
vmodel = ListStore::create(vcols);
vst_display.set_model (vmodel);
vst_display.append_column (_("Available plugins"), vcols.name);
vst_display.append_column (_("# Inputs"), vcols.ins);
vst_display.append_column (_("# Outputs"), vcols.outs);
vst_display.set_headers_visible (true);
vst_display.set_headers_clickable (true);
vst_display.set_reorderable (false);
vscroller.set_border_width(10);
vscroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
vscroller.add(vst_display);
for (int i = 0; i <=2; i++) {
Gtk::TreeView::Column* column = vst_display.get_column(i);
column->set_sort_column(i);
}
#endif
#ifdef HAVE_AUDIOUNIT
aumodel = ListStore::create(aucols);
au_display.set_model (aumodel);
au_display.append_column (_("Available plugins"), aucols.name);
au_display.append_column (_("# Inputs"), aucols.ins);
au_display.append_column (_("# Outputs"), aucols.outs);
au_display.set_headers_visible (true);
au_display.set_headers_clickable (true);
au_display.set_reorderable (false);
auscroller.set_border_width(10);
auscroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
auscroller.add(au_display);
for (int i = 0; i <=2; i++) {
Gtk::TreeView::Column* column = au_display.get_column(i);
column->set_sort_column(i);
}
#endif
ascroller.set_border_width(10);
ascroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
ascroller.add(added_list);
@ -146,7 +108,7 @@ PluginSelector::PluginSelector (PluginManager *mgr)
Gtk::Table* table = manage(new Gtk::Table(7, 11));
table->set_size_request(750, 500);
table->attach(notebook, 0, 7, 0, 5);
table->attach(scroller, 0, 7, 0, 5);
HBox* filter_box = manage (new HBox);
@ -176,98 +138,26 @@ PluginSelector::PluginSelector (PluginManager *mgr)
table->attach(ascroller, 0, 7, 8, 10);
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (Stock::CONNECT, RESPONSE_APPLY);
add_button (_("Insert Plugin(s)"), RESPONSE_APPLY);
set_default_response (RESPONSE_APPLY);
set_response_sensitive (RESPONSE_APPLY, false);
get_vbox()->pack_start (*table);
// Notebook tab order must be the same in here as in set_correct_focus()
using namespace Notebook_Helpers;
notebook.pages().push_back (TabElem (lscroller, _("LADSPA")));
#ifdef VST_SUPPORT
if (Config->get_use_vst()) {
notebook.pages().push_back (TabElem (vscroller, _("VST")));
}
#endif
#ifdef HAVE_AUDIOUNIT
notebook.pages().push_back (TabElem (auscroller, _("AudioUnit")));
#endif
table->set_name("PluginSelectorTable");
ladspa_display.set_name("PluginSelectorDisplay");
//ladspa_display.set_name("PluginSelectorList");
plugin_display.set_name("PluginSelectorDisplay");
//plugin_display.set_name("PluginSelectorList");
added_list.set_name("PluginSelectorList");
ladspa_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
ladspa_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::ladspa_display_selection_changed));
ladspa_display.grab_focus();
plugin_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
plugin_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::display_selection_changed));
plugin_display.grab_focus();
#ifdef VST_SUPPORT
if (Config->get_use_vst()) {
vst_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
vst_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::vst_display_selection_changed));
}
#endif
#ifdef HAVE_AUDIOUNIT
au_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
au_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::au_display_selection_changed));
#endif
btn_update->signal_clicked().connect (mem_fun(*this, &PluginSelector::btn_update_clicked));
btn_add->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_add_clicked));
btn_remove->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_remove_clicked));
added_list.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::added_list_selection_changed));
ladspa_refiller ();
#ifdef VST_SUPPORT
vst_refiller ();
#endif
#ifdef HAVE_AUDIOUNIT
au_refiller ();
#endif
signal_show().connect (mem_fun (*this, &PluginSelector::set_correct_focus));
}
/**
* Makes sure keyboard focus is always in the plugin list
* of the selected notebook tab.
**/
void
PluginSelector::set_correct_focus()
{
int cp = notebook.get_current_page();
if (cp == 0) {
ladspa_display.grab_focus();
return;
}
#ifdef VST_SUPPORT
if (Config->get_use_vst()) {
cp--;
if (cp == 0) {
vst_display.grab_focus();
return;
}
}
#endif
#ifdef HAVE_AUDIOUNIT
cp--;
if (cp == 0) {
au_display.grab_focus();
return;
}
#endif
refill ();
}
void
@ -290,7 +180,7 @@ PluginSelector::set_session (Session* s)
}
bool
PluginSelector::show_this_plugin (PluginInfoPtr& info, const std::string& filterstr)
PluginSelector::show_this_plugin (const PluginInfoPtr& info, const std::string& filterstr)
{
std::string compstr;
std::string mode = filter_mode.get_active_text ();
@ -328,125 +218,84 @@ PluginSelector::setup_filter_string (string& filterstr)
}
void
PluginSelector::ladspa_refiller ()
PluginSelector::refill ()
{
guint row;
PluginInfoList &plugs = manager->ladspa_plugin_info ();
PluginInfoList::iterator i;
char ibuf[16], obuf[16];
lmodel->clear();
std::string filterstr;
plugin_model->clear ();
setup_filter_string (filterstr);
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
if (show_this_plugin (*i, filterstr)) {
snprintf (ibuf, sizeof(ibuf)-1, "%u", (*i)->n_inputs.n_total());
snprintf (obuf, sizeof(obuf)-1, "%u", (*i)->n_outputs.n_total());
TreeModel::Row newrow = *(lmodel->append());
newrow[lcols.name] = (*i)->name.c_str();
newrow[lcols.type] = (*i)->category.c_str();
newrow[lcols.ins] = ibuf;
newrow[lcols.outs] = obuf;
newrow[lcols.plugin] = *i;
}
}
lmodel->set_sort_column (0, SORT_ASCENDING);
ladspa_refiller (filterstr);
vst_refiller (filterstr);
au_refiller (filterstr);
}
void
PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filterstr, const char* type)
{
char buf[16];
for (PluginInfoList::const_iterator i = plugs.begin(); i != plugs.end(); ++i) {
if (show_this_plugin (*i, filterstr)) {
TreeModel::Row newrow = *(plugin_model->append());
newrow[plugin_columns.name] = (*i)->name;
newrow[plugin_columns.type_name] = type;
newrow[plugin_columns.category] = (*i)->category;
string creator = (*i)->creator;
string::size_type pos = 0;
/* stupid LADSPA creator strings */
while (pos < creator.length() && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
creator = creator.substr (0, pos);
newrow[plugin_columns.creator] = creator;
if ((*i)->n_inputs.n_total() < 0) {
newrow[plugin_columns.ins] = "various";
} else {
snprintf (buf, sizeof(buf), "%d", (*i)->n_inputs.n_total());
newrow[plugin_columns.ins] = buf;
}
if ((*i)->n_outputs.n_total() < 0) {
newrow[plugin_columns.outs] = "various";
} else {
snprintf (buf, sizeof(buf), "%d", (*i)->n_outputs.n_total());
newrow[plugin_columns.outs] = buf;
}
newrow[plugin_columns.plugin] = *i;
}
}
}
void
PluginSelector::ladspa_refiller (const std::string& filterstr)
{
refiller (manager->ladspa_plugin_info(), filterstr, "LADSPA");
}
void
PluginSelector::vst_refiller (const std::string& filterstr)
{
#ifdef VST_SUPPORT
void
PluginSelector::vst_refiller ()
{
guint row;
PluginInfoList &plugs = manager->vst_plugin_info ();
PluginInfoList::iterator i;
char ibuf[16], obuf[16];
vmodel->clear();
std::string filterstr;
setup_filter_string (filterstr);
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
if (show_this_plugin (*i, filterstr)) {
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs);
TreeModel::Row newrow = *(vmodel->append());
newrow[vcols.name] = (*i)->name.c_str();
newrow[vcols.ins] = ibuf;
newrow[vcols.outs] = obuf;
newrow[vcols.plugin] = *i;
}
}
vmodel->set_sort_column (0, SORT_ASCENDING);
refiller (manager->vst_plugin_info(), filterstr, "VST");
#endif
}
void
PluginSelector::vst_display_selection_changed()
PluginSelector::au_refiller (const std::string& filterstr)
{
if (vst_display.get_selection()->count_selected_rows() != 0) {
btn_add->set_sensitive (true);
} else {
btn_add->set_sensitive (false);
}
current_selection = ARDOUR::VST;
#ifdef HAVE_AUDIOUNITS
refiller (manager->au_plugin_info(), filterstr, "AU");
#endif
}
#endif //VST_SUPPORT
#ifdef HAVE_AUDIOUNIT
void
PluginSelector::au_refiller ()
{
guint row;
PluginInfoList plugs (AUPluginInfo::discover ());
PluginInfoList::iterator i;
char ibuf[16], obuf[16];
aumodel->clear();
std::string filterstr;
setup_filter_string (filterstr);
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
if (show_this_plugin (*i, filterstr)) {
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs);
TreeModel::Row newrow = *(aumodel->append());
newrow[aucols.name] = (*i)->name.c_str();
newrow[aucols.ins] = ibuf;
newrow[aucols.outs] = obuf;
newrow[aucols.plugin] = *i;
}
}
aumodel->set_sort_column (0, SORT_ASCENDING);
}
void
PluginSelector::au_display_selection_changed()
{
if (au_display.get_selection()->count_selected_rows() != 0) {
btn_add->set_sensitive (true);
} else {
btn_add->set_sensitive (false);
}
current_selection = ARDOUR::AudioUnit;
}
#endif //HAVE_AUDIOUNIT
void
PluginSelector::use_plugin (PluginInfoPtr pi)
{
@ -467,33 +316,11 @@ PluginSelector::btn_add_clicked()
std::string name;
PluginInfoPtr pi;
TreeModel::Row newrow = *(amodel->append());
TreeModel::Row row;
switch (current_selection) {
case ARDOUR::LADSPA:
row = *(ladspa_display.get_selection()->get_selected());
name = row[lcols.name];
pi = row[lcols.plugin];
break;
case ARDOUR::VST:
#ifdef VST_SUPPORT
row = *(vst_display.get_selection()->get_selected());
name = row[vcols.name];
pi = row[vcols.plugin];
#endif
break;
case ARDOUR::AudioUnit:
#ifdef HAVE_AUDIOUNIT
row = *(au_display.get_selection()->get_selected());
name = row[aucols.name];
pi = row[aucols.plugin];
#endif
break;
default:
error << "Programming error. Unknown plugin selected." << endmsg;
return;
}
row = *(plugin_display.get_selection()->get_selected());
name = row[plugin_columns.name];
pi = row[plugin_columns.plugin];
newrow[acols.text] = name;
newrow[acols.plugin] = pi;
@ -522,27 +349,13 @@ PluginSelector::btn_update_clicked()
}
void
PluginSelector::refill()
PluginSelector::display_selection_changed()
{
ladspa_refiller ();
#ifdef VST_SUPPORT
vst_refiller ();
#endif
#ifdef HAVE_AUDIOUNIT
au_refiller ();
#endif
}
void
PluginSelector::ladspa_display_selection_changed()
{
if (ladspa_display.get_selection()->count_selected_rows() != 0) {
if (plugin_display.get_selection()->count_selected_rows() != 0) {
btn_add->set_sensitive (true);
} else {
btn_add->set_sensitive (false);
}
current_selection = ARDOUR::LADSPA;
}
void
@ -566,7 +379,8 @@ PluginSelector::run ()
switch (r) {
case RESPONSE_APPLY:
for (i = amodel->children().begin(); i != amodel->children().end(); ++i) {
use_plugin ((*i)[acols.plugin]);
PluginInfoPtr pp = (*i)[acols.plugin];
use_plugin (pp);
}
break;

View file

@ -44,10 +44,7 @@ class PluginSelector : public ArdourDialog
private:
ARDOUR::Session* session;
Gtk::Notebook notebook;
Gtk::ScrolledWindow lscroller; // ladspa
Gtk::ScrolledWindow vscroller; // vst
Gtk::ScrolledWindow auscroller; // AudioUnit
Gtk::ScrolledWindow scroller; // Available plugins
Gtk::ScrolledWindow ascroller; // Added plugins
Gtk::ComboBoxText filter_mode;
@ -58,27 +55,27 @@ class PluginSelector : public ArdourDialog
void filter_entry_changed ();
void filter_mode_changed ();
ARDOUR::PluginType current_selection;
// page 1
struct LadspaColumns : public Gtk::TreeModel::ColumnRecord {
LadspaColumns () {
struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
PluginColumns () {
add (name);
add (type);
add (type_name);
add (category);
add (creator);
add (ins);
add (outs);
add (plugin);
}
Gtk::TreeModelColumn<std::string> name;
Gtk::TreeModelColumn<std::string> type;
Gtk::TreeModelColumn<std::string> name;
Gtk::TreeModelColumn<std::string> type_name;
Gtk::TreeModelColumn<std::string> category;
Gtk::TreeModelColumn<std::string> creator;
Gtk::TreeModelColumn<std::string> ins;
Gtk::TreeModelColumn<std::string> outs;
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
};
LadspaColumns lcols;
Glib::RefPtr<Gtk::ListStore> lmodel;
Glib::RefPtr<Gtk::TreeSelection> lselection;
Gtk::TreeView ladspa_display;
PluginColumns plugin_columns;
Glib::RefPtr<Gtk::ListStore> plugin_model;
Gtk::TreeView plugin_display;
Gtk::Button* btn_add;
Gtk::Button* btn_remove;
@ -92,72 +89,27 @@ class PluginSelector : public ArdourDialog
};
AddedColumns acols;
Glib::RefPtr<Gtk::ListStore> amodel;
Glib::RefPtr<Gtk::TreeSelection> aselection;
Gtk::TreeView added_list;
#ifdef VST_SUPPORT
// page 2
struct VstColumns : public Gtk::TreeModel::ColumnRecord {
VstColumns () {
add (name);
add (ins);
add (outs);
add (plugin);
}
Gtk::TreeModelColumn<std::string> name;
Gtk::TreeModelColumn<std::string> ins;
Gtk::TreeModelColumn<std::string> outs;
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
};
VstColumns vcols;
Glib::RefPtr<Gtk::ListStore> vmodel;
Glib::RefPtr<Gtk::TreeSelection> vselection;
Gtk::TreeView vst_display;
void vst_refiller ();
void vst_display_selection_changed();
#endif // VST_SUPPORT
#ifdef HAVE_AUDIOUNIT
// page 3
struct AUColumns : public Gtk::TreeModel::ColumnRecord {
AUColumns () {
add (name);
add (ins);
add (outs);
add (plugin);
}
Gtk::TreeModelColumn<std::string> name;
Gtk::TreeModelColumn<std::string> ins;
Gtk::TreeModelColumn<std::string> outs;
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
};
AUColumns aucols;
Glib::RefPtr<Gtk::ListStore> aumodel;
Glib::RefPtr<Gtk::TreeSelection> auselection;
Gtk::TreeView au_display;
void au_refiller ();
void au_display_selection_changed();
#endif //HAVE_AUDIOUNIT
void refill ();
void refiller (const ARDOUR::PluginInfoList& plugs, const::std::string& filterstr, const char* type);
void ladspa_refiller (const std::string&);
void vst_refiller (const std::string&);
void au_refiller (const std::string&);
ARDOUR::PluginManager *manager;
static void _ladspa_refiller (void *);
void ladspa_refiller ();
void row_clicked(GdkEventButton *);
void btn_add_clicked();
void btn_remove_clicked();
void btn_update_clicked();
void added_list_selection_changed();
void ladspa_display_selection_changed();
void display_selection_changed();
void btn_apply_clicked();
void use_plugin (ARDOUR::PluginInfoPtr);
void cleanup ();
void refill ();
bool show_this_plugin (ARDOUR::PluginInfoPtr&, const std::string&);
bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
void setup_filter_string (std::string&);
void set_correct_focus();
};
#endif // __ardour_plugin_selector_h__

View file

@ -64,41 +64,42 @@ using namespace sigc;
PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, nframes64_t sr, nframes64_t period, bool scrollable)
: ArdourDialog ("plugin ui")
{
bool have_gui = false;
non_gtk_gui = false;
if (insert->plugin()->has_editor()) {
switch (insert->type()) {
case ARDOUR::VST:
have_gui = create_vst_editor (insert);
break;
#ifdef VST_SUPPORT
case ARDOUR::AudioUnit:
have_gui = create_audiounit_editor (insert);
break;
case ARDOUR::LADSPA:
error << _("Eh? LADSPA plugins don't have editors!") << endmsg;
break;
boost::shared_ptr<VSTPlugin> vp;
if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (insert->plugin())) != 0) {
VSTPluginUI* vpu = new VSTPluginUI (insert, vp, session.frame_rate(), session.engine().frames_per_cycle());
_pluginui = vpu;
get_vbox()->add (*vpu);
vpu->package (*this);
} else {
#endif
default:
error << _("unknown type of editor-supplying plugin (note: no VST support in this version of ardour)")
<< endmsg;
throw failed_constructor ();
#ifdef VST_SUPPORT
}
#endif
} else {
}
LadspaPluginUI* pu = new LadspaPluginUI (insert, sr, period, scrollable);
if (!have_gui) {
GenericPluginUI* pu = new GenericPluginUI (insert, scrollable);
_pluginui = pu;
get_vbox()->add (*pu);
set_wmclass (X_("ardour_plugin_editor"), "Ardour");
signal_map_event().connect (mem_fun (*pu, &LadspaPluginUI::start_updating));
signal_unmap_event().connect (mem_fun (*pu, &LadspaPluginUI::stop_updating));
signal_map_event().connect (mem_fun (*pu, &GenericPluginUI::start_updating));
signal_unmap_event().connect (mem_fun (*pu, &GenericPluginUI::stop_updating));
}
set_position (Gtk::WIN_POS_MOUSE);
@ -108,21 +109,87 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, nframes6
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)));
insert->GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away));
gint h = _pluginui->get_preferred_height ();
gint w = _pluginui->get_preferred_width ();
if (scrollable) {
gint h = _pluginui->get_preferred_height ();
if (h > 600) h = 600;
set_default_size (450, h);
if (w > 600) w = 600;
if (w < 0) {
w = 450;
}
}
set_default_size (w, h);
}
PluginUIWindow::~PluginUIWindow ()
{
}
bool
PluginUIWindow::create_vst_editor(boost::shared_ptr<PluginInsert> insert)
{
#ifndef VST_SUPPORT
return false;
#else
boost::shared_ptr<VSTPlugin> vp;
if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (insert->plugin())) == 0) {
error << _("unknown type of editor-supplying plugin (note: no VST support in this version of ardour)")
<< endmsg;
throw failed_constructor ();
} else {
VSTPluginUI* vpu = new VSTPluginUI (insert, vp);
_pluginui = vpu;
get_vbox()->add (*vpu);
vpu->package (*this);
}
non_gtk_gui = true;
return true;
#endif
}
bool
PluginUIWindow::create_audiounit_editor (boost::shared_ptr<PluginInsert> insert)
{
#if !defined(HAVE_AUDIOUNITS) || !defined(GTKOSX)
return false;
#else
VBox* box;
_pluginui = create_au_gui (insert, &box);
get_vbox()->add (*box);
non_gtk_gui = true;
extern sigc::signal<void,bool> ApplicationActivationChanged;
ApplicationActivationChanged.connect (mem_fun (*this, &PluginUIWindow::app_activated));
return true;
#endif
}
void
PluginUIWindow::app_activated (bool yn)
{
#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX)
if (yn) {
_pluginui->activate ();
}
cerr << "activated ? " << yn << endl;
#endif
}
bool
PluginUIWindow::on_key_press_event (GdkEventKey* event)
{
if (non_gtk_gui) {
return false;
}
if (!key_press_focus_accelerator_handler (*this, event)) {
return PublicEditor::instance().on_key_press_event(event);
} else {
@ -145,12 +212,12 @@ PluginUIWindow::plugin_going_away ()
delete_when_idle (this);
}
PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi, nframes64_t sr, nframes64_t period)
PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
: insert (pi),
plugin (insert->plugin()),
save_button(_("Add")),
bypass_button (_("Bypass")),
latency_gui (*pi, sr, period)
latency_gui (*pi, pi->session().frame_rate(), pi->session().get_block_size())
{
//combo.set_use_arrows_always(true);
set_popdown_strings (combo, plugin->get_presets());

View file

@ -68,12 +68,16 @@ namespace Gtkmm2ext {
class PlugUIBase : public virtual sigc::trackable
{
public:
PlugUIBase (boost::shared_ptr<ARDOUR::PluginInsert>, nframes64_t sample_rate, nframes64_t period_size);
PlugUIBase (boost::shared_ptr<ARDOUR::PluginInsert>);
virtual ~PlugUIBase() {}
virtual gint get_preferred_height () = 0;
virtual gint get_preferred_width () = 0;
virtual bool start_updating(GdkEventAny*) = 0;
virtual bool stop_updating(GdkEventAny*) = 0;
virtual void activate () {}
virtual void deactivate () {}
protected:
boost::shared_ptr<ARDOUR::PluginInsert> insert;
@ -88,14 +92,15 @@ class PlugUIBase : public virtual sigc::trackable
void bypass_toggled();
};
class LadspaPluginUI : public PlugUIBase, public Gtk::VBox
class GenericPluginUI : public PlugUIBase, public Gtk::VBox
{
public:
LadspaPluginUI (boost::shared_ptr<ARDOUR::PluginInsert> plug, nframes64_t sample_rate, nframes64_t period_size, bool scrollable = false);
~LadspaPluginUI ();
GenericPluginUI (boost::shared_ptr<ARDOUR::PluginInsert> plug, bool scrollable=false);
~GenericPluginUI ();
gint get_preferred_height () { return prefheight; }
gint get_preferred_width () { return -1; }
bool start_updating(GdkEventAny*);
bool stop_updating(GdkEventAny*);
@ -210,7 +215,12 @@ class PluginUIWindow : public ArdourDialog
private:
PlugUIBase* _pluginui;
bool non_gtk_gui;
void app_activated (bool);
void plugin_going_away ();
bool create_vst_editor (boost::shared_ptr<ARDOUR::PluginInsert>);
bool create_audiounit_editor (boost::shared_ptr<ARDOUR::PluginInsert>);
};
#ifdef VST_SUPPORT
@ -221,6 +231,7 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox
~VSTPluginUI ();
gint get_preferred_height ();
gint get_preferred_width ();
bool start_updating(GdkEventAny*) {return false;}
bool stop_updating(GdkEventAny*) {return false;}
@ -237,4 +248,9 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox
};
#endif // VST_SUPPORT
#ifdef HAVE_AUDIOUNITS
/* this function has to be in a .mm file */
extern PlugUIBase* create_au_gui (boost::shared_ptr<ARDOUR::PluginInsert>, Gtk::VBox**);
#endif
#endif /* __ardour_plugin_ui_h__ */

File diff suppressed because it is too large Load diff

View file

@ -104,7 +104,6 @@ ProcessorBox::ProcessorBox (Placement pcmnt, Session& sess, boost::shared_ptr<Ro
processor_drag_in_progress = false;
no_processor_redisplay = false;
ignore_delete = false;
ab_direction = true;
model = ListStore::create(columns);

View file

@ -212,15 +212,15 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual void add_toplevel_controls (Gtk::Container&) = 0;
virtual void set_zoom_focus (Editing::ZoomFocus) = 0;
virtual Editing::ZoomFocus get_zoom_focus () const = 0;
virtual gdouble get_current_zoom () = 0;
virtual PlaylistSelector& playlist_selector () const = 0;
virtual gdouble get_current_zoom () const = 0;
virtual PlaylistSelector& playlist_selector() const = 0;
virtual void route_name_changed (TimeAxisView *) = 0;
virtual void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>) = 0;
virtual void new_playlists (TimeAxisView*) = 0;
virtual void copy_playlists (TimeAxisView*) = 0;
virtual void clear_playlists (TimeAxisView*) = 0;
virtual void select_all_tracks () = 0;
virtual bool set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
virtual void hide_track_in_display (TimeAxisView& tv) = 0;
virtual void show_track_in_display (TimeAxisView& tv) = 0;
@ -252,7 +252,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual void remove_last_capture () = 0;
virtual void maximise_editing_space () = 0;
virtual void restore_editing_space () = 0;
virtual nframes64_t get_preferred_edit_position () = 0;
virtual nframes64_t get_preferred_edit_position (bool ignore_playhead = false) = 0;
virtual void toggle_meter_updating() = 0;
#ifdef WITH_CMT
virtual void add_imageframe_time_axis(const std::string & track_name, void*) = 0;

View file

@ -123,6 +123,8 @@ RegionView::init (Gdk::Color& basic_color, bool wfd)
wait_for_data = wfd;
sync_mark = 0;
sync_line = 0;
sync_mark = 0;
sync_line = 0;
compute_colors (basic_color);
@ -132,8 +134,6 @@ RegionView::init (Gdk::Color& basic_color, bool wfd)
name_text->set_data ("regionview", this);
}
//reset_width_dependent_items ((double) _region->length() / samples_per_unit);
if (wfd)
_enable_display = true;
@ -385,8 +385,8 @@ RegionView::fake_set_opaque (bool yn)
} else {
fill_opacity = 60;
}
TimeAxisViewItem::set_frame_color ();
set_frame_color ();
}
void
@ -500,7 +500,7 @@ RegionView::region_sync_changed ()
points.clear ();
points.push_back (Gnome::Art::Point (offset, 0));
points.push_back (Gnome::Art::Point (offset, _height - NAME_HIGHLIGHT_SIZE));
points.push_back (Gnome::Art::Point (offset, trackview.height - NAME_HIGHLIGHT_SIZE));
sync_line->property_points().set_value (points);
sync_line->show ();

View file

@ -352,9 +352,9 @@ void
RouteParams_UI::cleanup_pre_view (bool stopupdate)
{
if (_active_pre_view) {
LadspaPluginUI * plugui = 0;
GenericPluginUI * plugui = 0;
if (stopupdate && (plugui = dynamic_cast<LadspaPluginUI*>(_active_pre_view)) != 0) {
if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_pre_view)) != 0) {
plugui->stop_updating (0);
}
@ -369,9 +369,9 @@ void
RouteParams_UI::cleanup_post_view (bool stopupdate)
{
if (_active_post_view) {
LadspaPluginUI * plugui = 0;
GenericPluginUI * plugui = 0;
if (stopupdate && (plugui = dynamic_cast<LadspaPluginUI*>(_active_post_view)) != 0) {
if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_post_view)) != 0) {
plugui->stop_updating (0);
}
_post_plugin_conn.disconnect();
@ -581,7 +581,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> insert,
}
} else if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {
LadspaPluginUI *plugin_ui = new LadspaPluginUI (plugin_insert, session->frame_rate(), session->engine().frames_per_cycle(), true);
GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true);
if (place == PreFader) {
cleanup_pre_view();

View file

@ -52,6 +52,7 @@
#include <ardour/session_playlist.h>
#include <ardour/utils.h>
#include <ardour/parameter.h>
#include <ardour/profile.h>
#include "ardour_ui.h"
#include "route_time_axis.h"
@ -105,6 +106,8 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
_view = 0;
timestretch_rect = 0;
no_redraw = false;
destructive_track_mode_item = 0;
normal_track_mode_item = 0;
ignore_toggle = false;
@ -149,6 +152,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release));
controls_table.attach (*rec_enable_button, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
}
controls_hbox.pack_start(lm, false, false);
@ -172,17 +176,22 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
label_view ();
controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
if (!Profile->get_sae()) {
controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
} else {
controls_table.attach (automation_button, 4, 5, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
}
if (is_track() && track()->mode() == ARDOUR::Normal) {
controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
}
/* remove focus from the buttons */
y_position = -1;
_route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
@ -325,7 +334,7 @@ RouteTimeAxisView::get_automation_child_xml_node (Parameter param)
gint
RouteTimeAxisView::edit_click (GdkEventButton *ev)
{
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
_route->set_edit_group (0, this);
return FALSE;
}
@ -502,13 +511,15 @@ RouteTimeAxisView::build_display_menu ()
items.push_back (SeparatorElem());
build_remote_control_menu ();
items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
build_automation_action_menu ();
items.push_back (MenuElem (_("Automation"), *automation_action_menu));
if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
items.push_back (MenuElem (_("Automation"), *automation_action_menu));
items.push_back (SeparatorElem());
}
// Hook for derived classes to add type specific stuff
items.push_back (SeparatorElem());
append_extra_display_menu_items ();
items.push_back (SeparatorElem());
@ -545,7 +556,26 @@ RouteTimeAxisView::build_display_menu ()
if (get_diskstream()->alignment_style() == CaptureTime)
align_capture_item->set_active();
items.push_back (MenuElem (_("Alignment"), *alignment_menu));
if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Alignment"), *alignment_menu));
get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &RouteTimeAxisView::align_style_changed));
RadioMenuItem::Group mode_group;
items.push_back (RadioMenuElem (mode_group, _("Normal mode"),
bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Normal)));
normal_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
items.push_back (RadioMenuElem (mode_group, _("Tape mode"),
bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Destructive)));
destructive_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
switch (track()->mode()) {
case ARDOUR::Destructive:
destructive_track_mode_item->set_active ();
break;
case ARDOUR::Normal:
normal_track_mode_item->set_active ();
break;
}
get_diskstream()->AlignmentStyleChanged.connect (
mem_fun(*this, &RouteTimeAxisView::align_style_changed));
@ -553,9 +583,11 @@ RouteTimeAxisView::build_display_menu ()
mode_menu = build_mode_menu();
if (mode_menu)
items.push_back (MenuElem (_("Mode"), *mode_menu));
items.push_back (SeparatorElem());
}
}
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
route_active_menu_item->set_active (_route->active());
@ -590,8 +622,8 @@ RouteTimeAxisView::set_track_mode (TrackMode mode)
/*NOTREACHED*/
return;
}
if (item->get_active () && track()->mode() != mode) {
if (item && other_item && item->get_active () && track()->mode() != mode) {
_set_track_mode (track().get(), mode, other_item);
}
}
@ -740,7 +772,7 @@ RouteTimeAxisView::set_height (TrackHeight h)
{
int gmlen = (height_to_pixels (h)) - 5;
bool height_changed = (height == 0) || (h != height_style);
lm.setup_meters (gmlen);
TimeAxisView::set_height (h);
ensure_xml_node ();
@ -822,7 +854,6 @@ RouteTimeAxisView::set_height (TrackHeight h)
break;
case Small:
hide_meter();
hide_name_entry ();
show_name_label ();
@ -1084,7 +1115,7 @@ RouteTimeAxisView::update_diskstream_display ()
void
RouteTimeAxisView::selection_click (GdkEventButton* ev)
{
if (Keyboard::modifier_state_equals (ev->state, (Keyboard::Shift|Keyboard::Control))) {
if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) {
/* special case: select/deselect all tracks */
if (editor.get_selection().selected (this)) {
@ -1292,6 +1323,19 @@ RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t d
return boost::shared_ptr<Region> ();
}
nframes64_t
RouteTimeAxisView::find_next_region_boundary (nframes64_t pos, int32_t dir)
{
boost::shared_ptr<Diskstream> stream;
boost::shared_ptr<Playlist> playlist;
if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
return playlist->find_next_region_boundary (pos, dir);
}
return -1;
}
bool
RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
{
@ -1497,6 +1541,7 @@ RouteTimeAxisView::color_handler ()
timestretch_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchFill.get();
}
reset_meter();
}
void

View file

@ -40,6 +40,7 @@
#include "canvas.h"
#include "level_meter.h"
namespace ARDOUR {
class Session;
class Region;
@ -83,6 +84,7 @@ public:
void set_layer_display (LayerDisplay d);
boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t pos, ARDOUR::RegionPoint, int32_t dir);
nframes64_t find_next_region_boundary (nframes64_t pos, int32_t dir);
/* Editing operations */
bool cut_copy_clear (Selection&, Editing::CutCopyOp);

View file

@ -148,10 +148,10 @@ RouteUI::mute_press(GdkEventButton* ev)
} else {
if (ev->button == 2) {
// ctrl-button2 click is the midi binding click
// Primary-button2 click is the midi binding click
// button2-click is "momentary"
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control))) {
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier))) {
wait_for_release = true;
} else {
return false;
@ -160,9 +160,9 @@ RouteUI::mute_press(GdkEventButton* ev)
if (ev->button == 1 || ev->button == 2) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Shift))) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
/* ctrl-shift-click applies change to all routes */
/* Primary-Tertiary-click applies change to all routes */
_session.begin_reversible_command (_("mute change"));
Session::GlobalMuteStateCommand *cmd = new Session::GlobalMuteStateCommand(_session, this);
@ -171,10 +171,10 @@ RouteUI::mute_press(GdkEventButton* ev)
_session.add_command(cmd);
_session.commit_reversible_command ();
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
/* ctrl-click applies change to the mix group.
ctrl-button2 is MIDI learn.
/* Primary-button1 applies change to the mix group.
NOTE: Primary-button2 is MIDI learn.
*/
if (ev->button == 1) {
@ -226,10 +226,10 @@ RouteUI::solo_press(GdkEventButton* ev)
if (ev->button == 2) {
// ctrl-button2 click is the midi binding click
// Primary-button2 click is the midi binding click
// button2-click is "momentary"
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control))) {
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier))) {
wait_for_release = true;
} else {
return false;
@ -238,9 +238,9 @@ RouteUI::solo_press(GdkEventButton* ev)
if (ev->button == 1 || ev->button == 2) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Shift))) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
/* ctrl-shift-click applies change to all routes */
/* Primary-Tertiary-click applies change to all routes */
_session.begin_reversible_command (_("solo change"));
Session::GlobalSoloStateCommand *cmd = new Session::GlobalSoloStateCommand(_session, this);
@ -249,9 +249,9 @@ RouteUI::solo_press(GdkEventButton* ev)
_session.add_command (cmd);
_session.commit_reversible_command ();
} else if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Alt))) {
} else if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
// ctrl-alt-click: exclusively solo this track, not a toggle */
// Primary-Secondary-click: exclusively solo this track, not a toggle */
_session.begin_reversible_command (_("solo change"));
Session::GlobalSoloStateCommand *cmd = new Session::GlobalSoloStateCommand (_session, this);
@ -261,17 +261,17 @@ RouteUI::solo_press(GdkEventButton* ev)
_session.add_command(cmd);
_session.commit_reversible_command ();
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
// shift-click: set this route to solo safe
_route->set_solo_safe (!_route->solo_safe(), this);
wait_for_release = false;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
/* ctrl-click: solo mix group.
ctrl-button2 is MIDI learn.
/* Primary-button1: solo mix group.
NOTE: Primary-button2 is MIDI learn.
*/
if (ev->button == 1) {
@ -281,7 +281,7 @@ RouteUI::solo_press(GdkEventButton* ev)
} else {
/* click: solo this route */
reversibly_apply_route_boolean ("solo change", &Route::set_solo, !_route->soloed(), this);
}
}
@ -318,11 +318,12 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
if (!ignore_toggle && is_track() && rec_enable_button) {
if (ev->button == 2 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
if (ev->button == 2 && Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
// do nothing on midi bind event
return false;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Shift))) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
_session.begin_reversible_command (_("rec-enable change"));
Session::GlobalRecordEnableStateCommand *cmd = new Session::GlobalRecordEnableStateCommand(_session, this);
@ -337,7 +338,11 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
_session.add_command(cmd);
_session.commit_reversible_command ();
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
/* Primary-button1 applies change to the mix group.
NOTE: Primary-button2 is MIDI learn.
*/
set_mix_group_rec_enable (_route, !_route->record_enabled());

View file

@ -34,7 +34,6 @@ class Selectable : public virtual sigc::trackable
virtual void set_selected (bool yn) {
if (yn != _selected) {
_selected = yn;
Selected (_selected); /* EMIT_SIGNAL */
}
}
@ -42,9 +41,6 @@ class Selectable : public virtual sigc::trackable
return _selected;
}
/** Emitted when the selected status of this Selectable changes */
sigc::signal<void, bool> Selected ;
protected:
bool _selected;
};

View file

@ -295,13 +295,23 @@ Selection::add (TimeAxisView* track)
}
}
void
Selection::add (const RegionSelection& rs)
{
if (!rs.empty()) {
regions.insert (regions.end(), rs.begin(), rs.end());
RegionsChanged(); /* EMIT SIGNAL */
}
}
void
Selection::add (RegionView* r)
{
if (find (regions.begin(), regions.end(), r) == regions.end()) {
regions.add (r);
select_edit_group_regions ();
add (&r->get_trackview());
if (Config->get_link_region_and_track_selection()) {
add (&r->get_trackview());
}
RegionsChanged ();
}
}
@ -314,7 +324,7 @@ Selection::add (vector<RegionView*>& v)
for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
changed = regions.add ((*i));
if (changed) {
if (Config->get_link_region_and_track_selection() && changed) {
add (&(*i)->get_trackview());
}
}
@ -438,7 +448,7 @@ Selection::remove (RegionView* r)
RegionsChanged ();
}
if (!regions.involves (r->get_trackview())) {
if (Config->get_link_region_and_track_selection() && !regions.involves (r->get_trackview())) {
remove (&r->get_trackview());
}
}
@ -505,20 +515,32 @@ Selection::set (const list<boost::shared_ptr<Playlist> >& pllist)
}
void
Selection::set (RegionView* r)
Selection::set (const RegionSelection& rs)
{
clear_regions();
regions = rs;
RegionsChanged(); /* EMIT SIGNAL */
}
void
Selection::set (RegionView* r, bool also_clear_tracks)
{
clear_regions ();
clear_tracks ();
if (also_clear_tracks) {
clear_tracks ();
}
add (r);
}
void
Selection::set (vector<RegionView*>& v)
{
clear_tracks ();
clear_regions ();
// make sure to deselect any automation selections
clear_points();
if (Config->get_link_region_and_track_selection()) {
clear_tracks ();
// make sure to deselect any automation selections
clear_points();
}
add (v);
}

View file

@ -102,7 +102,7 @@ class Selection : public sigc::trackable
void set (TimeAxisView*);
void set (const std::list<TimeAxisView*>&);
void set (RegionView*);
void set (RegionView*, bool also_clear_tracks = true);
void set (std::vector<RegionView*>&);
long set (TimeAxisView*, nframes_t, nframes_t);
void set (ARDOUR::AutomationList*);
@ -110,6 +110,7 @@ class Selection : public sigc::trackable
void set (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
void set (AutomationSelectable*);
void set (Marker*);
void set (const RegionSelection&);
void toggle (TimeAxisView*);
void toggle (const std::list<TimeAxisView*>&);
@ -131,6 +132,7 @@ class Selection : public sigc::trackable
void add (boost::shared_ptr<ARDOUR::Playlist>);
void add (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
void add (Marker*);
void add (const RegionSelection&);
void remove (TimeAxisView*);
void remove (const std::list<TimeAxisView*>&);

View file

@ -395,6 +395,11 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
found_search_btn (_("Search"))
{
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;

View file

@ -379,7 +379,6 @@ StreamView::set_selected_regionviews (RegionSelection& regions)
{
bool selected;
// cerr << _trackview.name() << " (selected = " << regions.size() << ")" << endl;
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
selected = false;
@ -389,8 +388,7 @@ StreamView::set_selected_regionviews (RegionSelection& regions)
selected = true;
}
}
// cerr << "\tregion " << (*i)->region().name() << " selected = " << selected << endl;
(*i)->set_selected (selected);
}
}

View file

@ -311,30 +311,45 @@ carbon_menu_item_update_accelerator (CarbonMenuItem *carbon_item,
GdkKeymap *keymap = gdk_keymap_get_for_display (display);
GdkKeymapKey *keys;
gint n_keys;
gint use_command;
if (gdk_keymap_get_entries_for_keyval (keymap, key->accel_key,
&keys, &n_keys))
{
UInt8 modifiers = 0;
UInt8 modifiers = 0; /* implies Command key */
SetMenuItemCommandKey (carbon_item->menu, carbon_item->index,
true, keys[0].keycode);
g_free (keys);
use_command = 0;
if (key->accel_mods)
{
if (key->accel_mods & GDK_SHIFT_MASK)
if (key->accel_mods & GDK_SHIFT_MASK) {
modifiers |= kMenuShiftModifier;
}
if (key->accel_mods & GDK_MOD1_MASK)
if (key->accel_mods & (GDK_MOD1_MASK)) {
modifiers |= kMenuOptionModifier;
}
}
if (!(key->accel_mods & GDK_CONTROL_MASK))
{
modifiers |= kMenuNoCommandModifier;
}
if (key->accel_mods & GDK_CONTROL_MASK) {
modifiers |= kMenuControlModifier;
}
if (key->accel_mods & GDK_MOD5_MASK) {
/* Mod5 is what ardour's binding file uses to mean "Command"
Nothing needs to be set in modifiers, but we need to notice
that there *is* an implicit modifier
*/
use_command = 1;
}
}
if (!use_command)
modifiers |= kMenuNoCommandModifier;
SetMenuItemModifiers (carbon_item->menu, carbon_item->index,
modifiers);

View file

@ -96,5 +96,5 @@ void
TapeAudioRegionView::set_frame_color ()
{
fill_opacity = 255;
TimeAxisViewItem::set_frame_color ();
AudioRegionView::set_frame_color ();
}

View file

@ -34,6 +34,7 @@ using namespace PBD;
TempoDialog::TempoDialog (TempoMap& map, nframes_t frame, const string & action)
: ArdourDialog (_("edit tempo")),
note_frame (_("BPM denominator")),
bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0, 1.0),
bpm_spinner (bpm_adjustment),
bpm_frame (_("Beats per minute")),
@ -48,7 +49,7 @@ TempoDialog::TempoDialog (TempoMap& map, nframes_t frame, const string & action)
Tempo tempo (map.tempo_at (frame));
map.bbt_time (frame, when);
init (when, tempo.beats_per_minute(), true);
init (when, tempo.beats_per_minute(), tempo.note_type(), true);
}
TempoDialog::TempoDialog (TempoSection& section, const string & action)
@ -63,23 +64,62 @@ TempoDialog::TempoDialog (TempoSection& section, const string & action)
when_table (2, 2),
when_frame (_("Location"))
{
init (section.start(), section.beats_per_minute(), section.movable());
init (section.start(), section.beats_per_minute(), section.note_type(), section.movable());
}
void
TempoDialog::init (const BBT_Time& when, double bpm, bool movable)
TempoDialog::init (const BBT_Time& when, double bpm, double note_type, bool movable)
{
bpm_spinner.set_numeric (true);
bpm_spinner.set_digits (1);
bpm_spinner.set_digits (2);
bpm_spinner.set_wrap (true);
bpm_spinner.set_value (bpm);
strings.push_back (_("whole (1)"));
strings.push_back (_("second (2)"));
strings.push_back (_("third (3)"));
strings.push_back (_("quarter (4)"));
strings.push_back (_("eighth (8)"));
strings.push_back (_("sixteenth (16)"));
strings.push_back (_("thirty-second (32)"));
/* the string here needs to be the longest one to display */
const guint32 FUDGE = 20; // Combo's are stupid - they steal space from the entry for the button
// TRANSLATORS: this is not a mis-spelling of "thirty", we're including a vertical
// descender to make sure the height gets computed properly.
Gtkmm2ext::set_size_request_to_display_given_text (note_types, "thirtq-second (32)", 7+FUDGE, 15);
set_popdown_strings (note_types, strings);
if (note_type==1.0f)
note_types.set_active_text (_("whole (1)"));
else if (note_type==2.0f)
note_types.set_active_text (_("second (2)"));
else if (note_type==3.0f)
note_types.set_active_text (_("third (3)"));
else if (note_type==4.0f)
note_types.set_active_text (_("quarter (4)"));
else if (note_type==8.0f)
note_types.set_active_text (_("eighth (8)"));
else if (note_type==16.0f)
note_types.set_active_text (_("sixteenth (16)"));
else if (note_type==32.0f)
note_types.set_active_text (_("thirty-second (32)"));
else
note_types.set_active_text (_("quarter (4)"));
hspacer1.set_border_width (5);
hspacer1.pack_start (bpm_spinner, false, false);
vspacer1.set_border_width (5);
vspacer1.pack_start (hspacer1, false, false);
hspacer2.set_border_width (5);
hspacer2.pack_start (note_types, false, false);
vspacer2.set_border_width (5);
vspacer2.pack_start (hspacer2, false, false);
bpm_frame.add (vspacer1);
note_frame.add (vspacer2);
if (movable) {
snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
@ -115,9 +155,12 @@ TempoDialog::init (const BBT_Time& when, double bpm, bool movable)
bpm_frame.set_name ("MetricDialogFrame");
bpm_spinner.set_name ("MetricEntry");
note_frame.set_name ("MetricDialogFrame");
get_vbox()->set_border_width (12);
get_vbox()->pack_start (bpm_frame, false, false);
get_vbox()->pack_start (note_frame, false, false);
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (Stock::APPLY, RESPONSE_ACCEPT);
set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
@ -131,6 +174,7 @@ TempoDialog::init (const BBT_Time& when, double bpm, bool movable)
bpm_spinner.signal_activate().connect (bind (mem_fun (*this, &TempoDialog::response), RESPONSE_ACCEPT));
bpm_spinner.signal_button_press_event().connect (mem_fun (*this, &TempoDialog::bpm_button_press), false);
bpm_spinner.signal_button_release_event().connect (mem_fun (*this, &TempoDialog::bpm_button_release), false);
note_types.signal_changed().connect (mem_fun (*this, &TempoDialog::note_types_change));
}
bool
@ -168,6 +212,41 @@ TempoDialog::get_bbt_time (BBT_Time& requested)
return true;
}
double
TempoDialog::get_note_type ()
{
double note_type = 0;
vector<string>::iterator i;
string text = note_types.get_active_text();
for (i = strings.begin(); i != strings.end(); ++i) {
if (text == *i) {
if (sscanf (text.c_str(), "%*[^0-9]%lf", &note_type) != 1) {
error << string_compose(_("garbaged note type entry (%1)"), text) << endmsg;
return 0;
} else {
break;
}
}
}
if (i == strings.end()) {
if (sscanf (text.c_str(), "%lf", &note_type) != 1) {
error << string_compose(_("incomprehensible note type entry (%1)"), text) << endmsg;
return 0;
}
}
cerr << "returning " << note_type << " based on " << text << endl;
return note_type;
}
void
TempoDialog::note_types_change ()
{
set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
}
MeterDialog::MeterDialog (TempoMap& map, nframes_t frame, const string & action)
: ArdourDialog ("meter dialog"),
@ -216,6 +295,13 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
strings.push_back (_("sixteenth (16)"));
strings.push_back (_("thirty-second (32)"));
/* the string here needs to be the longest one to display */
const guint32 FUDGE = 20; // Combo's are stupid - they steal space from the entry for the button
// TRANSLATORS: this is not a mis-spelling of "thirty", we're including a vertical
// descender to make sure the height gets computed properly.
Gtkmm2ext::set_size_request_to_display_given_text (note_types, _("thirtq-second (32)"), 7+FUDGE, 15);
set_popdown_strings (note_types, strings);
if (note_type==1.0f)
@ -235,10 +321,6 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
else
note_types.set_active_text (_("quarter (4)"));
/* the string here needs to be the longest one to display */
const guint32 FUDGE = 20; // Combo's are stupid - they steal space from the entry for the button
Gtkmm2ext::set_size_request_to_display_given_text (note_types, "thirty-second (32)", 7+FUDGE, 7);
hspacer1.set_border_width (5);
hspacer1.pack_start (note_types, false, false);
vspacer1.set_border_width (5);
@ -283,6 +365,8 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
get_vbox()->pack_start (when_frame, false, false);
}
get_vbox()->set_border_width (12);
get_vbox()->pack_start (bpb_frame, false, false);
get_vbox()->pack_start (note_frame, false, false);

View file

@ -37,6 +37,9 @@
struct TempoDialog : public ArdourDialog
{
Gtk::ComboBoxText note_types;
vector<string> strings;
Gtk::Frame note_frame;
Gtk::Adjustment bpm_adjustment;
Gtk::SpinButton bpm_spinner;
Gtk::Frame bpm_frame;
@ -44,8 +47,8 @@ struct TempoDialog : public ArdourDialog
Gtk::Button ok_button;
Gtk::Button cancel_button;
Gtk::HBox button_box;
Gtk::HBox hspacer1;
Gtk::VBox vspacer1;
Gtk::HBox hspacer1, hspacer2;
Gtk::VBox vspacer1, vspacer2;
Gtk::Entry when_bar_entry;
Gtk::Entry when_beat_entry;
Gtk::Label when_bar_label;
@ -58,13 +61,15 @@ struct TempoDialog : public ArdourDialog
TempoDialog (ARDOUR::TempoSection&, const string & action);
double get_bpm ();
double get_note_type ();
bool get_bbt_time (ARDOUR::BBT_Time&);
private:
void init (const ARDOUR::BBT_Time& start, double, bool);
void init (const ARDOUR::BBT_Time& start, double, double, bool);
void bpm_changed ();
bool bpm_button_press (GdkEventButton* );
bool bpm_button_release (GdkEventButton* );
void note_types_change ();
};
struct MeterDialog : public ArdourDialog

View file

@ -247,14 +247,14 @@ TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
{
switch (ev->direction) {
case GDK_SCROLL_UP:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
step_height (true);
return true;
}
break;
case GDK_SCROLL_DOWN:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
step_height (false);
return true;
}
@ -364,11 +364,12 @@ TimeAxisView::set_height_pixels (uint32_t h)
{
height = h;
controls_frame.set_size_request (-1, height + ((order == 0) ? 1 : 0));
//cerr << "TimeAxisView::set_height_pixels() called h = " << h << endl;//DEBUG
if (canvas_item_visible (selection_group)) {
/* resize the selection rect */
show_selection (editor.get_selection().time);
}
}
bool
@ -518,10 +519,7 @@ TimeAxisView::popup_display_menu (guint32 when)
build_display_menu ();
}
if (!get_selected()) {
editor.set_selected_track (*this, Selection::Set);
}
editor.set_selected_track (*this, Selection::Add);
display_menu->popup (1, when);
}

View file

@ -201,7 +201,7 @@ class TimeAxisViewItem : public Selectable
*/
void set_name_text(const Glib::ustring& new_name) ;
virtual void set_y_position_and_height(double y, double h);
virtual void set_y_position_and_height(double y, double h) ;
/**
*
@ -357,7 +357,7 @@ class TimeAxisViewItem : public Selectable
/**
* Sets the frame color depending on whether this item is selected
*/
void set_frame_color() ;
virtual void set_frame_color() ;
/**
* Sets the colors of the start and end trim handle depending on object state

View file

@ -235,8 +235,6 @@ UIConfiguration::pack_canvasvars ()
#define CANVAS_VARIABLE(var,name) canvas_colors.push_back(&var);
#include "canvas_vars.h"
#undef CANVAS_VARIABLE
cerr << "Configuration::pack_canvasvars () called, canvas_colors.size() = " << canvas_colors.size() << endl;
}

View file

@ -406,7 +406,7 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
GtkWidget* focus = gtk_window_get_focus (win);
bool special_handling_of_unmodified_accelerators = false;
#undef DEBUG_ACCELERATOR_HANDLING
#undef DEBUG_ACCELERATOR_HANDLING
#ifdef DEBUG_ACCELERATOR_HANDLING
bool debug = (getenv ("ARDOUR_DEBUG_ACCELERATOR_HANDLING") != 0);
#endif
@ -490,15 +490,14 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
return true;
}
}
if (!special_handling_of_unmodified_accelerators ||
ev->state & (Gdk::MOD1_MASK|
Gdk::MOD3_MASK|
Gdk::MOD4_MASK|
Gdk::MOD5_MASK|
Gdk::CONTROL_MASK)) {
/* no special handling or modifiers in effect: accelerate first */
/* consider all relevant modifiers but not LOCK or SHIFT */
guint mask = (Keyboard::RelevantModifierKeyMask & ~(Gdk::SHIFT_MASK|Gdk::LOCK_MASK));
if (!special_handling_of_unmodified_accelerators || (ev->state & mask)) {
/* no special handling or there are modifiers in effect: accelerate first */
#ifdef DEBUG_ACCELERATOR_HANDLING
if (debug) {
@ -511,12 +510,17 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
}
#endif
if (!gtk_window_activate_key (win, ev)) {
#ifdef DEBUG_ACCELERATOR_HANDLING
if (debug) {
cerr << "\tnot accelerated, now propagate\n";
}
#endif
return gtk_window_propagate_key_event (win, ev);
} else {
#ifdef DEBUG_ACCELERATOR_HANDLING
if (debug) {
cerr << "\tnot handled\n";
}
if (debug) {
cerr << "\taccelerated - done.\n";
}
#endif
return true;
}
@ -588,11 +592,24 @@ get_icon (const char* cname)
sys::path data_file_path;
if(!find_file_in_search_path (spath, name, data_file_path)) {
if (!find_file_in_search_path (spath, name, data_file_path)) {
fatal << string_compose (_("cannot find icon image for %1"), name) << endmsg;
}
return Gdk::Pixbuf::create_from_file (data_file_path.to_string());
Glib::RefPtr<Gdk::Pixbuf> img;
try {
img = Gdk::Pixbuf::create_from_file (data_file_path.to_string());
}
catch (const Gdk::PixbufError &e)
{
cerr << "Caught PixbufError: " << e.what() << endl;
}
catch (...)
{
g_message("Caught ... ");
}
return img;
}
string

View file

@ -57,6 +57,12 @@ VSTPluginUI::get_preferred_height ()
return vst->fst()->height;
}
int
VSTPluginUI::get_preferred_width ()
{
return vst->fst()->width;
}
int
VSTPluginUI::package (Gtk::Window& win)
{

View file

@ -4,3 +4,8 @@ void
ARDOUR_UI::platform_specific ()
{
}
void
ARDOUR_UI::platform_setup ()
{
}

Some files were not shown because too many files have changed in this diff Show more