Merged with trunk R1283.

NOTE: Compiles, but broken (crash on adding MIDI track).


git-svn-id: svn://localhost/ardour2/branches/midi@1292 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2007-01-09 23:24:54 +00:00
parent ef6b25432d
commit 532f6aad4a
271 changed files with 12893 additions and 7748 deletions

View file

@ -59,6 +59,8 @@ mantis and some not, fairly continuously for several months. He then
moved on to write SSE assembler routines to handle the CPU-hungry
metering and mixing routines.
Brian Ahr contributed many small fixes for ardour 2.0.
Smaller (but not necessarily minor) patches were received from the
following people:
@ -73,3 +75,4 @@ following people:
Rob Holland
Joshua Leachman
Per Sigmond
Nimal Ratnayake

View file

@ -12,4 +12,4 @@ file) will be removed.
(2) STANDARD TEMPLATES
The templates in ./templates are intended for installation in
$prefix/share/ardour/templates.
$prefix/share/ardour2/templates.

View file

@ -16,7 +16,7 @@ import SCons.Node.FS
SConsignFile()
EnsureSConsVersion(0, 96)
version = '2.0beta8'
ardour_version = '2.0beta10'
subst_dict = { }
@ -39,10 +39,11 @@ opts.AddOptions(
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', 0),
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('VERSIONED', 'Add revision information to ardour/gtk executable name inside the build directory', 0),
BoolOption('VST', 'Compile with support for VST', 0)
BoolOption('VST', 'Compile with support for VST', 0),
BoolOption('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 0)
)
#----------------------------------------------------------------------
@ -75,11 +76,11 @@ class LibraryInfo(Environment):
env = LibraryInfo (options = opts,
CPPPATH = [ '.' ],
VERSION = version,
TARBALL='ardour-' + version + '.tar.bz2',
VERSION = ardour_version,
TARBALL='ardour-' + ardour_version + '.tar.bz2',
DISTFILES = [ ],
DISTTREE = '#ardour-' + version,
DISTCHECKDIR = '#ardour-' + version + '/check'
DISTTREE = '#ardour-' + ardour_version,
DISTCHECKDIR = '#ardour-' + ardour_version + '/check'
)
env.ENV_update(os.environ)
@ -233,7 +234,8 @@ def i18n (buildenv, sources, installenv):
def fetch_svn_revision (path):
cmd = "svn info "
cmd = "LANG= "
cmd += "svn info "
cmd += path
cmd += " | awk '/^Revision:/ { print $2}'"
return commands.getoutput (cmd)
@ -388,6 +390,57 @@ if env['VST']:
print "OK, VST support will be enabled"
#######################
# Dependency Checking #
#######################
deps = \
{
'glib-2.0' : '2.10.1',
'gthread-2.0' : '2.10.1',
'gtk+-2.0' : '2.8.1',
'libxml-2.0' : '2.6.0',
'samplerate' : '0.1.0',
'raptor' : '1.4.2',
'lrdf' : '0.4.0',
'jack' : '0.101.1',
'libgnomecanvas-2.0' : '2.0'
}
def DependenciesRequiredMessage():
print 'You do not have the necessary dependencies required to build ardour'
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
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
conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
'CheckPKGVersion' : CheckPKGVersion })
# I think a more recent version is needed on win32
min_pkg_config_version = '0.8.0'
if not conf.CheckPKGConfig(min_pkg_config_version):
print 'pkg-config >= %s not found.' % min_pkg_config_version
Exit(1)
for pkg, version in deps.iteritems():
if not conf.CheckPKGVersion( pkg, version ):
print '%s >= %s not found.' %(pkg, version)
DependenciesRequiredMessage()
Exit(1)
env = conf.Finish()
# ----------------------------------------------------------------------
# Construction environment setup
# ----------------------------------------------------------------------
@ -411,6 +464,13 @@ libraries['samplerate'].ParseConfig('pkg-config --cflags --libs samplerate')
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();
libraries['jack'] = LibraryInfo()
libraries['jack'].ParseConfig('pkg-config --cflags --libs jack')
@ -450,10 +510,194 @@ libraries['midi++2'] = LibraryInfo (LIBS='midi++', LIBPATH='#libs/midi++2', CPPP
libraries['pbd'] = LibraryInfo (LIBS='pbd', LIBPATH='#libs/pbd', CPPPATH='#libs/pbd')
libraries['gtkmm2ext'] = LibraryInfo (LIBS='gtkmm2ext', LIBPATH='#libs/gtkmm2ext', CPPPATH='#libs/gtkmm2ext')
# SCons should really do this for us
conf = Configure (env)
have_cxx = conf.TryAction (Action (str(env['CXX']) + ' --version'))
if have_cxx[0] != 1:
print "This system has no functional C++ compiler. You cannot build Ardour from source without one."
sys.exit (1)
else:
print "Congratulations, you have a functioning C++ compiler."
env = conf.Finish()
#
# Compiler flags and other system-dependent stuff
#
opt_flags = []
debug_flags = [ '-g' ]
# guess at the platform, used to define compiler flags
config_guess = os.popen("tools/config.guess").read()[:-1]
config_cpu = 0
config_arch = 1
config_kernel = 2
config_os = 3
config = config_guess.split ("-")
print "system triple: " + config_guess
# Autodetect
if env['DIST_TARGET'] == 'auto':
if config[config_arch] == 'apple':
# The [.] matches to the dot after the major version, "." would match any character
if re.search ("darwin[0-7][.]", config[config_kernel]) != None:
env['DIST_TARGET'] = 'panther'
else:
env['DIST_TARGET'] = 'tiger'
else:
if re.search ("x86_64", config[config_cpu]) != None:
env['DIST_TARGET'] = 'x86_64'
elif re.search("i[0-5]86", config[config_cpu]) != None:
env['DIST_TARGET'] = 'i386'
elif re.search("powerpc", config[config_cpu]) != None:
env['DIST_TARGET'] = 'powerpc'
else:
env['DIST_TARGET'] = 'i686'
print "\n*******************************"
print "detected DIST_TARGET = " + env['DIST_TARGET']
print "*******************************\n"
if config[config_cpu] == 'powerpc' and env['DIST_TARGET'] != 'none':
#
# Apple/PowerPC optimization options
#
# -mcpu=7450 does not reliably work with gcc 3.*
#
if env['DIST_TARGET'] == 'panther' or env['DIST_TARGET'] == 'tiger':
if config[config_arch] == 'apple':
## opt_flags.extend ([ "-mcpu=7450", "-faltivec"])
# to support g3s but still have some optimization for above
opt_flags.extend ([ "-mcpu=G3", "-mtune=7450"])
else:
opt_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
else:
opt_flags.extend([ "-mcpu=750", "-mmultiple" ])
opt_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
opt_flags.extend (["-Os"])
elif ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None)) and env['DIST_TARGET'] != 'none':
build_host_supports_sse = 0
debug_flags.append ("-DARCH_X86")
opt_flags.append ("-DARCH_X86")
if config[config_kernel] == 'linux' :
if env['DIST_TARGET'] != 'i386':
flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
x86_flags = flag_line.split (": ")[1:][0].split (' ')
if "mmx" in x86_flags:
opt_flags.append ("-mmmx")
if "sse" in x86_flags:
build_host_supports_sse = 1
if "3dnow" in x86_flags:
opt_flags.append ("-m3dnow")
if config[config_cpu] == "i586":
opt_flags.append ("-march=i586")
elif config[config_cpu] == "i686":
opt_flags.append ("-march=i686")
if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) and build_host_supports_sse:
opt_flags.extend (["-msse", "-mfpmath=sse"])
debug_flags.extend (["-msse", "-mfpmath=sse"])
# end of processor-specific section
# optimization section
if env['FPU_OPTIMIZATION']:
if env['DIST_TARGET'] == 'tiger':
opt_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
libraries['core'].Append(LINKFLAGS= '-framework Accelerate')
elif env['DIST_TARGET'] == 'i686' or env['DIST_TARGET'] == 'x86_64':
opt_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
if env['DIST_TARGET'] == 'x86_64':
opt_flags.append ("-DUSE_X86_64_ASM")
debug_flags.append ("-DUSE_X86_64_ASM")
if build_host_supports_sse != 1:
print "\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)"
# end optimization section
# handle x86/x86_64 libdir properly
if env['DIST_TARGET'] == 'x86_64':
env['LIBDIR']='lib64'
else:
env['LIBDIR']='lib'
#
# save off guessed arch element in an env
#
env.Append(CONFIG_ARCH=config[config_arch])
#
# ARCH="..." overrides all
#
if env['ARCH'] != '':
opt_flags = env['ARCH'].split()
#
# prepend boiler plate optimization flags
#
opt_flags[:0] = [
"-O3",
"-fomit-frame-pointer",
"-ffast-math",
"-fstrength-reduce"
]
if env['DEBUG'] == 1:
env.Append(CCFLAGS=" ".join (debug_flags))
else:
env.Append(CCFLAGS=" ".join (opt_flags))
#
# warnings flags
#
env.Append(CCFLAGS="-Wall")
env.Append(CXXFLAGS="-Woverloaded-virtual")
if env['EXTRA_WARN']:
env.Append(CCFLAGS="-Wextra -pedantic")
env.Append(CXXFLAGS="-ansi")
if env['LIBLO']:
env.Append(CCFLAGS="-DHAVE_LIBLO")
#
# fix scons nitpickiness on APPLE
#
def prep_libcheck(topenv, libinfo):
if topenv['DIST_TARGET'] == 'panther' or topenv['DIST_TARGET'] == 'tiger':
libinfo.Append(CCFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")
prep_libcheck(env, env)
#
# Check for libusb
libraries['usb'] = LibraryInfo ()
prep_libcheck(env, libraries['usb'])
conf = Configure (libraries['usb'])
if conf.CheckLib ('usb', 'usb_interrupt_write'):
@ -467,6 +711,8 @@ libraries['usb'] = conf.Finish ()
# Check for FLAC
libraries['flac'] = LibraryInfo ()
prep_libcheck(env, libraries['flac'])
libraries['flac'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/usr/local/lib")
conf = Configure (libraries['flac'])
conf.CheckLib ('FLAC', 'FLAC__stream_decoder_new', language='CXX')
@ -478,6 +724,8 @@ libraries['flac'] = conf.Finish ()
# boost (we don't link against boost, just use some header files)
libraries['boost'] = LibraryInfo ()
prep_libcheck(env, libraries['boost'])
libraries['boost'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/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."
@ -490,7 +738,8 @@ libraries['boost'] = conf.Finish ()
if env['LIBLO']:
libraries['lo'] = LibraryInfo ()
prep_libcheck(env, libraries['lo'])
conf = Configure (libraries['lo'])
if conf.CheckLib ('lo', 'lo_server_new') == False:
print "liblo does not appear to be installed."
@ -502,6 +751,7 @@ if env['LIBLO']:
# Check for dmalloc
libraries['dmalloc'] = LibraryInfo ()
prep_libcheck(env, libraries['dmalloc'])
#
# look for the threaded version
@ -546,6 +796,24 @@ else:
env = conf.Finish()
if env['SYSLIBS']:
syslibdeps = \
{
'sigc++-2.0' : '2.0',
'gtkmm-2.4' : '2.8',
'libgnomecanvasmm-2.6' : '2.12.0'
}
conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
'CheckPKGVersion' : CheckPKGVersion })
for pkg, version in syslibdeps.iteritems():
if not conf.CheckPKGVersion( pkg, version ):
print '%s >= %s not found.' %(pkg, version)
DependenciesRequiredMessage()
Exit(1)
env = conf.Finish()
libraries['sigc2'] = LibraryInfo()
libraries['sigc2'].ParseConfig('pkg-config --cflags --libs sigc++-2.0')
@ -680,15 +948,17 @@ else:
]
#
# always build the LGPL control protocol lib, since we link against it ourselves
# ditto for generic MIDI
# * always build the LGPL control protocol lib, since we link against it from libardour
# * ditto for generic MIDI
# * tranzport checks whether it should build internally, but we need here so that
# its included in the tarball
#
surface_subdirs = [ 'libs/surfaces/control_protocol', 'libs/surfaces/generic_midi' ]
surface_subdirs = [ 'libs/surfaces/control_protocol', 'libs/surfaces/generic_midi', 'libs/surfaces/tranzport' ]
if env['SURFACES']:
if have_libusb:
surface_subdirs += [ 'libs/surfaces/tranzport' ]
env['TRANZPORT'] = 'yes'
if os.access ('libs/surfaces/sony9pin', os.F_OK):
surface_subdirs += [ 'libs/surfaces/sony9pin' ]
@ -737,177 +1007,12 @@ if os.environ.has_key('TERM'):
if os.environ.has_key('HOME'):
env['HOME'] = os.environ['HOME']
# SCons should really do this for us
conf = Configure (env)
have_cxx = conf.TryAction (Action (str(env['CXX']) + ' --version'))
if have_cxx[0] != 1:
print "This system has no functional C++ compiler. You cannot build Ardour from source without one."
sys.exit (1)
else:
print "Congratulations, you have a functioning C++ compiler."
env = conf.Finish()
#
# Compiler flags and other system-dependent stuff
#
opt_flags = []
debug_flags = [ '-g' ]
# guess at the platform, used to define compiler flags
config_guess = os.popen("tools/config.guess").read()[:-1]
config_cpu = 0
config_arch = 1
config_kernel = 2
config_os = 3
config = config_guess.split ("-")
print "system triple: " + config_guess
# Autodetect
if env['DIST_TARGET'] == 'auto':
if config[config_arch] == 'apple':
# The [.] matches to the dot after the major version, "." would match any character
if re.search ("darwin[0-7][.]", config[config_kernel]) != None:
env['DIST_TARGET'] = 'panther'
else:
env['DIST_TARGET'] = 'tiger'
else:
if re.search ("x86_64", config[config_cpu]) != None:
env['DIST_TARGET'] = 'x86_64'
elif re.search("i[0-5]86", config[config_cpu]) != None:
env['DIST_TARGET'] = 'i386'
elif re.search("powerpc", config[config_cpu]) != None:
env['DIST_TARGET'] = 'powerpc'
else:
env['DIST_TARGET'] = 'i686'
print "\n*******************************"
print "detected DIST_TARGET = " + env['DIST_TARGET']
print "*******************************\n"
if config[config_cpu] == 'powerpc' and env['DIST_TARGET'] != 'none':
#
# Apple/PowerPC optimization options
#
# -mcpu=7450 does not reliably work with gcc 3.*
#
if env['DIST_TARGET'] == 'panther' or env['DIST_TARGET'] == 'tiger':
if config[config_arch] == 'apple':
opt_flags.extend ([ "-mcpu=7450", "-faltivec"])
else:
opt_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
else:
opt_flags.extend([ "-mcpu=750", "-mmultiple" ])
opt_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
elif ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None)) and env['DIST_TARGET'] != 'none':
build_host_supports_sse = 0
debug_flags.append ("-DARCH_X86")
opt_flags.append ("-DARCH_X86")
if config[config_kernel] == 'linux' :
if env['DIST_TARGET'] != 'i386':
flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
x86_flags = flag_line.split (": ")[1:][0].split (' ')
if "mmx" in x86_flags:
opt_flags.append ("-mmmx")
if "sse" in x86_flags:
build_host_supports_sse = 1
if "3dnow" in x86_flags:
opt_flags.append ("-m3dnow")
if config[config_cpu] == "i586":
opt_flags.append ("-march=i586")
elif config[config_cpu] == "i686":
opt_flags.append ("-march=i686")
if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) and build_host_supports_sse:
opt_flags.extend (["-msse", "-mfpmath=sse"])
debug_flags.extend (["-msse", "-mfpmath=sse"])
# end of processor-specific section
# optimization section
if env['FPU_OPTIMIZATION']:
if env['DIST_TARGET'] == 'tiger':
opt_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
libraries['core'].Append(LINKFLAGS= '-framework Accelerate')
elif env['DIST_TARGET'] == 'i686' or env['DIST_TARGET'] == 'x86_64':
opt_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
if env['DIST_TARGET'] == 'x86_64':
opt_flags.append ("-DUSE_X86_64_ASM")
debug_flags.append ("-DUSE_X86_64_ASM")
if build_host_supports_sse != 1:
print "\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)"
# end optimization section
#
# save off guessed arch element in an env
#
env.Append(CONFIG_ARCH=config[config_arch])
#
# ARCH="..." overrides all
#
if env['ARCH'] != '':
opt_flags = env['ARCH'].split()
#
# prepend boiler plate optimization flags
#
opt_flags[:0] = [
"-O3",
"-fomit-frame-pointer",
"-ffast-math",
"-fstrength-reduce"
]
if env['DEBUG'] == 1:
env.Append(CCFLAGS=" ".join (debug_flags))
else:
env.Append(CCFLAGS=" ".join (opt_flags))
#
# warnings flags
#
env.Append(CCFLAGS="-Wall")
env.Append(CXXFLAGS="-Woverloaded-virtual")
if env['EXTRA_WARN']:
env.Append(CCFLAGS="-Wextra -pedantic")
env.Append(CXXFLAGS="-ansi")
if env['LIBLO']:
env.Append(CCFLAGS="-DHAVE_LIBLO")
#
# everybody needs this
#
env.Merge ([ libraries['core'] ])
#
# fix scons nitpickiness on APPLE
#
if env['DIST_TARGET'] == 'panther' or env['DIST_TARGET'] == 'tiger':
env.Append(CCFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")
#
# i18n support
@ -944,7 +1049,7 @@ env = conf.Finish()
if env['NLS'] == 1:
env.Append(CCFLAGS="-DENABLE_NLS")
Export('env install_prefix final_prefix config_prefix final_config_prefix libraries i18n version subst_dict')
Export('env install_prefix final_prefix config_prefix final_config_prefix libraries i18n ardour_version subst_dict')
#
# the configuration file may be system dependent

View file

@ -4,7 +4,7 @@ import os
import os.path
import glob
Import('env install_prefix final_prefix config_prefix libraries i18n version')
Import('env install_prefix final_prefix config_prefix libraries i18n ardour_version')
gtkardour = env.Copy()
gtkmmtests = env.Copy()
@ -112,6 +112,7 @@ color_manager.cc
crossfade_edit.cc
crossfade_view.cc
curvetest.cc
enums.cc
editing.cc
editor.cc
editor_actions.cc
@ -169,6 +170,7 @@ new_session_dialog.cc
option_editor.cc
opts.cc
pan_automation_time_axis.cc
panner.cc
panner2d.cc
panner_ui.cc
playlist_selector.cc
@ -262,7 +264,7 @@ versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
gtkardour.Append(CXXFLAGS=versionflag)
executable = 'ardour.bin'
executable = 'ardour-' + ardour_version
ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
ardourlib = gtkardour.SharedLibrary(target = 'ardourgtk', source = gtkardour_files + extra_sources)
@ -274,14 +276,22 @@ tt = gtkmmtests.Program(target = 'tt', source = tt_files)
my_subst_dict = { }
my_subst_dict['%INSTALL_PREFIX%'] = final_prefix
my_subst_dict['%LIBDIR%'] = env['LIBDIR']
my_subst_dict['%VERSION%'] = ardour_version
ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict);
env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755))
ardourdev = env.SubstInFile ('ardev_common.sh','ardev_common.sh.in', SUBST_DICT = my_subst_dict);
env.AddPostAction (ardourdev, Chmod ('$TARGET', 0755))
Default(ardourdev)
Default(ardoursh)
if env['VST']:
Default(ardourlib)
# the library - into the library dir
env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), ardourlib))
env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardourlib))
else:
if env['VERSIONED']:
@ -292,7 +302,7 @@ else:
#install
# the executable - into the library dir
env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), ardour))
env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardour))
# the script - into the bin dir
env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh))
@ -305,9 +315,9 @@ env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.bindings'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.colors'))
# 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))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/icons'), icon_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))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'icons'), icon_files))
env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], []))

View file

@ -145,6 +145,8 @@ static const char* authors[] = {
N_("Stefan Kersten"),
N_("Christopher George"),
N_("Robert Jordens"),
N_("Brian Ahr"),
N_("Nimal Ratnayake"),
0
};

View file

@ -61,7 +61,7 @@ AnalysisWindow::AnalysisWindow()
tlmodel = Gtk::ListStore::create(tlcols);
track_list.set_model (tlmodel);
track_list.append_column(_("Track"), tlcols.trackname);
track_list.append_column_editable(_("Visible"), tlcols.visible);
track_list.append_column_editable(_("Show"), tlcols.visible);
track_list.set_headers_visible(true);
track_list.set_reorderable(false);
track_list.get_selection()->set_mode (Gtk::SELECTION_NONE);
@ -228,8 +228,8 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
for (TrackSelection::iterator i = s.tracks.begin(); i != s.tracks.end(); ++i) {
ARDOUR::AudioPlaylist *pl
= dynamic_cast<ARDOUR::AudioPlaylist*>((*i)->playlist());
boost::shared_ptr<AudioPlaylist> pl
= boost::dynamic_pointer_cast<AudioPlaylist>((*i)->playlist());
if (!pl)
continue;
@ -246,7 +246,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
if (source_selection_ranges_rb.get_active()) {
// cerr << "Analyzing ranges on track " << *&rui->route().name() << endl;
for (std::list<ARDOUR::AudioRange>::iterator j = ts.begin(); j != ts.end(); ++j) {
for (std::list<AudioRange>::iterator j = ts.begin(); j != ts.end(); ++j) {
nframes_t i = 0;
int n;

View file

@ -1,4 +1,4 @@
#!/bin/sh
dir=`dirname "$0"`
. $dir/ardev_common.sh
exec gdb gtk2_ardour/ardour.bin $*
exec gdb $EXECUTABLE $*

View file

@ -1,3 +1,3 @@
#!/bin/sh
. `dirname "$0"`/ardev_common.sh
exec gtk2_ardour/ardour.bin --novst $*
exec $EXECUTABLE "$*"

View file

@ -13,3 +13,4 @@ export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
# For the internal clearlooks engine
export GTK_PATH=$PWD/libs/clearlooks:~/.ardour2
EXECUTABLE=gtk2_ardour/ardour-2.0beta10

View file

@ -0,0 +1,16 @@
cd `dirname "$0"`/..
#export G_DEBUG=fatal_criticals
export ARDOUR_PATH=gtk2_ardour/icons:gtk2_ardour/pixmaps:gtk2_ardour
export GTK_PATH=libs/clearlooks
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:$LD_LIBRARY_PATH
# DYLD_LIBRARY_PATH is for darwin.
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
# For the internal clearlooks engine
export GTK_PATH=$PWD/libs/clearlooks:~/.ardour2
EXECUTABLE=gtk2_ardour/ardour-%VERSION%

View file

@ -1,114 +1,311 @@
; this file is NOT an automated accelerator map dump
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<control>space")
(gtk_accel_path "<Actions>/Transport/Forward" "<control>Right")
(gtk_accel_path "<Actions>/Transport/Rewind" "<control>Left")
(gtk_accel_path "<Actions>/Transport/GotoZero" "KP_Insert")
(gtk_accel_path "<Actions>/Transport/GotoStart" "Home")
(gtk_accel_path "<Actions>/Transport/GotoEnd" "End")
(gtk_accel_path "<Actions>/Editor/align-regions-sync-relative" "a")
(gtk_accel_path "<Actions>/Editor/crop" "c")
(gtk_accel_path "<Actions>/Editor/duplicate-region" "d")
(gtk_accel_path "<Actions>/Editor/set-edit-cursor" "e")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g")
(gtk_accel_path "<Actions>/Editor/split-region" "s")
(gtk_accel_path "<Actions>/Editor/set-region-sync-position" "v")
(gtk_accel_path "<Actions>/Editor/mute-unmute-region" "m")
(gtk_accel_path "<Actions>/Editor/insert-region" "i")
(gtk_accel_path "<Actions>/Editor/normalize-region" "n")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-object" "o")
(gtk_accel_path "<Actions>/Transport/loop" "l")
(gtk_accel_path "<Actions>/Editor/set-playhead" "p")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-range" "r")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-timefx" "t")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "z")
(gtk_accel_path "<Actions>/Transport/Record" "<shift>r")
(gtk_accel_path "<Actions>/Editor/nudge-forward" "KP_Add")
(gtk_accel_path "<Actions>/Editor/nudge-next-forward" "<control>KP_Add")
(gtk_accel_path "<Actions>/Editor/nudge-backward" "KP_Subtract")
(gtk_accel_path "<Actions>/Editor/nudge-next-backward" "<control>KP_Subtract")
(gtk_accel_path "<Actions>/Editor/show-editor-mixer" "<shift>e")
(gtk_accel_path "<Actions>/Common/goto-editor" "<alt>e")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<alt>m")
(gtk_accel_path "<Actions>/Common/ToggleSoundFileBrowser" "<alt>f")
(gtk_accel_path "<Actions>/Common/ToggleLocations" "<alt>l")
(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<alt>b")
(gtk_accel_path "<Actions>/Common/ToggleColorManager" "<alt>c")
(gtk_accel_path "<Actions>/Editor/editor-copy" "<control>c")
(gtk_accel_path "<Actions>/Common/Quit" "<control>q")
(gtk_accel_path "<Actions>/Editor/redo" "<control>r")
(gtk_accel_path "<Actions>/Common/Save" "<control>s")
(gtk_accel_path "<Actions>/Editor/editor-paste" "<control>v")
(gtk_accel_path "<Actions>/Editor/editor-cut" "<control>x")
(gtk_accel_path "<Actions>/Editor/editor-delete" "Delete")
(gtk_accel_path "<Actions>/Editor/undo" "<control>z")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-up" "Page_Up")
(gtk_accel_path "<Actions>/Editor/scroll-backward" "leftarrow")
(gtk_accel_path "<Actions>/Editor/scroll-forward" "rightarrow")
(gtk_accel_path "<Actions>/Editor/step-tracks-down" "downarrow")
(gtk_accel_path "<Actions>/Editor/step-tracks-up" "uparrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-edit" "Return")
(gtk_accel_path "<Actions>/Editor/edit-to-playhead" "<Alt>Return")
(gtk_accel_path "<Actions>/Editor/temporal-zoom-in" "minus")
(gtk_accel_path "<Actions>/Editor/temporal-zoom-out" "equal")
(gtk_accel_path "<Actions>/Editor/select-all" "<control>a")
(gtk_accel_path "<Actions>/Editor/select-all-after-edit-cursor" "<shift><Control>e")
(gtk_accel_path "<Actions>/Editor/select-all-before-edit-cursor" "<control>e")
(gtk_accel_path "<Actions>/Editor/select-all-after-playhead" "<shift><Control>p")
(gtk_accel_path "<Actions>/Editor/select-all-before-playhead" "<control>p")
(gtk_accel_path "<Actions>/Editor/select-all-between-cursors" "u")
(gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<Control>d")
(gtk_accel_path "<Actions>/Editor/select-all-in-loop-range" "<Control>l")
(gtk_accel_path "<Actions>/Editor/extend-range-to-start-of-region" "leftanglebracket")
(gtk_accel_path "<Actions>/Editor/extend-range-to-end-of-region" "rightanglebracket")
(gtk_accel_path "<Actions>/Editor/align-regions-sync" "<mod2>a")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<mod2><control>a")
(gtk_accel_path "<Actions>/Editor/align-regions-start-relative" "<shift>a")
(gtk_accel_path "<Actions>/Editor/brush-at-mouse" "<control>b")
(gtk_accel_path "<Actions>/Editor/audition-at-mouse" "period")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-start" "Tab")
; ardour-2.0beta10 GtkAccelMap rc-file -*- scheme -*-
; 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>/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>grave")
; (gtk_accel_path "<Actions>/redirectmenu/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>/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>/options/MeterFalloffSlow" "")
; (gtk_accel_path "<Actions>/RegionList/rlHide" "")
; (gtk_accel_path "<Actions>/Main/Metering" "")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-end" "<Control>Tab")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-start" "grave")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-end" "<control>grave")
; (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>/Editor/edit-cursor-to-previous-region-start" "bracketleft")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-end" "<Control>bracketleft")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-start" "bracketright")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-end" "<Control>bracketright")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "apostrophe")
; (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/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>/Main/Export" "")
(gtk_accel_path "<Actions>/Editor/jump-forward-to-mark" "<Control>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>/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>/Editor/edit-cursor-to-range-start" "F1")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-end" "F2")
; (gtk_accel_path "<Actions>/options/StopRecordingOnXrun" "")
; (gtk_accel_path "<Actions>/Editor/addExternalAudioToRegionList" "")
; (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" "<Control>KP_Left")
; (gtk_accel_path "<Actions>/Main/AudioFileFormatData" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFastest" "")
(gtk_accel_path "<Actions>/Editor/audition-at-mouse" "period")
(gtk_accel_path "<Actions>/Transport/Forward" "<Control>Right")
; (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/scroll-tracks-down" "Page_Down")
; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-minutes" "")
(gtk_accel_path "<Actions>/Editor/normalize-region" "n")
(gtk_accel_path "<Actions>/Editor/nudge-forward" "KP_Add")
; (gtk_accel_path "<Actions>/Main/FlushWastebasket" "")
; (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" "KP_Subtract")
; (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" "<Control>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" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency4096" "")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-up" "Page_Up")
(gtk_accel_path "<Actions>/Editor/set-edit-cursor" "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" "grave")
; (gtk_accel_path "<Actions>/Editor/EditCursorMovementOptions" "")
; (gtk_accel_path "<Actions>/redirectmenu/activate_all" "")
; (gtk_accel_path "<Actions>/Editor/addExternalAudioAsTapeTrack" "")
; (gtk_accel_path "<Actions>/redirectmenu/paste" "")
; (gtk_accel_path "<Actions>/Editor/Smpte25" "")
; (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/step-tracks-down" "downarrow")
; (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" "<Control>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/align-regions-sync-relative" "a")
; (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/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>/Main/Windows" "")
; (gtk_accel_path "<Actions>/Main/CleanupUnused" "")
; (gtk_accel_path "<Actions>/redirectmenu/deselectall" "")
; (gtk_accel_path "<Actions>/options/SoloViaBus" "")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "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>/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>/Snap/snap-to-eighths" "")
(gtk_accel_path "<Actions>/Editor/select-all-after-playhead" "<Shift><Control>p")
(gtk_accel_path "<Actions>/Common/ToggleMaximalEditor" "F11")
(gtk_accel_path "<Actions>/Editor/jump-forward-to-mark" "<control>KP_Right")
(gtk_accel_path "<Actions>/Editor/jump-backward-to-mark" "<control>KP_Left")
(gtk_accel_path "<Actions>/Editor/start-range" "<control>KP_Down")
(gtk_accel_path "<Actions>/Editor/finish-range" "<control>KP_Up")
(gtk_accel_path "<Actions>/Editor/finish-add-range" "<shift><control>KP_Up")
; (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>/RegionList/SortBySourceFileName" "")
(gtk_accel_path "<Actions>/Editor/finish-range" "<Control>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>/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>/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>/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/LayerMoveAddHigher" "")
; (gtk_accel_path "<Actions>/Editor/Smpte60" "")
; (gtk_accel_path "<Actions>/Main/Open" "")
(gtk_accel_path "<Actions>/Editor/scroll-forward" "rightarrow")
; (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" "<Control>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" "F2")
; (gtk_accel_path "<Actions>/redirectmenu/rename" "")
; (gtk_accel_path "<Actions>/RegionList/rlShowAuto" "")
(gtk_accel_path "<Actions>/Editor/select-all-before-playhead" "<Control>p")
; (gtk_accel_path "<Actions>/Editor/addExistingAudioFiles" "")
; (gtk_accel_path "<Actions>/Main/Session" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-start" "F1")
; (gtk_accel_path "<Actions>/Main/AudioFileFormat" "")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-timefx" "t")
; (gtk_accel_path "<Actions>/Transport/Transport" "")
; (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>/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>/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>/Editor/PullupMinus4" "")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<Alt>m")
; (gtk_accel_path "<Actions>/Editor/addExternalAudioToTrack" "")
; (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>/Editor/addExternalAudioAsTrack" "")
(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<Alt>b")
; (gtk_accel_path "<Actions>/Snap/snap-to-asixteenthbeat" "")
(gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<Control>d")
; (gtk_accel_path "<Actions>/redirectmenu/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>/options/FileHeaderFormatWAVE" "")
(gtk_accel_path "<Actions>/Transport/GotoZero" "KP_Insert")
(gtk_accel_path "<Actions>/Transport/GotoEnd" "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" "<Alt>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>/RegionList/rlShowAll" "")
(gtk_accel_path "<Actions>/Transport/Rewind" "<Control>Left")
; (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" "Tab")
; (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/Subframes80" "")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatCAF" "")
(gtk_accel_path "<Actions>/Common/ToggleLocations" "<Alt>l")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurface" "")
(gtk_accel_path "<Actions>/Editor/editor-delete" "Delete")
; (gtk_accel_path "<Actions>/JACK/JACKLatency256" "")
(gtk_accel_path "<Actions>/Editor/select-all-between-cursors" "u")
; (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" "<Control>c")
; (gtk_accel_path "<Actions>/Snap/snap-to-quarters" "")
(gtk_accel_path "<Actions>/Editor/temporal-zoom-out" "equal")
; (gtk_accel_path "<Actions>/options/UseSoftwareMonitoring" "")
; (gtk_accel_path "<Actions>/Editor/Subframes100" "")
(gtk_accel_path "<Actions>/Editor/mute-unmute-region" "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>/Editor/edit-cursor-to-next-region-end" "<Control>bracketright")
; (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" "")

View file

@ -81,6 +81,7 @@
<menuitem action='editor-delete'/>
<menuitem action='editor-copy'/>
<menuitem action='editor-paste'/>
<menuitem action='remove-last-capture'/>
<separator/>
<menu action="EditSelectRangeOptions">
<menuitem action='extend-range-to-start-of-region'/>
@ -122,6 +123,21 @@
<menuitem action="nudge-backward"/>
<menuitem action="nudge-next-backward"/>
</menu>
<menu name='KeyMouse Actions' action='KeyMouse Actions'>
<menuitem action='audition-at-mouse'/>
<menuitem action='brush-at-mouse'/>
<menuitem action='set-edit-cursor'/>
<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'/>
<menuitem action='set-mouse-mode-range'/>
<menuitem action='set-mouse-mode-gain'/>
<menuitem action='set-mouse-mode-zoom'/>
<menuitem action='set-mouse-mode-timefx'/>
</menu>
</menu>
<menu name='View' action = 'View'>
<menu name='ZoomFocus' action='ZoomFocus'>
@ -214,13 +230,11 @@
<menuitem action='goto-editor'/>
<menuitem action='goto-mixer'/>
<menuitem action='ToggleOptionsEditor'/>
<menuitem action='ToggleSoundFileBrowser'/>
<menuitem action='ToggleInspector'/>
<menuitem action='ToggleLocations'/>
<menuitem action='ToggleColorManager'/>
<menuitem action='ToggleBigClock'/>
<separator/>
<menuitem action='About'/>
</menu>
<menu name='Options' action='Options'>
<menu action='AudioFileFormat'>
@ -240,10 +254,10 @@
<menuitem action='Smpte24'/>
<menuitem action='Smpte24976'/>
<menuitem action='Smpte25'/>
<menuitem action='Smpte2997drop'/>
<menuitem action='Smpte2997'/>
<menuitem action='Smpte30drop'/>
<menuitem action='Smpte2997drop'/>
<menuitem action='Smpte30'/>
<menuitem action='Smpte30drop'/>
<menuitem action='Smpte5994'/>
<menuitem action='Smpte60'/>
</menu>
@ -258,6 +272,10 @@
<menuitem action='PullupMinus4'/>
<menuitem action='PullupMinus4Minus1'/>
</menu>
<menu action='Subframes'>
<menuitem action='Subframes80'/>
<menuitem action='Subframes100'/>
</menu>
<separator/>
<menu action='Autoconnect'>
<menuitem action='InputAutoConnectPhysical'/>
@ -324,21 +342,7 @@
<separator/>
</menu>
<menu name='Help' action='Help'>
<menu name='KeyMouse Actions' action='KeyMouse Actions'>
<menuitem action='audition-at-mouse'/>
<menuitem action='brush-at-mouse'/>
<menuitem action='set-edit-cursor'/>
<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'/>
<menuitem action='set-mouse-mode-range'/>
<menuitem action='set-mouse-mode-gain'/>
<menuitem action='set-mouse-mode-zoom'/>
<menuitem action='set-mouse-mode-timefx'/>
</menu>
<menuitem action='About'/>
</menu>
</menubar>

View file

@ -1,11 +1,11 @@
#!/bin/sh
export GTK_PATH=%INSTALL_PREFIX%/lib/ardour2:$GTK_PATH
export GTK_PATH=%INSTALL_PREFIX%/%LIBDIR%/ardour2:$GTK_PATH
export LD_LIBRARY_PATH=%INSTALL_PREFIX%/lib/ardour2:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=%INSTALL_PREFIX%/%LIBDIR%/ardour2:$LD_LIBRARY_PATH
# DYLD_LIBRARY_PATH is for Darwin
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
exec %INSTALL_PREFIX%/lib/ardour2/ardour.bin $*
exec %INSTALL_PREFIX%/%LIBDIR%/ardour2/ardour-%VERSION% $*

View file

@ -58,6 +58,11 @@ style "plugin_maker_text"
fg[NORMAL] = { 0.80, 0.80, 0.80 }
}
style "automation_track_name"
{
font_name = "sans italic 8"
}
style "first_action_message"
{
font_name = "sans medium 34"
@ -75,7 +80,7 @@ style "marker_text"
style "time_axis_view_item_name"
{
font_name = "sans medium 8"
font_name = "sans 6"
}
style "default_base" = "medium_text"
@ -137,8 +142,9 @@ style "transport_base" = "medium_bold_text"
bg[SELECTED] = { 0, 0, 0 }
}
/*
style "black_mackie_menu_bar" = "medium_bold_text"
style "black_mackie_menu_bar"
{
font_name = "sans bold 9"
fg[NORMAL] = { 1.0, 1.0, 1.0 }
bg[NORMAL] = { 0, 0, 0 }
}
@ -190,6 +196,12 @@ style "track_rec_enable_button" = "small_button"
bg[PRELIGHT] = { 1.0, 0.0, 0.0 }
}
style "gain_fader"
{
bg[NORMAL] = { 0.269, 0.269, 0.300}
bg[ACTIVE] = { 0.152, 0.152, 0.168 }
}
style "mixer_rec_enable_button" = "track_rec_enable_button"
{
font_name = "sans 7"
@ -442,12 +454,17 @@ style "medium_bold_entry" = "medium_bold_text"
base[SELECTED] = { 0, 0, 0 }
}
style "small_entry" = "small_text"
{
fg[NORMAL] = { 0.70, 0.70, 0.70 }
fg[ACTIVE] = { 0.70, 0.70, 0.70 }
fg[ACTIVE] = { 0, 1.0, 0 }
fg[SELECTED] = { 0, 1.0, 0 }
text[NORMAL] = { 0.70, 0.70, 0.70 }
text[ACTIVE] = { 0, 1.0, 0 }
text[SELECTED] = { 0, 1.0, 0 }
bg[NORMAL] = { 0.0, 0.0, 0.0 }
bg[SELECTED] = { 0.0, 0.0, 0.0 }
bg[SELECTED] = { 0.0, 0.0, 0.0 }
base[NORMAL] = { 0, 0, 0 }
base[ACTIVE] = { 0, 0, 0 }
base[SELECTED] = { 0, 0, 0 }
@ -481,9 +498,25 @@ style "small_red_on_black_entry" = "small_bold_text"
bg[ACTIVE] = { 0.0, 0.0, 0.0 }
}
style "big_clock_display" = "medium_entry"
style "non_recording_big_clock_display" = "medium_entry"
{
font_name = "courier bold 34"
font_name = "sans 60"
fg[NORMAL] = { 0.50, 1.0, 0.50 }
fg[ACTIVE] = { 1.0, 0, 0.0 }
fg[SELECTED] = { 1.0, 0, 0 }
fg[PRELIGHT] = { 1.0, 0, 0.0 }
fg[INSENSITIVE] = { 1.0, 0, 0.0 }
base[NORMAL] = { 0.0, 0.0, 0.0 }
base[ACTIVE] = { 0.0, 0.0, 0.0 }
bg[NORMAL] = { 0.0, 0.0, 0.0 }
bg[ACTIVE] = { 0.7, 0.0, 0.0 }
}
style "recording_big_clock_display" = "non_recording_big_clock_display"
{
fg[NORMAL] = { 1.0, 0, 0 }
}
style "transport_clock_display"
@ -504,7 +537,7 @@ style "transport_clock_display"
style "tempo_meter_clock_display"
{
font_name = "sans 8"
font_name = "sans 7"
fg[NORMAL] = { 1.0, 1.0, 1.0 }
fg[ACTIVE] = { 1.0, 1.0, 0.0 }
fg[SELECTED] = { 1.0, 0, 0 }
@ -836,16 +869,16 @@ style "flashing_alert" = "very_small_text"
style "selected_io_selector_port_list" = "medium_bold_text"
{
GtkTreeView::even-row-color = { 0.64, 0.68, 0.54 }
GtkTreeView::odd-row-color = { 0.64, 0.68, 0.54 }
GtkTreeView::even-row-color = { 0, 0, 0 }
GtkTreeView::odd-row-color = { 0, 0, 0 }
# fg is used to color the fg (text) of the column header button
fg[NORMAL] = { 0.80, 0.80, 0.70 }
fg[SELECTED] = { 0.80, 0.80, 0.70 }
fg[ACTIVE] = { 0.80, 0.80, 0.70 }
fg[PRELIGHT] = { 0.80, 0.80, 0.70 }
fg[INSENSITIVE] = { 0.80, 0.80, 0.70 }
fg[NORMAL] = { 0.85, 0.85, 0.85 }
fg[SELECTED] = { 0.85, 0.85, 0.85 }
fg[ACTIVE] = { 0.85, 0.85, 0.85 }
fg[PRELIGHT] = { 0.85, 0.85, 0.85 }
fg[INSENSITIVE] = { 0.85, 0.85, 0.85 }
# bg is used used to color the background of the column header button
@ -857,29 +890,30 @@ style "selected_io_selector_port_list" = "medium_bold_text"
# text is used to color the treeview row text
text[NORMAL] = { 0.80, 0.80, 0.70 }
text[SELECTED] = { 0.80, 0.80, 0.70 }
text[NORMAL] = { 0.85, 0.85, 0.85 }
text[SELECTED] = { 0.85, 0.85, 0.85 }
# base is used to color a treeview with no rows
base[NORMAL] = { 0.64, 0.68, 0.54 }
base[ACTIVE] = { 0.64, 0.68, 0.54 }
base[PRELIGHT] = { 0.64, 0.68, 0.54 }
base[INSENSITIVE] = { 0.64, 0.68, 0.54 }
base[SELECTED] = { 0.64, 0.68, 0.54 }
base[NORMAL] = { 0.20, 0.20, 0.25 }
base[ACTIVE] = { 0.20, 0.20, 0.25 }
base[PRELIGHT] = { 0.20, 0.20, 0.25 }
base[INSENSITIVE] = { 0.20, 0.20, 0.25 }
base[SELECTED] = { 0.20, 0.20, 0.25 }
}
style "io_selector_port_list" = "medium_text"
{
GtkTreeView::even-row-color = { 0.20, 0.20, 0.25 }
GtkTreeView::odd-row-color = { 0.20, 0.20, 0.25 }
# fg is used to color the fg (text) of the column header button
fg[NORMAL] = { 0.80, 0.80, 0.70 }
fg[SELECTED] = { 0.80, 0.80, 0.70 }
fg[ACTIVE] = { 0.80, 0.80, 0.70 }
fg[PRELIGHT] = { 0.80, 0.80, 0.70 }
fg[INSENSITIVE] = { 0.80, 0.80, 0.70 }
fg[NORMAL] = { 0.70, 0.70, 0.70 }
fg[SELECTED] = { 0.70, 0.70, 0.70 }
fg[ACTIVE] = { 0.70, 0.70, 0.70 }
fg[PRELIGHT] = { 0.70, 0.70, 0.70 }
fg[INSENSITIVE] = { 0.70, 0.70, 0.70 }
# bg is used used to color the background of the column header button
@ -891,16 +925,16 @@ style "io_selector_port_list" = "medium_text"
# text is used to color the treeview row text
text[NORMAL] = { 0.80, 0.80, 0.70 }
text[SELECTED] = { 0.80, 0.80, 0.70 }
text[NORMAL] = { 0.80, 0.80, 0.80 }
text[SELECTED] = { 0.80, 0.80, 0.80 }
# base is used to color a treeview with no rows
base[NORMAL] = { 0, 0, 0 }
base[ACTIVE] = { 0, 0, 0 }
base[PRELIGHT] = { 0, 0, 0 }
base[INSENSITIVE] = { 0, 0, 0 }
base[SELECTED] = { 0, 0, 0 }
base[NORMAL] = { 0.20, 0.20, 0.25 }
base[ACTIVE] = { 0.20, 0.20, 0.25 }
base[PRELIGHT] = { 0.20, 0.20, 0.25 }
base[INSENSITIVE] = { 0.20, 0.20, 0.25 }
base[SELECTED] = { 0.20, 0.20, 0.25 }
}
style "io_selector_notebook" = "default_base"
@ -937,15 +971,15 @@ style "pan_slider"
{
font_name = "sans 8"
fg[NORMAL] = { 0.67, 0.23, 0.22 }
fg[ACTIVE] = { 0.67, 0.23, 0.22 }
fg[INSENSITIVE] = {0.32, 0.39, 0.45 } # matches default_base
fg[NORMAL] = { 0.22, 0.73, 0.22 }
fg[ACTIVE] = { 0.22, 0.73, 0.22 }
fg[INSENSITIVE] = {0.22, 0.53, 0.22 }
fg[SELECTED] = { 0.67, 0.23, 0.22 }
fg[PRELIGHT] = { 0.67, 0.23, 0.22 }
bg[NORMAL] = { 0, 0, 0 }
bg[NORMAL] = { 0.05, 0.05, 0.05 }
bg[ACTIVE] = { 0, 0, 0 }
bg[INSENSITIVE] = {0.32, 0.39, 0.45 } # matches default_base
bg[INSENSITIVE] = {0.12, 0.19, 0.25 }
bg[SELECTED] = { 0, 0, 0 }
bg[PRELIGHT] = { 0, 0, 0 }
@ -954,6 +988,15 @@ style "pan_slider"
text[INSENSITIVE] = { 0.70, 0.70, 0.70 }
text[SELECTED] = { 0.70, 0.70, 0.70 }
text[PRELIGHT] = { 0.70, 0.70, 0.70 }
# used to draw the triangular indicators
base[NORMAL] = { 0.80, 0.80, 0.80 }
base[ACTIVE] = { 0.80, 0.80, 0.80 }
base[INSENSITIVE] = {0.6, 0.6, 0.6 }
base[SELECTED] = { 0.80, 0.80, 0.80 }
base[PRELIGHT] = { 0.80, 0.80, 0.80 }
}
style "region_list_whole_file"
@ -971,7 +1014,7 @@ style "ardour_button" ="default_buttons_menus"
widget "*FirstActionMessage" style "first_action_message"
widget "*VerboseCanvasCursor" style "verbose_canvas_cursor"
widget "*MarkerText" style "marker_text"
widget "*TimeAxisViewItemName" style "time_axis_view_item_name"
widget "*TimeAxisViewItemName*" style "time_axis_view_item_name"
#widget "*ExportProgress" style "default_buttons_menus"
widget "*ExportFileLabel" style "small_bold_text"
widget "*ExportFormatLabel" style "medium_bold_text"
@ -1073,11 +1116,16 @@ widget "*ErrorMessage" style "error_message"
widget "*FatalMessage" style "fatal_message"
widget "*InfoMessage" style "info_message"
widget "*WarningMessage" style "warning_message"
widget "*BigClockDisplay" style "big_clock_display"
widget "*BigClockNonRecording" style "non_recording_big_clock_display"
widget "*BigClockRecording" style "recording_big_clock_display"
widget "*TransportClockDisplay" style "transport_clock_display"
widget "*SecondaryClockDisplay" style "transport_clock_display"
widget "*BBTTempoLabel" style "tempo_meter_clock_display"
widget "*BBTMeterLabel" style "tempo_meter_clock_display"
widget "*AudioClockFramesUpperInfo" style "tempo_meter_clock_display"
widget "*AudioClockFramesLowerInfo" style "tempo_meter_clock_display"
widget "*AudioClockSMPTEUpperInfo" style "tempo_meter_clock_display"
widget "*AudioClockSMPTELowerInfo" style "tempo_meter_clock_display"
widget "*AudioClockBBTUpperInfo" style "tempo_meter_clock_display"
widget "*AudioClockBBTLowerInfo" style "tempo_meter_clock_display"
widget "*SelectionStartClock" style "default_clock_display"
widget "*SelectionEndClock" style "default_clock_display"
widget "*EditCursorClock" style "default_clock_display"
@ -1115,9 +1163,9 @@ widget "*AudioBusControlsBaseSelected" style "edit_controls_base_selected"
widget "*AudioTimeAxisViewControlsBaseUnselected" style "audio_track_base"
widget "*AudioTrackStripBase" style "audio_track_base"
widget "*AudioTrackControlsBaseUnselected" style "audio_track_base"
widget "*AudioTrackFader" style "audio_track_base"
widget "*AudioTrackFader" style "gain_fader"
widget "*AudioBusStripBase" style "audio_bus_base"
widget "*AudioBusFader" style "audio_bus_base"
widget "*AudioBusFader" style "gain_fader"
widget "*MidiBusControlsBaseUnselected" style "midi_bus_base"
widget "*MidiBusControlsBaseInactiveUnselected" style "track_controls_inactive"
widget "*MidiBusControlsBaseInactiveSelected" style "track_controls_inactive"
@ -1153,6 +1201,7 @@ widget "*MouseModeButton*" style "default_buttons_menus"
widget "*EditorMainCanvas" style "main_canvas_area"
widget "*AudioTrackControlsBaseInactiveUnselected" style "track_controls_inactive"
widget "*AutomationTrackControlsBaseInactiveUnselected" style "track_controls_inactive"
widget "*AutomationTrackName" style "automation_track_name"
widget "*AudioTrackControlsBaseInactiveSelected" style "track_controls_inactive"
widget "*AutomationTrackControlsBaseInactiveSelected" style "track_controls_inactive"
widget "*AudioTrackStripBaseInactive" style "track_controls_inactive"
@ -1196,6 +1245,7 @@ widget "*MixerStripSpeedBase*" style "small_entry"
widget "*MixerStripSpeedBaseNotOne" style "small_red_on_black_entry"
widget "*MixerStripSpeedBaseNotOne*" style "small_red_on_black_entry"
widget "*MixerStripGainDisplay" style "small_entry"
widget "*MixerStripGainDisplay*" style "small_entry"
widget "*MixerStripGainUnitButton" style "very_small_button"
widget "*MixerStripGainUnitButton*" style "very_small_button"
widget "*MixerStripMeterPreButton" style "very_small_button"

View file

@ -38,6 +38,7 @@
#include <pbd/compose.h>
#include <pbd/pathscanner.h>
#include <pbd/failed_constructor.h>
#include <pbd/enumwriter.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/click_box.h>
@ -96,10 +97,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
: Gtkmm2ext::UI ("ardour", argcp, argvp, rcfile),
primary_clock (X_("TransportClockDisplay"), true, false, true),
secondary_clock (X_("SecondaryClockDisplay"), true, false, true),
preroll_clock (X_("PreRollClock"), true, true),
postroll_clock (X_("PostRollClock"), true, true),
primary_clock (X_("primary"), false, X_("TransportClockDisplay"), true, false, true),
secondary_clock (X_("secondary"), false, X_("SecondaryClockDisplay"), true, false, true),
preroll_clock (X_("preroll"), false, X_("PreRollClock"), true, true),
postroll_clock (X_("postroll"), false, X_("PostRollClock"), true, true),
/* adjuster table */
@ -112,7 +113,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
/* big clock */
big_clock ("BigClockDisplay", true),
big_clock (X_("bigclock"), false, "BigClockNonRecording", true, false, true),
/* transport */
@ -145,7 +146,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
color_manager = new ColorManager();
std::string color_file = ARDOUR::find_config_file("ardour.colors");
color_manager->load (color_file);
editor = 0;
@ -160,7 +161,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
route_params = 0;
option_editor = 0;
location_ui = 0;
sfdb = 0;
open_session_selector = 0;
have_configure_timeout = false;
have_disk_overrun_displayed = false;
@ -168,6 +168,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
_will_create_new_session_automatically = false;
session_loaded = false;
last_speed_displayed = -1.0f;
keybindings_path = ARDOUR::find_config_file ("ardour.bindings");
can_save_keybindings = false;
Glib::signal_idle().connect (mem_fun (*this, &ARDOUR_UI::first_idle));
last_configure_time.tv_sec = 0;
last_configure_time.tv_usec = 0;
@ -248,6 +252,10 @@ ARDOUR_UI::set_engine (AudioEngine& e)
throw failed_constructor();
}
/* listen to clock mode changes */
AudioClock::ModeChanged.connect (mem_fun (*this, &ARDOUR_UI::store_clock_modes));
/* start the time-of-day-clock */
update_wall_clock ();
@ -349,22 +357,13 @@ ARDOUR_UI::save_ardour_state ()
Config->add_instant_xml (mnode, get_user_ardour_path());
}
/* keybindings */
AccelMap::save ("ardour.saved_bindings");
save_keybindings ();
}
void
ARDOUR_UI::startup ()
{
/* Once the UI is up and running, start the audio engine. Doing
this before the UI is up and running can cause problems
when not running with SCHED_FIFO, because the amount of
CPU and disk work needed to get the UI started can interfere
with the scheduling of the audio thread.
*/
Glib::signal_idle().connect (mem_fun(*this, &ARDOUR_UI::start_engine));
// relax
}
void
@ -392,6 +391,11 @@ If you still wish to quit, please use the\n\n\
break;
}
}
if (session) {
session->set_deletion_in_progress ();
}
engine->stop (true);
Config->save_state();
quit ();
}
@ -448,7 +452,8 @@ ARDOUR_UI::ask_about_saving_session (const string & what)
save_the_session = 0;
editor->ensure_float (window);
window.set_keep_above (true);
window.present ();
ResponseType r = (ResponseType) window.run();
@ -1303,14 +1308,6 @@ ARDOUR_UI::do_engine_start ()
engine->start();
}
catch (AudioEngine::PortRegistrationFailure& err) {
engine->stop ();
error << _("Unable to create all required ports")
<< endmsg;
unload_session ();
return -1;
}
catch (...) {
engine->stop ();
error << _("Unable to start the session running")
@ -1332,14 +1329,6 @@ ARDOUR_UI::start_engine ()
*/
session->save_state ("");
}
/* there is too much going on, in too many threads, for us to
end up with a clean session. So wait 1 second after loading,
and fix it up. its ugly, but until i come across a better
solution, its what we have.
*/
Glib::signal_timeout().connect (mem_fun(*this, &ARDOUR_UI::make_session_clean), 1000);
}
return FALSE;
@ -1348,7 +1337,9 @@ ARDOUR_UI::start_engine ()
void
ARDOUR_UI::update_clocks ()
{
Clock (session->audible_frame()); /* EMIT_SIGNAL */
if (!editor || !editor->dragging_playhead()) {
Clock (session->audible_frame()); /* EMIT_SIGNAL */
}
}
void
@ -1635,7 +1626,7 @@ ARDOUR_UI::save_template ()
}
void
ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
ARDOUR_UI::new_session (std::string predetermined_path)
{
string session_name;
string session_path;
@ -1748,7 +1739,7 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
msg.set_name (X_("CleanupDialog"));
msg.set_wmclass (_("existing_session"), "Ardour");
msg.set_wmclass (X_("existing_session"), "Ardour");
msg.set_position (Gtk::WIN_POS_MOUSE);
switch (msg.run()) {
@ -1854,9 +1845,8 @@ 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)) {
MessageDialog msg (*editor, _("\
You do not have write access to this session.\n\
This prevents the session from being loaded."));
MessageDialog msg (*editor, _("You do not have write access to this session.\n"
"This prevents the session from being loaded."));
msg.run ();
return -1;
}
@ -1876,22 +1866,14 @@ This prevents the session from being loaded."));
Config->set_current_owner (ConfigVariableBase::Interface);
session_loaded = true;
goto_editor_window ();
return 0;
}
int
ARDOUR_UI::make_session_clean ()
{
if (session) {
session->set_clean ();
}
show ();
return FALSE;
return 0;
}
int
@ -2096,7 +2078,7 @@ After cleanup, unused audio files will be moved to a \
checker.set_default_response (RESPONSE_CANCEL);
checker.set_name (_("CleanupDialog"));
checker.set_wmclass (_("ardour_cleanup"), "Ardour");
checker.set_wmclass (X_("ardour_cleanup"), "Ardour");
checker.set_position (Gtk::WIN_POS_MOUSE);
switch (checker.run()) {
@ -2396,7 +2378,7 @@ ARDOUR_UI::cmdline_new_session (string path)
path = str;
}
new_session (false, path);
new_session (path);
_will_create_new_session_automatically = false; /* done it */
return FALSE; /* don't call it again */
@ -2450,3 +2432,69 @@ ARDOUR_UI::use_config ()
ract->set_active ();
}
}
void
ARDOUR_UI::update_transport_clocks (nframes_t pos)
{
primary_clock.set (pos);
secondary_clock.set (pos);
if (big_clock_window) {
big_clock.set (pos);
}
}
void
ARDOUR_UI::record_state_changed ()
{
if (!session || !big_clock_window) {
/* why bother - the clock isn't visible */
return;
}
switch (session->record_status()) {
case Session::Recording:
big_clock.set_name ("BigClockRecording");
break;
default:
big_clock.set_name ("BigClockNonRecording");
break;
}
}
void
ARDOUR_UI::set_keybindings_path (string path)
{
keybindings_path = path;
}
void
ARDOUR_UI::save_keybindings ()
{
if (can_save_keybindings) {
AccelMap::save (keybindings_path);
}
}
bool
ARDOUR_UI::first_idle ()
{
can_save_keybindings = true;
return false;
}
void
ARDOUR_UI::store_clock_modes ()
{
XMLNode* node = new XMLNode(X_("ClockModes"));
for (vector<AudioClock*>::iterator x = AudioClock::clocks.begin(); x != AudioClock::clocks.end(); ++x) {
node->add_property ((*x)->name().c_str(), enum_2_string ((*x)->mode()));
}
session->add_extra_xml (*node);
session->set_dirty ();
}

View file

@ -70,7 +70,6 @@ class OptionEditor;
class Mixer_UI;
class ConnectionEditor;
class RouteParams_UI;
class SoundFileBrowser;
class About;
class AddRouteDialog;
class NewSessionDialog;
@ -129,7 +128,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
_will_create_new_session_automatically = yn;
}
void new_session(bool startup = false, std::string path = string());
void new_session(std::string path = string());
gint cmdline_new_session (string path);
int unload_session ();
void close_session();
@ -185,6 +184,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
AudioClock preroll_clock;
AudioClock postroll_clock;
void store_clock_modes ();
void restore_clock_modes ();
void add_route ();
void session_add_audio_track (int input_channels, int32_t output_channels, ARDOUR::TrackMode mode, uint32_t how_many) {
@ -204,6 +206,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
}*/
void set_engine (ARDOUR::AudioEngine&);
gint start_engine ();
gint exit_on_main_window_close (GdkEventAny *);
@ -213,6 +216,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void set_native_file_header_format (ARDOUR::HeaderFormat sf);
void set_native_file_data_format (ARDOUR::SampleFormat sf);
void set_keybindings_path (std::string path);
void save_keybindings ();
protected:
friend class PublicEditor;
@ -297,7 +303,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void queue_transport_change ();
void map_transport_state ();
int32_t do_engine_start ();
gint start_engine ();
void engine_halted ();
void engine_stopped ();
@ -331,6 +336,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
Gtk::Frame big_clock_frame;
Gtk::Window* big_clock_window;
void update_transport_clocks (nframes_t pos);
void record_state_changed ();
/* Transport Control */
void detach_tearoff (Gtk::Box* parent, Gtk::Widget* contents);
@ -538,6 +546,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void connect_to_session (ARDOUR::Session *);
void connect_dependents_to_session (ARDOUR::Session *);
void we_have_dependents ();
std::string keybindings_path;
void setup_keybindings ();
void setup_session_options ();
@ -570,11 +581,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
/* route dialog */
AddRouteDialog *add_route_dialog;
/* SoundFile Browser */
SoundFileBrowser *sfdb;
void toggle_sound_file_browser ();
int create_sound_file_browser ();
/* Keyboard Handling */
@ -669,7 +675,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void map_meter_falloff ();
void toggle_control_protocol (ARDOUR::ControlProtocolInfo*);
void toggle_control_protocol_feedback (ARDOUR::ControlProtocolInfo*, const char* group_name, const char* action_name);
void toggle_control_protocol_feedback (ARDOUR::ControlProtocolInfo*, const char* group_name, std::string action_name);
bool can_save_keybindings;
bool first_idle ();
};
#endif /* __ardour_gui_h__ */

View file

@ -609,7 +609,7 @@ ARDOUR_UI::show_shuttle_context_menu ()
build_shuttle_context_menu ();
}
shuttle_context_menu->popup (1, 0);
shuttle_context_menu->popup (1, gtk_get_current_event_time());
}
void
@ -815,7 +815,7 @@ ARDOUR_UI::shuttle_unit_clicked ()
if (shuttle_unit_menu == 0) {
shuttle_unit_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("/ShuttleUnitPopup"));
}
shuttle_unit_menu->popup (1, 0);
shuttle_unit_menu->popup (1, gtk_get_current_event_time());
}
void

View file

@ -27,6 +27,7 @@
#include <gtkmm/accelmap.h>
#include <pbd/error.h>
#include "ardour_ui.h"
#include "public_editor.h"
#include "mixer_ui.h"
@ -57,6 +58,17 @@ void
ARDOUR_UI::we_have_dependents ()
{
setup_keybindings ();
editor->UpdateAllTransportClocks.connect (mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
}
static void
accel_map_changed (GtkAccelMap* map,
gchar* path,
guint key,
GdkModifierType mod,
gpointer arg)
{
static_cast<ARDOUR_UI*>(arg)->save_keybindings ();
}
void
@ -65,13 +77,20 @@ ARDOUR_UI::setup_keybindings ()
install_actions ();
RedirectBox::register_actions ();
std::string key_binding_file = ARDOUR::find_config_file("ardour.bindings");
cerr << "loading bindings from " << keybindings_path << endl;
try {
AccelMap::load (key_binding_file);
AccelMap::load (keybindings_path);
} catch (...) {
error << "ardour key bindings file not found" << endmsg;
error << string_compose (_("Ardour key bindings file not found at \"%1\" or contains errors."), keybindings_path)
<< endmsg;
}
/* catch changes */
GtkAccelMap* accelmap = gtk_accel_map_get();
g_signal_connect (accelmap, "changed", (GCallback) accel_map_changed, this);
}
void
@ -81,8 +100,8 @@ ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
mixer->connect_to_session (s);
/* its safe to do this now */
s->restore_history (s->snap_name());
s->restore_history ("");
}
void

View file

@ -50,6 +50,7 @@ ARDOUR_UI::connect_to_session (Session *s)
session = s;
session->HaltOnXrun.connect (mem_fun(*this, &ARDOUR_UI::halt_on_xrun_message));
session->RecordStateChanged.connect (mem_fun (*this, &ARDOUR_UI::record_state_changed));
/* sensitize menu bar options that are now valid */
@ -92,10 +93,6 @@ ARDOUR_UI::connect_to_session (Session *s)
option_editor->set_session (s);
}
if (sfdb) {
sfdb->set_session (s);
}
setup_session_options ();
Blink.connect (mem_fun(*this, &ARDOUR_UI::transport_rec_enable_blink));
@ -345,36 +342,6 @@ ARDOUR_UI::toggle_route_params_window ()
}
}
int
ARDOUR_UI::create_sound_file_browser ()
{
if (sfdb == 0) {
sfdb = new SoundFileBrowser (_("Sound File Browser"), session);
sfdb->signal_unmap().connect (sigc::bind(sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleSoundFileBrowser")));
}
return 0;
}
void
ARDOUR_UI::toggle_sound_file_browser ()
{
if (create_sound_file_browser()) {
return;
}
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleSoundFileBrowser"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
sfdb->show_all();
sfdb->present();
} else {
sfdb->hide ();
}
}
}
void
ARDOUR_UI::handle_locations_change (Location* ignored)
{

View file

@ -80,7 +80,7 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (main_actions, X_("Sync"), _("Sync"));
ActionManager::register_action (main_actions, X_("Options"), _("Options"));
ActionManager::register_action (main_actions, X_("TransportOptions"), _("Options"));
ActionManager::register_action (main_actions, X_("Help"), _("Help"));
ActionManager::register_action (main_actions, X_("Help"), _("Help"));
ActionManager::register_action (main_actions, X_("KeyMouse Actions"), _("KeyMouse Actions"));
ActionManager::register_action (main_actions, X_("AudioFileFormat"), _("Audio File Format"));
ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("Header"));
@ -92,7 +92,7 @@ ARDOUR_UI::install_actions ()
/* the real actions */
act = ActionManager::register_action (main_actions, X_("New"), _("New"), bind (mem_fun(*this, &ARDOUR_UI::new_session), false, string ()));
act = ActionManager::register_action (main_actions, X_("New"), _("New"), bind (mem_fun(*this, &ARDOUR_UI::new_session), string ()));
ActionManager::register_action (main_actions, X_("Open"), _("Open"), mem_fun(*this, &ARDOUR_UI::open_session));
ActionManager::register_action (main_actions, X_("Recent"), _("Recent"), mem_fun(*this, &ARDOUR_UI::open_recent_session));
@ -189,7 +189,6 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (common_actions, X_("goto-editor"), _("Show Editor"), mem_fun(*this, &ARDOUR_UI::goto_editor_window));
ActionManager::register_action (common_actions, X_("goto-mixer"), _("Show Mixer"), mem_fun(*this, &ARDOUR_UI::goto_mixer_window));
ActionManager::register_toggle_action (common_actions, X_("ToggleSoundFileBrowser"), _("Sound File Browser"), mem_fun(*this, &ARDOUR_UI::toggle_sound_file_browser));
ActionManager::register_toggle_action (common_actions, X_("ToggleOptionsEditor"), _("Options Editor"), mem_fun(*this, &ARDOUR_UI::toggle_options_window));
act = ActionManager::register_toggle_action (common_actions, X_("ToggleInspector"), _("Track/Bus Inspector"), mem_fun(*this, &ARDOUR_UI::toggle_route_params_window));
ActionManager::session_sensitive_actions.push_back (act);
@ -483,7 +482,7 @@ ARDOUR_UI::toggle_control_protocol (ControlProtocolInfo* cpi)
}
void
ARDOUR_UI::toggle_control_protocol_feedback (ControlProtocolInfo* cpi, const char* group, const char* action)
ARDOUR_UI::toggle_control_protocol_feedback (ControlProtocolInfo* cpi, const char* group, string action)
{
if (!session) {
/* this happens when we build the menu bar when control protocol support
@ -494,14 +493,17 @@ ARDOUR_UI::toggle_control_protocol_feedback (ControlProtocolInfo* cpi, const cha
}
if (cpi->protocol) {
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (group, action);
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (group, action.c_str());
if (act) {
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
bool x = tact->get_active();
if (tact && x != cpi->protocol->get_feedback()) {
cpi->protocol->set_feedback (!x);
if (tact) {
bool x = tact->get_active();
if (x != cpi->protocol->get_feedback()) {
cpi->protocol->set_feedback (x);
}
}
}
}
@ -556,7 +558,7 @@ ARDOUR_UI::build_control_surface_menu ()
(bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol_feedback),
*i,
"Editor",
action_name.c_str())));
action_name)));
ui += "<menu action='";
ui += submenu_name;

View file

@ -236,7 +236,7 @@ ARDOUR_UI::set_monitor_model (MonitorModel model)
break;
default:
fatal << string_compose (_("programming error: unknown solo model in ARDOUR_UI::set_solo_model: %1"), model) << endmsg;
fatal << string_compose (_("programming error: unknown monitor model in ARDOUR_UI::set_monitor_model: %1"), model) << endmsg;
/*NOTREACHED*/
}
@ -416,9 +416,9 @@ ARDOUR_UI::map_solo_model ()
const char* on;
if (Config->get_solo_model() == InverseMute) {
on = "SoloInPlace";
on = X_("SoloInPlace");
} else {
on = "SoloViaBus";
on = X_("SoloViaBus");
}
Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
@ -587,10 +587,8 @@ ARDOUR_UI::map_meter_falloff ()
{
const char* action = X_("MeterFalloffMedium");
/* XXX hack alert. Fix this. Please */
float val = Config->get_meter_falloff ();
MeterFalloff code = (MeterFalloff) (int) (floor (val));
MeterFalloff code = meter_falloff_from_float(val);
switch (code) {
case MeterFalloffOff:
@ -840,6 +838,14 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
map_meter_falloff ();
} else if (PARAM_IS ("verify-remove-last-capture")) {
ActionManager::map_some_state ("options", "VerifyRemoveLastCapture", &Configuration::get_verify_remove_last_capture);
} else if (PARAM_IS ("video-pullup") || PARAM_IS ("smpte-format")) {
if (session) {
primary_clock.set (session->audible_frame(), true);
secondary_clock.set (session->audible_frame(), true);
} else {
primary_clock.set (0, true);
secondary_clock.set (0, true);
}
}
#undef PARAM_IS

View file

@ -5,5 +5,5 @@ if [ gprofhelper.c -nt gprofhelper.so ] ; then
gcc -shared -nostdlib -fPIC gprofhelper.c -o gprofhelper.so -lpthread -ldl || exit 1
fi
export LD_LIBRARY_PATH=../libs/ardour/.libs
LDPRELOAD=./gprofhelper.so ./ardev $*
. ardev_common.sh
LDPRELOAD=./gprofhelper.so $EXECUTABLE $*

View file

@ -1,4 +1,4 @@
#!/bin/sh
. ardev_common.sh
export ARDOUR_RUNNING_UNDER_VALGRIND=TRUE
exec valgrind --num-callers=50 --tool=memcheck gtk2_ardour/ardour.bin --novst $*
exec valgrind --num-callers=50 --tool=memcheck $EXECUTABLE --novst $*

View file

@ -22,6 +22,7 @@
#include <cmath>
#include <pbd/convert.h>
#include <pbd/enumwriter.h>
#include <gtkmm2ext/utils.h>
@ -40,10 +41,14 @@ using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;
using namespace std;
using PBD::atoi;
using PBD::atof;
sigc::signal<void> AudioClock::ModeChanged;
vector<AudioClock*> AudioClock::clocks;
const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = {
2, /* SMPTE_Hours */
2, /* SMPTE_Minutes */
@ -58,8 +63,10 @@ const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = {
10 /* Audio Frame */
};
AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool with_tempo_and_meter)
: is_duration (duration),
AudioClock::AudioClock (std::string clock_name, bool transient, std::string widget_name, bool allow_edit, bool duration, bool with_info)
: _name (clock_name),
is_transient (transient),
is_duration (duration),
editable (allow_edit),
colon1 (":"),
colon2 (":"),
@ -75,9 +82,51 @@ AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool
ops_menu = 0;
dragging = false;
if (with_info) {
frames_upper_info_label = manage (new Label);
frames_lower_info_label = manage (new Label);
smpte_upper_info_label = manage (new Label);
smpte_lower_info_label = manage (new Label);
bbt_upper_info_label = manage (new Label);
bbt_lower_info_label = manage (new Label);
frames_upper_info_label->set_name ("AudioClockFramesUpperInfo");
frames_lower_info_label->set_name ("AudioClockFramesLowerInfo");
smpte_upper_info_label->set_name ("AudioClockSMPTEUpperInfo");
smpte_lower_info_label->set_name ("AudioClockSMPTELowerInfo");
bbt_upper_info_label->set_name ("AudioClockBBTUpperInfo");
bbt_lower_info_label->set_name ("AudioClockBBTLowerInfo");
Gtkmm2ext::set_size_request_to_display_given_text(*smpte_upper_info_label, "23.98",0,0);
Gtkmm2ext::set_size_request_to_display_given_text(*smpte_lower_info_label, "NDF",0,0);
frames_info_box.pack_start (*frames_upper_info_label, true, true);
frames_info_box.pack_start (*frames_lower_info_label, true, true);
smpte_info_box.pack_start (*smpte_upper_info_label, true, true);
smpte_info_box.pack_start (*smpte_lower_info_label, true, true);
bbt_info_box.pack_start (*bbt_upper_info_label, true, true);
bbt_info_box.pack_start (*bbt_lower_info_label, true, true);
} else {
frames_upper_info_label = 0;
frames_lower_info_label = 0;
smpte_upper_info_label = 0;
smpte_lower_info_label = 0;
bbt_upper_info_label = 0;
bbt_lower_info_label = 0;
}
audio_frames_ebox.add (audio_frames_label);
frames_packer_hbox.set_border_width (2);
frames_packer_hbox.pack_start (audio_frames_ebox, false, false);
frames_packer.set_homogeneous (false);
frames_packer.set_border_width (2);
frames_packer.pack_start (audio_frames_ebox, false, false);
if (with_info) {
frames_packer.pack_start (frames_info_box, false, false, 5);
}
frames_packer_hbox.pack_start (frames_packer, true, false);
hours_ebox.add (hours_label);
minutes_ebox.add (minutes_label);
@ -100,6 +149,10 @@ AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool
smpte_packer.pack_start (colon3, false, false);
smpte_packer.pack_start (frames_ebox, false, false);
if (with_info) {
smpte_packer.pack_start (smpte_info_box, false, false, 5);
}
smpte_packer_hbox.pack_start (smpte_packer, true, false);
bbt_packer.set_homogeneous (false);
@ -110,20 +163,8 @@ AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool
bbt_packer.pack_start (b2, false, false);
bbt_packer.pack_start (ticks_ebox, false, false);
if (with_tempo_and_meter) {
meter_label = manage (new Label);
tempo_label = manage (new Label);
meter_label->set_name ("BBTMeterLabel");
tempo_label->set_name ("BBTTempoLabel");
tempo_meter_box.pack_start (*meter_label, true, true);
tempo_meter_box.pack_start (*tempo_label, true, true);
bbt_packer.pack_start (tempo_meter_box, false, false, 5);
} else {
meter_label = 0;
tempo_label = 0;
if (with_info) {
bbt_packer.pack_start (bbt_info_box, false, false, 5);
}
bbt_packer_hbox.pack_start (bbt_packer, true, false);
@ -138,7 +179,50 @@ AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool
minsec_packer_hbox.pack_start (minsec_packer, true, false);
set_name (name);
clock_frame.set_shadow_type (Gtk::SHADOW_IN);
clock_frame.set_name ("BaseFrame");
clock_frame.add (clock_base);
set_widget_name (widget_name);
_mode = BBT; /* lie to force mode switch */
set_mode (SMPTE);
pack_start (clock_frame, true, true);
/* the clock base handles button releases for menu popup regardless of
editable status. if the clock is editable, the clock base is where
we pass focus to after leaving the last editable "field", which
will then shutdown editing till the user starts it up again.
it does this because the focus out event on the field disables
keyboard event handling, and we don't connect anything up to
notice focus in on the clock base. hence, keyboard event handling
stays disabled.
*/
clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
clock_base.signal_button_release_event().connect (bind (mem_fun (*this, &AudioClock::field_button_release_event), SMPTE_Hours));
Session::SMPTEOffsetChanged.connect (mem_fun (*this, &AudioClock::smpte_offset_changed));
if (editable) {
setup_events ();
}
set (last_when, true);
if (!is_transient) {
clocks.push_back (this);
}
}
void
AudioClock::set_widget_name (string name)
{
Widget::set_name (name);
clock_base.set_name (name);
audio_frames_label.set_name (name);
@ -172,37 +256,7 @@ AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool
b1.set_name (name);
b2.set_name (name);
clock_frame.set_shadow_type (Gtk::SHADOW_IN);
clock_frame.set_name ("BaseFrame");
clock_frame.add (clock_base);
_mode = BBT; /* lie to force mode switch */
set_mode (SMPTE);
pack_start (clock_frame, true, true);
/* the clock base handles button releases for menu popup regardless of
editable status. if the clock is editable, the clock base is where
we pass focus to after leaving the last editable "field", which
will then shutdown editing till the user starts it up again.
it does this because the focus out event on the field disables
keyboard event handling, and we don't connect anything up to
notice focus in on the clock base. hence, keyboard event handling
stays disabled.
*/
clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
clock_base.signal_button_release_event().connect (bind (mem_fun (*this, &AudioClock::field_button_release_event), SMPTE_Hours));
Session::SMPTEOffsetChanged.connect (mem_fun (*this, &AudioClock::smpte_offset_changed));
if (editable) {
setup_events ();
}
set (last_when, true);
queue_draw ();
}
void
@ -390,6 +444,27 @@ AudioClock::set_frames (nframes_t when, bool force)
char buf[32];
snprintf (buf, sizeof (buf), "%u", when);
audio_frames_label.set_text (buf);
if (frames_upper_info_label) {
nframes_t rate = session->frame_rate();
if (fmod (rate, 1000.0) == 0.000) {
sprintf (buf, "%uK", rate/1000);
} else {
sprintf (buf, "%.3fK", rate/1000.0f);
}
frames_upper_info_label->set_text (buf);
float vid_pullup = Config->get_video_pullup();
if (vid_pullup == 0.0) {
frames_lower_info_label->set_text(_("none"));
} else {
sprintf (buf, "%-6.4f", vid_pullup);
frames_lower_info_label->set_text (buf);
}
}
}
void
@ -467,6 +542,26 @@ AudioClock::set_smpte (nframes_t when, bool force)
frames_label.set_text (buf);
last_frames = smpte.frames;
}
if (smpte_upper_info_label) {
double smpte_frames = session->smpte_frames_per_second();
if ( fmod(smpte_frames, 1.0) == 0.0) {
sprintf (buf, "%u", int (smpte_frames));
} else {
sprintf (buf, "%.2f", smpte_frames);
}
smpte_upper_info_label->set_text (buf);
if (session->smpte_drop_frames()) {
sprintf (buf, "DF");
} else {
sprintf (buf, "NDF");
}
smpte_lower_info_label->set_text (buf);
}
}
void
@ -483,12 +578,12 @@ AudioClock::set_bbt (nframes_t when, bool force)
sprintf (buf, "%04" PRIu32, bbt.ticks);
ticks_label.set_text (buf);
if (meter_label) {
if (bbt_upper_info_label) {
TempoMap::Metric m (session->tempo_map().metric_at (when));
sprintf (buf, "%-5.2f", m.tempo().beats_per_minute());
tempo_label->set_text (buf);
bbt_lower_info_label->set_text (buf);
sprintf (buf, "%g|%g", m.meter().beats_per_bar(), m.meter().note_divisor());
meter_label->set_text (buf);
bbt_upper_info_label->set_text (buf);
}
}
@ -498,6 +593,18 @@ AudioClock::set_session (Session *s)
session = s;
if (s) {
XMLProperty* prop;
XMLNode* node = session->extra_xml (X_("ClockModes"));
AudioClock::Mode amode;
if (node) {
if ((prop = node->property (_name.c_str())) != 0) {
amode = AudioClock::Mode (string_2_enum (prop->value(), amode));
set_mode (amode);
}
}
set (last_when, true);
}
}
@ -1113,7 +1220,7 @@ AudioClock::get_frames (Field field,nframes_t pos,int dir)
frames = session->frame_rate();
break;
case SMPTE_Frames:
frames = (nframes_t) floor (session->frame_rate() / Config->get_smpte_frames_per_second());
frames = (nframes_t) floor (session->frame_rate() / session->smpte_frames_per_second());
break;
case AudioFrames:
@ -1221,7 +1328,7 @@ AudioClock::smpte_sanitize_display()
seconds_label.set_text("59");
}
switch ((long)rint(Config->get_smpte_frames_per_second())) {
switch ((long)rint(session->smpte_frames_per_second())) {
case 24:
if (atoi(frames_label.get_text()) > 23) {
frames_label.set_text("23");
@ -1241,7 +1348,7 @@ AudioClock::smpte_sanitize_display()
break;
}
if (Config->get_smpte_drop_frames()) {
if (session->smpte_drop_frames()) {
if ((atoi(minutes_label.get_text()) % 10) && (atoi(seconds_label.get_text()) == 0) && (atoi(frames_label.get_text()) < 2)) {
frames_label.set_text("02");
}
@ -1262,6 +1369,8 @@ AudioClock::smpte_frame_from_display () const
smpte.minutes = atoi (minutes_label.get_text());
smpte.seconds = atoi (seconds_label.get_text());
smpte.frames = atoi (frames_label.get_text());
smpte.rate = session->smpte_frames_per_second();
smpte.drop= session->smpte_drop_frames();
session->smpte_to_sample( smpte, sample, false /* use_offset */, false /* use_subframes */ );
@ -1775,6 +1884,10 @@ AudioClock::set_mode (Mode m)
set (last_when, true);
clock_base.show_all ();
key_entry_state = 0;
if (!is_transient) {
ModeChanged (); /* EMIT SIGNAL */
}
}
void
@ -1784,26 +1897,26 @@ AudioClock::set_size_requests ()
switch (_mode) {
case SMPTE:
Gtkmm2ext::set_size_request_to_display_given_text (hours_label, "-88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (minutes_label, "88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (seconds_label, "88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (frames_label, "88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (hours_label, "-00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (minutes_label, "00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (seconds_label, "00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (frames_label, "00", 5, 5);
break;
case BBT:
Gtkmm2ext::set_size_request_to_display_given_text (bars_label, "-888", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (beats_label, "88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ticks_label, "8888", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (bars_label, "-000", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (beats_label, "00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (ticks_label, "0000", 5, 5);
break;
case MinSec:
Gtkmm2ext::set_size_request_to_display_given_text (ms_hours_label, "99", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_minutes_label, "99", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_seconds_label, "99.999", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_hours_label, "00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (ms_minutes_label, "00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (ms_seconds_label, "00.000", 5, 5);
break;
case Frames:
Gtkmm2ext::set_size_request_to_display_given_text (audio_frames_label, "4294967296", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (audio_frames_label, "0000000000", 5, 5);
break;
case Off:

View file

@ -43,12 +43,16 @@ class AudioClock : public Gtk::HBox
Off
};
AudioClock (const string& name, bool editable, bool is_duration = false, bool with_tempo_meter = false);
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 set (nframes_t, bool force = false);
void set_mode (Mode);
void set_widget_name (std::string);
std::string name() const { return _name; }
nframes_t current_time (nframes_t position = 0) const;
nframes_t current_duration (nframes_t position = 0) const;
@ -56,10 +60,15 @@ class AudioClock : public Gtk::HBox
sigc::signal<void> ValueChanged;
static sigc::signal<void> ModeChanged;
static std::vector<AudioClock*> clocks;
private:
ARDOUR::Session *session;
Mode _mode;
uint32_t key_entry_state;
uint32_t key_entry_state;
std::string _name;
bool is_transient;
bool is_duration;
bool editable;
@ -75,6 +84,7 @@ class AudioClock : public Gtk::HBox
Gtk::HBox bbt_packer;
Gtk::HBox frames_packer_hbox;
Gtk::HBox frames_packer;
enum Field {
SMPTE_Hours,
@ -123,10 +133,18 @@ class AudioClock : public Gtk::HBox
Gtk::Label b1;
Gtk::Label b2;
Gtk::Label* tempo_label;
Gtk::Label* meter_label;
Gtk::Label* frames_upper_info_label;
Gtk::Label* frames_lower_info_label;
Gtk::VBox tempo_meter_box;
Gtk::Label* smpte_upper_info_label;
Gtk::Label* smpte_lower_info_label;
Gtk::Label* bbt_upper_info_label;
Gtk::Label* bbt_lower_info_label;
Gtk::VBox frames_info_box;
Gtk::VBox smpte_info_box;
Gtk::VBox bbt_info_box;
Gtk::EventBox clock_base;
Gtk::Frame clock_frame;

View file

@ -47,10 +47,10 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
name_label (_("NAME:")),
audition_button (_("play")),
time_table (3, 2),
start_clock ("AudioRegionEditorClock", true),
end_clock ("AudioRegionEditorClock", true),
length_clock ("AudioRegionEditorClock", true, true),
sync_offset_clock ("AudioRegionEditorClock", true, true)
start_clock (X_("regionstart"), true, X_("AudioRegionEditorClock"), true),
end_clock (X_("regionend"), true, X_("AudioRegionEditorClock"), true),
length_clock (X_("regionlength"), true, X_("AudioRegionEditorClock"), true, true),
sync_offset_clock (X_("regionsyncoffset"), true, X_("AudioRegionEditorClock"), true, true)
{
start_clock.set_session (&_session);
@ -128,8 +128,6 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
name_changed ();
bounds_changed (Change (StartChanged|LengthChanged|PositionChanged));
//XMLNode *node = _region->extra_xml ("GUI");
_region->StateChanged.connect (mem_fun(*this, &AudioRegionEditor::region_changed));
spin_arrow_grab = false;
@ -203,7 +201,7 @@ AudioRegionEditor::start_clock_changed ()
{
_session.begin_reversible_command (_("change region start position"));
Playlist* const pl = _region->playlist();
boost::shared_ptr<Playlist> pl = _region->playlist();
if (pl) {
XMLNode &before = pl->get_state();
@ -220,8 +218,8 @@ AudioRegionEditor::end_clock_changed ()
{
_session.begin_reversible_command (_("change region end position"));
Playlist* const pl = _region->playlist();
boost::shared_ptr<Playlist> pl = _region->playlist();
if (pl) {
XMLNode &before = pl->get_state();
_region->trim_end (end_clock.current_time(), this);
@ -241,7 +239,7 @@ AudioRegionEditor::length_clock_changed ()
_session.begin_reversible_command (_("change region length"));
Playlist* const pl = _region->playlist();
boost::shared_ptr<Playlist> pl = _region->playlist();
if (pl) {
XMLNode &before = pl->get_state();

View file

@ -737,8 +737,8 @@ AudioRegionView::show_region_editor ()
// trackview.editor.ensure_float (*editor);
}
editor->show_all ();
editor->get_window()->raise();
editor->present ();
editor->show_all();
}
void
@ -873,6 +873,8 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct)
wave->property_amplitude_above_axis() = _amplitude_above_axis;
wave->property_wave_color() = _region->muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm];
wave->property_region_start() = _region->start();
wave->property_rectified() = (bool) (_flags & WaveformRectified);
wave->property_logscaled() = (bool) (_flags & WaveformLogScaled);
if (!(_flags & WaveformVisible)) {
wave->hide();
@ -987,6 +989,8 @@ AudioRegionView::store_flags()
node->add_property ("waveform-visible", (_flags & WaveformVisible) ? "yes" : "no");
node->add_property ("envelope-visible", (_flags & EnvelopeVisible) ? "yes" : "no");
node->add_property ("waveform-rectified", (_flags & WaveformRectified) ? "yes" : "no");
node->add_property ("waveform-logscaled", (_flags & WaveformLogScaled) ? "yes" : "no");
_region->add_extra_xml (*node);
}
@ -1007,6 +1011,18 @@ AudioRegionView::set_flags (XMLNode* node)
_flags |= EnvelopeVisible;
}
}
if ((prop = node->property ("waveform-rectified")) != 0) {
if (prop->value() == "yes") {
_flags |= WaveformRectified;
}
}
if ((prop = node->property ("waveform-logscaled")) != 0) {
if (prop->value() == "yes") {
_flags |= WaveformLogScaled;
}
}
}
void
@ -1046,9 +1062,30 @@ AudioRegionView::set_waveform_shape (WaveformShape shape)
} else {
_flags &= ~WaveformRectified;
}
store_flags ();
}
}
void
AudioRegionView::set_waveform_scale (WaveformScale scale)
{
bool yn = (scale == LogWaveform);
if (yn != (bool) (_flags & WaveformLogScaled)) {
for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
(*wave)->property_logscaled() = yn;
}
if (yn) {
_flags |= WaveformLogScaled;
} else {
_flags &= ~WaveformLogScaled;
}
store_flags ();
}
}
GhostRegion*
AudioRegionView::add_ghost (AutomationTimeAxisView& atv)
{

View file

@ -72,8 +72,10 @@ class AudioRegionView : public RegionView
void set_envelope_visible (bool);
void set_waveform_visible (bool yn);
void set_waveform_shape (WaveformShape);
void set_waveform_scale (WaveformScale);
bool waveform_rectified() const { return _flags & WaveformRectified; }
bool waveform_logscaled() const { return _flags & WaveformLogScaled; }
bool waveform_visible() const { return _flags & WaveformVisible; }
bool envelope_visible() const { return _flags & EnvelopeVisible; }
@ -116,7 +118,8 @@ class AudioRegionView : public RegionView
enum Flags {
EnvelopeVisible = 0x1,
WaveformVisible = 0x4,
WaveformRectified = 0x8
WaveformRectified = 0x8,
WaveformLogScaled = 0x10,
};
vector<ArdourCanvas::WaveView *> waves;

View file

@ -56,7 +56,9 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
: StreamView (tv)
{
crossfades_visible = true;
_waveform_scale = LinearWaveform;
_waveform_shape = Traditional;
if (tv.is_track())
stream_base_color = color_map[cAudioTrackBase];
else
@ -143,6 +145,14 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
/* great. we already have a AudioRegionView for this Region. use it again. */
(*i)->set_valid (true);
// this might not be necessary
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
if (arv) {
arv->set_waveform_scale (_waveform_scale);
arv->set_waveform_shape (_waveform_shape);
}
return;
}
}
@ -161,6 +171,27 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
region_view->init (region_color, wait_for_waves);
region_view->set_amplitude_above_axis(_amplitude_above_axis);
region_views.push_front (region_view);
/* if this was the first one, then lets query the waveform scale and shape.
otherwise, we set it to the current value */
if (region_views.size() == 1) {
if (region_view->waveform_logscaled()) {
_waveform_scale = LogWaveform;
} else {
_waveform_scale = LinearWaveform;
}
if (region_view->waveform_rectified()) {
_waveform_shape = Rectified;
} else {
_waveform_shape = Traditional;
}
}
else {
region_view->set_waveform_scale(_waveform_scale);
region_view->set_waveform_shape(_waveform_shape);
}
/* follow global waveform setting */
@ -237,7 +268,7 @@ AudioStreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
StreamView::playlist_changed(ds);
AudioPlaylist* apl = dynamic_cast<AudioPlaylist*>(ds->playlist());
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(ds->playlist());
if (apl)
playlist_connections.push_back (apl->NewCrossfade.connect (mem_fun (*this, &AudioStreamView::add_crossfade)));
}
@ -326,7 +357,7 @@ AudioStreamView::redisplay_diskstream ()
if (_trackview.is_audio_track()) {
_trackview.get_diskstream()->playlist()->foreach_region (static_cast<StreamView*>(this), &StreamView::add_region_view);
AudioPlaylist* apl = dynamic_cast<AudioPlaylist*>(_trackview.get_diskstream()->playlist());
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(_trackview.get_diskstream()->playlist());
if (apl)
apl->foreach_crossfade (this, &AudioStreamView::add_crossfade);
}
@ -380,8 +411,20 @@ AudioStreamView::set_waveform_shape (WaveformShape shape)
if (arv)
arv->set_waveform_shape (shape);
}
_waveform_shape = shape;
}
void
AudioStreamView::set_waveform_scale (WaveformScale scale)
{
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
if (arv)
arv->set_waveform_scale (scale);
}
_waveform_scale = scale;
}
void
AudioStreamView::setup_rec_box ()
{

View file

@ -59,6 +59,9 @@ class AudioStreamView : public StreamView
~AudioStreamView ();
void set_waveform_shape (WaveformShape);
WaveformShape get_waveform_shape () const { return _waveform_shape; }
void set_waveform_scale (WaveformScale);
WaveformScale get_waveform_scale () const { return _waveform_scale; }
int set_height (gdouble h);
int set_samples_per_unit (gdouble spp);
@ -100,6 +103,9 @@ class AudioStreamView : public StreamView
typedef list<CrossfadeView*> CrossfadeViewList;
CrossfadeViewList crossfade_views;
bool crossfades_visible;
WaveformShape _waveform_shape;
WaveformScale _waveform_scale;
};
#endif /* __ardour_audio_streamview_h__ */

View file

@ -30,7 +30,6 @@
#include <pbd/error.h>
#include <pbd/stl_delete.h>
#include <pbd/whitespace.h>
#include <pbd/memento_command.h>
#include <gtkmm2ext/gtk_ui.h>
@ -133,6 +132,8 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
controls_base_selected_name = "AudioBusControlsBaseSelected";
controls_base_unselected_name = "AudioBusControlsBaseUnselected";
}
post_construct ();
}
AudioTimeAxisView::~AudioTimeAxisView ()
@ -260,14 +261,40 @@ AudioTimeAxisView::append_extra_display_menu_items ()
waveform_item->set_active (editor.show_waveforms());
ignore_toggle = false;
waveform_items.push_back (SeparatorElem());
RadioMenuItem::Group group;
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());
waveform_items.push_back (SeparatorElem());
RadioMenuItem::Group group2;
waveform_items.push_back (RadioMenuElem (group2, _("Linear"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LinearWaveform)));
linearscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
waveform_items.push_back (RadioMenuElem (group2, _("Logarithmic"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LogWaveform)));
logscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
// setting initial item state
AudioStreamView* asv = audio_view();
if (asv) {
ignore_toggle = true;
if (asv->get_waveform_shape() == Rectified)
rectified_item->set_active(true);
else traditional_item->set_active(true);
if (asv->get_waveform_scale() == LogWaveform)
logscale_item->set_active(true);
else linearscale_item->set_active(true);
ignore_toggle = false;
}
items.push_back (MenuElem (_("Waveform"), *waveform_menu));
}
@ -310,13 +337,25 @@ AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
{
AudioStreamView* asv = audio_view();
if (asv) {
if (asv && !ignore_toggle) {
asv->set_waveform_shape (shape);
}
map_frozen ();
}
void
AudioTimeAxisView::set_waveform_scale (WaveformScale scale)
{
AudioStreamView* asv = audio_view();
if (asv && !ignore_toggle) {
asv->set_waveform_scale (scale);
}
map_frozen ();
}
void
AudioTimeAxisView::add_gain_automation_child ()
{

View file

@ -98,6 +98,7 @@ class AudioTimeAxisView : public RouteTimeAxisView
void toggle_show_waveforms ();
void set_waveform_shape (WaveformShape);
void toggle_waveforms ();
void set_waveform_scale (WaveformScale);
void show_all_automation ();
void show_existing_automation ();
@ -125,6 +126,8 @@ class AudioTimeAxisView : public RouteTimeAxisView
Gtk::CheckMenuItem* waveform_item;
Gtk::RadioMenuItem* traditional_item;
Gtk::RadioMenuItem* rectified_item;
Gtk::RadioMenuItem* linearscale_item;
Gtk::RadioMenuItem* logscale_item;
Gtk::CheckMenuItem* gain_automation_item;
Gtk::CheckMenuItem* pan_automation_item;
};

View file

@ -21,6 +21,7 @@
#include <cmath>
#include <climits>
#include <vector>
#include <fstream>
#include <pbd/stl_delete.h>
#include <pbd/memento_command.h>
@ -347,13 +348,6 @@ AutomationLine::nth (uint32_t n)
}
}
void
AutomationLine::modify_view (ControlPoint& cp, double x, double y, bool with_push)
{
modify_view_point (cp, x, y, with_push);
update_line ();
}
void
AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool with_push)
{
@ -416,7 +410,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
ControlPoint* after;
/* find the first point that can't move */
for (uint32_t n = cp.view_index + 1; (after = nth (n)) != 0; ++n) {
if (!after->can_slide) {
x_limit = after->get_x() - 1.0;
@ -471,14 +465,10 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
void
AutomationLine::reset_line_coords (ControlPoint& cp)
{
line_points[cp.view_index].set_x (cp.get_x());
line_points[cp.view_index].set_y (cp.get_y());
}
void
AutomationLine::update_line ()
{
line->property_points() = line_points;
if (cp.view_index < line_points.size()) {
line_points[cp.view_index].set_x (cp.get_x());
line_points[cp.view_index].set_y (cp.get_y());
}
}
void
@ -491,10 +481,8 @@ AutomationLine::sync_model_with_view_line (uint32_t start, uint32_t end)
for (uint32_t i = start; i <= end; ++i) {
p = nth(i);
sync_model_with_view_point(*p);
sync_model_with_view_point (*p, false, 0);
}
}
void
@ -508,7 +496,6 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
mr.xval = (nframes_t) floor (cp.get_x());
mr.yval = 1.0 - (cp.get_y() / _height);
/* if xval has not changed, set it directly from the model to avoid rounding errors */
if (mr.xval == trackview.editor.frame_to_unit((*cp.model)->when)) {
@ -517,7 +504,6 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
mr.xval = trackview.editor.unit_to_frame (mr.xval);
}
/* virtual call: this will do the right thing
for whatever particular type of line we are.
*/
@ -566,98 +552,6 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
}
}
void
AutomationLine::sync_model_from (ControlPoint& cp)
{
ControlPoint* p;
uint32_t lasti;
sync_model_with_view_point (cp);
/* we might have moved all points after `cp' by some amount
if we pressed the with_push modifyer some of the time during the drag
so all subsequent points have to be resynced
*/
lasti = control_points.size() - 1;
p = nth (lasti);
update_pending = true;
while (p != &cp && lasti) {
sync_model_with_view_point (*p);
--lasti;
p = nth (lasti);
}
}
void
AutomationLine::sync_model_with_view_point (ControlPoint& cp)
{
ModelRepresentation mr;
double ydelta;
model_representation (cp, mr);
/* part 4: how much are we changing the central point by */
ydelta = mr.yval - mr.ypos;
/* IMPORTANT: changing the model when the x-coordinate changes
may invalidate the iterators that we are using. this means that we have
to change the points before+after the one corresponding to the visual CP
first (their x-coordinate doesn't change). then we change the
"main" point.
apply the full change to the central point, and interpolate
in each direction to cover all model points represented
by the control point.
*/
/* part 5: change all points before the primary point */
for (AutomationList::iterator i = mr.start; i != cp.model; ++i) {
double delta;
delta = ydelta * ((*i)->when - mr.xmin) / (mr.xpos - mr.xmin);
/* x-coordinate (generally time) stays where it is,
y-coordinate moves by a certain amount.
*/
update_pending = true;
change_model (i, (*i)->when, mr.yval + delta);
}
/* part 6: change later points */
AutomationList::iterator i = cp.model;
++i;
while (i != mr.end) {
double delta;
delta = ydelta * (mr.xmax - (*i)->when) / (mr.xmax - mr.xpos);
/* x-coordinate (generally time) stays where it is,
y-coordinate moves by a certain amount.
*/
update_pending = true;
change_model (i, (*i)->when, (*i)->value + delta);
++i;
}
/* part 7: change the primary point */
update_pending = true;
change_model (cp.model, mr.xval, mr.yval);
}
void
AutomationLine::determine_visible_control_points (ALPoints& points)
{
@ -748,7 +642,8 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
if (view_index && pi != npoints && /* not the first, not the last */
(((this_rx == prev_rx) && (this_ry == prev_ry)) || /* same point */
(((this_rx - prev_rx) < (box_size + 2)) && /* too close horizontally */
(this_rx == prev_rx) || /* identical x coordinate */
(((this_rx - prev_rx) < (box_size + 2)) && /* not identical, but still too close horizontally */
((abs ((int)(this_ry - prev_ry)) < (int) (box_size + 2)))))) { /* too close vertically */
continue;
}
@ -810,7 +705,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
view_index++;
}
/* discard extra CP's to avoid confusing ourselves */
while (control_points.size() > view_index) {
@ -849,9 +744,11 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
if (_visible) {
line->show ();
}
}
set_selected_points (trackview.editor.get_selection().points);
}
string
@ -886,7 +783,7 @@ AutomationLine::invalidate_point (ALPoints& p, uint32_t index)
}
void
AutomationLine::start_drag (ControlPoint* cp, float fraction)
AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
{
if (trackview.editor.current_session() == 0) { /* how? */
return;
@ -901,24 +798,43 @@ AutomationLine::start_drag (ControlPoint* cp, float fraction)
}
trackview.editor.current_session()->begin_reversible_command (str);
trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, &get_state(), 0));
trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(alist, &get_state(), 0));
drag_x = x;
drag_distance = 0;
first_drag_fraction = fraction;
last_drag_fraction = fraction;
drags = 0;
did_push = false;
}
void
AutomationLine::point_drag (ControlPoint& cp, nframes_t x, float fraction, bool with_push)
{
modify_view (cp, x, fraction, with_push);
if (x > drag_x) {
drag_distance += (x - drag_x);
} else {
drag_distance -= (drag_x - x);
}
drag_x = x;
modify_view_point (cp, x, fraction, with_push);
if (line_points.size() > 1) {
line->property_points() = line_points;
}
drags++;
did_push = with_push;
}
void
AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_push)
{
double ydelta = fraction - last_drag_fraction;
did_push = with_push;
last_drag_fraction = fraction;
@ -932,7 +848,9 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
modify_view_point (*cp, trackview.editor.unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
}
update_line ();
if (line_points.size() > 1) {
line->property_points() = line_points;
}
drags++;
}
@ -940,20 +858,95 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
void
AutomationLine::end_drag (ControlPoint* cp)
{
if (drags) {
if (cp) {
sync_model_from (*cp);
} else {
sync_model_with_view_line (line_drag_cp1, line_drag_cp2);
}
update_pending = false;
trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, 0, &get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
if (!drags) {
return;
}
alist.freeze ();
if (cp) {
sync_model_with_view_point (*cp, did_push, drag_distance);
} else {
sync_model_with_view_line (line_drag_cp1, line_drag_cp2);
}
alist.thaw ();
update_pending = false;
trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(alist, 0, &alist.get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
void
AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int64_t distance)
{
ModelRepresentation mr;
double ydelta;
model_representation (cp, mr);
/* how much are we changing the central point by */
ydelta = mr.yval - mr.ypos;
/*
apply the full change to the central point, and interpolate
on both axes to cover all model points represented
by the control point.
*/
/* change all points before the primary point */
for (AutomationList::iterator i = mr.start; i != cp.model; ++i) {
double fract = ((*i)->when - mr.xmin) / (mr.xpos - mr.xmin);
double y_delta = ydelta * fract;
double x_delta = distance * fract;
/* interpolate */
if (y_delta || x_delta) {
alist.modify (i, (*i)->when + x_delta, mr.ymin + y_delta);
}
}
/* change the primary point */
update_pending = true;
alist.modify (cp.model, mr.xval, mr.yval);
/* change later points */
AutomationList::iterator i = cp.model;
++i;
while (i != mr.end) {
double delta = ydelta * (mr.xmax - (*i)->when) / (mr.xmax - mr.xpos);
/* all later points move by the same distance along the x-axis as the main point */
if (delta) {
alist.modify (i, (*i)->when + distance, (*i)->value + delta);
}
++i;
}
if (did_push) {
/* move all points after the range represented by the view by the same distance
as the main point moved.
*/
alist.slide (mr.end, drag_distance);
}
}
bool
@ -1027,11 +1020,11 @@ AutomationLine::remove_point (ControlPoint& cp)
model_representation (cp, mr);
trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
XMLNode &before = get_state();
XMLNode &before = alist.get_state();
alist.erase (mr.start, mr.end);
trackview.editor.current_session()->add_command(new MementoCommand<AutomationLine>(*this, &before, &get_state()));
trackview.editor.current_session()->add_command(new MementoCommand<AutomationList>(alist, &before, &alist.get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
@ -1149,8 +1142,6 @@ AutomationLine::show_selection ()
{
TimeSelection& time (trackview.editor.get_selection().time);
// cerr << "show selection\n";
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->selected = false;
@ -1174,7 +1165,6 @@ AutomationLine::show_selection ()
void
AutomationLine::hide_selection ()
{
// cerr << "hide selection\n";
// show_selection ();
}
@ -1239,7 +1229,6 @@ AutomationLine::clear ()
void
AutomationLine::change_model (AutomationList::iterator i, double x, double y)
{
alist.modify (i, (nframes_t) x, y);
}
void

View file

@ -117,7 +117,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
/* dragging API */
virtual void start_drag (ControlPoint*, float fraction);
virtual void start_drag (ControlPoint*, nframes_t x, float fraction);
virtual void point_drag(ControlPoint&, nframes_t x, float, bool with_push);
virtual void end_drag (ControlPoint*);
virtual void line_drag(uint32_t i1, uint32_t i2, float, bool with_push);
@ -174,7 +174,8 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
bool update_pending : 1;
bool no_draw : 1;
bool points_visible : 1;
bool did_push;
ArdourCanvas::Group& _parent_group;
ArdourCanvas::Group* group;
ArdourCanvas::Line* line; /* line */
@ -193,10 +194,8 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
static bool invalid_point (ALPoints&, uint32_t index);
void determine_visible_control_points (ALPoints&);
void sync_model_from (ControlPoint&);
void sync_model_with_view_point (ControlPoint&);
void sync_model_with_view_point (ControlPoint&, bool did_push, int64_t distance);
void sync_model_with_view_line (uint32_t, uint32_t);
void modify_view (ControlPoint&, double, double, bool with_push);
virtual void change_model (ARDOUR::AutomationList::iterator, double x, double y);
virtual void change_model_range (ARDOUR::AutomationList::iterator,ARDOUR::AutomationList::iterator, double delta, float ydelta);
@ -212,10 +211,11 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
double last_drag_fraction;
uint32_t line_drag_cp1;
uint32_t line_drag_cp2;
int64_t drag_x;
int64_t drag_distance;
void modify_view_point(ControlPoint&, double, double, bool with_push);
void reset_line_coords (ControlPoint&);
void update_line ();
double control_point_box_size ();

View file

@ -21,6 +21,9 @@ using namespace PBD;
using namespace Gtk;
using namespace Editing;
Pango::FontDescription AutomationTimeAxisView::name_font;
bool AutomationTimeAxisView::have_name_font = false;
AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r, PublicEditor& e, TimeAxisView& rent,
ArdourCanvas::Canvas& canvas, const string & nom,
const string & state_name, const string & nomparent)
@ -34,6 +37,11 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
clear_button (_("clear")),
auto_button (X_("")) /* force addition of a label */
{
if (!have_name_font) {
name_font = get_font_for_style (X_("AutomationTrackName"));
have_name_font = true;
}
automation_menu = 0;
in_destructor = false;
auto_off_item = 0;
@ -84,14 +92,14 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
string shortpname = _name;
bool shortened = false;
if (_name.length()) {
if (shortpname.length() > 18) {
shortpname = shortpname.substr (0, 16);
shortpname += "...";
shortened = true;
}
int ignore_width;
shortpname = fit_to_pixels (_name, 60, name_font, ignore_width, true);
if (shortpname != _name ){
shortened = true;
}
name_label.set_text (shortpname);
name_label.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
@ -99,11 +107,8 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
/* limit the plug name string */
string pname = nomparent;
if (pname.length() > 14) {
pname = pname.substr (0, 11);
pname += "...";
string pname = fit_to_pixels (nomparent, 60, name_font, ignore_width, true);
if (pname != nomparent) {
shortened = true;
}
@ -150,7 +155,10 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
controls_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
XMLNode* xml_node = get_parent_with_state()->get_child_xml_node (_state_name);
set_state (*xml_node);
if (xml_node) {
set_state (*xml_node);
}
/* make sure labels etc. are correct */
@ -186,7 +194,7 @@ AutomationTimeAxisView::auto_clicked ()
bind (mem_fun(*this, &AutomationTimeAxisView::set_automation_state), (AutoState) Touch)));
}
automation_menu->popup (1, 0);
automation_menu->popup (1, gtk_get_current_event_time());
}

View file

@ -121,6 +121,9 @@ class AutomationTimeAxisView : public TimeAxisView {
void entered ();
void exited ();
static Pango::FontDescription name_font;
static bool have_name_font;
};
#endif /* __ardour_gtk_automation_time_axis_h__ */

View file

@ -26,6 +26,7 @@
#include <ardour/dB.h>
#include "logmeter.h"
#include "canvas-waveview.h"
#include "rgb_macros.h"
@ -49,7 +50,8 @@ enum {
PROP_HEIGHT,
PROP_WAVE_COLOR,
PROP_RECTIFIED,
PROP_REGION_START
PROP_REGION_START,
PROP_LOGSCALED,
};
static void gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class);
@ -253,6 +255,13 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
g_param_spec_boolean ("rectified", NULL, NULL,
FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property
(gobject_class,
PROP_LOGSCALED,
g_param_spec_boolean ("logscaled", NULL, NULL,
FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property
(gobject_class,
@ -308,6 +317,7 @@ gnome_canvas_waveview_init (GnomeCanvasWaveView *waveview)
waveview->gain_curve_function = NULL;
waveview->gain_src = NULL;
waveview->rectified = FALSE;
waveview->logscaled = FALSE;
waveview->region_start = 0;
waveview->samples_per_unit = 1.0;
waveview->amplitude_above_axis = 1.0;
@ -577,7 +587,29 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
free (gain);
}
/* do optional log scaling. this implementation is not particularly efficient */
if (waveview->logscaled) {
guint32 n;
GnomeCanvasWaveViewCacheEntry* buf = cache->data;
for (n = 0; n < cache->data_size; ++n) {
if (buf[n].max > 0.0f) {
buf[n].max = alt_log_meter(coefficient_to_dB(buf[n].max));
} else if (buf[n].max < 0.0f) {
buf[n].max = -alt_log_meter(coefficient_to_dB(-buf[n].max));
}
if (buf[n].min > 0.0f) {
buf[n].min = alt_log_meter(coefficient_to_dB(buf[n].min));
} else if (buf[n].min < 0.0f) {
buf[n].min = -alt_log_meter(coefficient_to_dB(-buf[n].min));
}
}
}
cache->start = ostart;
cache->end = new_cache_end;
@ -770,6 +802,17 @@ gnome_canvas_waveview_set_property (GObject *object,
redraw = TRUE;
}
break;
case PROP_LOGSCALED:
if (waveview->logscaled != g_value_get_boolean(value)) {
waveview->logscaled = g_value_get_boolean(value);
if (waveview->cache_updater) {
waveview->cache->start = 0;
waveview->cache->end = 0;
}
redraw = TRUE;
calc_bounds = TRUE;
}
break;
case PROP_REGION_START:
waveview->region_start = g_value_get_uint(value);
redraw = TRUE;
@ -869,6 +912,10 @@ gnome_canvas_waveview_get_property (GObject *object,
g_value_set_boolean (value, waveview->rectified);
break;
case PROP_LOGSCALED:
g_value_set_boolean (value, waveview->logscaled);
break;
case PROP_REGION_START:
g_value_set_uint (value, waveview->region_start);
break;

View file

@ -101,7 +101,8 @@ struct _GnomeCanvasWaveView
uint32_t wave_color;
char rectified;
char logscaled;
/* These are updated by the update() routine
to optimize the render() routine, which may
be called several times after a single update().

View file

@ -96,7 +96,7 @@ CrossfadeEditor::CrossfadeEditor (Session& s, Crossfade& xf, double my, double m
select_in_button (_("Fade In")),
select_out_button (_("Fade Out"))
{
set_wmclass ("ardour_automationedit", "Ardour");
set_wmclass (X_("ardour_automationedit"), "Ardour");
set_name ("CrossfadeEditWindow");
set_position (Gtk::WIN_POS_MOUSE);
@ -698,8 +698,6 @@ CrossfadeEditor::redraw ()
}
// GTK2FIX some odd math to fix up here
size_t last_spt = (npoints + 3) - 1;
for (size_t i = 0; i < npoints; ++i) {

View file

@ -52,7 +52,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
: TimeAxisViewItem ("xfade" /*xf.name()*/, *parent, tv, spu, basic_color, xf.position(),
xf.overlap_length(), TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)),
xf.length(), TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)),
crossfade (xf),
left_view (lview),
right_view (rview)
@ -124,7 +124,7 @@ CrossfadeView::crossfade_changed (Change what_changed)
if (what_changed & BoundsChanged) {
set_position (crossfade.position(), this);
set_duration (crossfade.overlap_length(), this);
set_duration (crossfade.length(), this);
need_redraw_curves = true;
}

View file

@ -197,8 +197,8 @@ Editor::Editor (AudioEngine& eng)
/* tool bar related */
edit_cursor_clock (X_("EditCursorClock"), true),
zoom_range_clock (X_("ZoomRangeClock"), true, true),
edit_cursor_clock (X_("editcursor"), false, X_("EditCursorClock"), true),
zoom_range_clock (X_("zoomrange"), false, X_("ZoomRangeClock"), true, true),
toolbar_selection_clock_table (2,3),
@ -211,7 +211,7 @@ Editor::Editor (AudioEngine& eng)
/* nudge */
nudge_clock (X_("NudgeClock"), true, true)
nudge_clock (X_("nudge"), false, X_("NudgeClock"), true, true)
{
constructed = false;
@ -284,6 +284,7 @@ Editor::Editor (AudioEngine& eng)
route_list_menu = 0;
region_list_menu = 0;
marker_menu = 0;
start_end_marker_menu = 0;
range_marker_menu = 0;
marker_menu_item = 0;
tm_marker_menu = 0;
@ -309,6 +310,7 @@ Editor::Editor (AudioEngine& eng)
playhead_cursor = 0;
button_release_can_deselect = true;
canvas_idle_queued = false;
_dragging_playhead = false;
location_marker_color = color_map[cLocationMarker];
location_range_color = color_map[cLocationRange];
@ -444,6 +446,7 @@ Editor::Editor (AudioEngine& eng)
edit_packer.attach (controls_layout, 1, 2, 1, 2, FILL, FILL|EXPAND, 0, 0);
edit_packer.attach (track_canvas_event_box, 2, 3, 1, 2, FILL|EXPAND, FILL|EXPAND, 0, 0);
edit_packer.attach (zoom_box, 1, 2, 2, 3, FILL, FILL, 0, 0);
edit_packer.attach (edit_hscrollbar, 2, 3, 2, 3, FILL|EXPAND, FILL, 0, 0);
bottom_hbox.set_border_width (2);
@ -451,7 +454,7 @@ Editor::Editor (AudioEngine& eng)
route_display_model = ListStore::create(route_display_columns);
route_list_display.set_model (route_display_model);
route_list_display.append_column (_("Visible"), route_display_columns.visible);
route_list_display.append_column (_("Show"), route_display_columns.visible);
route_list_display.append_column (_("Name"), route_display_columns.text);
route_list_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
route_list_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
@ -477,7 +480,7 @@ Editor::Editor (AudioEngine& eng)
edit_group_display.set_model (group_model);
edit_group_display.append_column (_("Name"), group_columns.text);
edit_group_display.append_column (_("Active"), group_columns.is_active);
edit_group_display.append_column (_("Visible"), group_columns.is_visible);
edit_group_display.append_column (_("Show"), group_columns.is_visible);
edit_group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
edit_group_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
edit_group_display.get_column (2)->set_data (X_("colnum"), GUINT_TO_POINTER(2));
@ -597,7 +600,7 @@ Editor::Editor (AudioEngine& eng)
named_selection_display.get_selection()->set_mode (SELECTION_SINGLE);
named_selection_display.set_size_request (100, -1);
named_selection_display.signal_button_press_event().connect (mem_fun(*this, &Editor::named_selection_display_button_press), false);
named_selection_display.signal_button_release_event().connect (mem_fun(*this, &Editor::named_selection_display_button_press), false);
named_selection_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::named_selection_display_selection_changed));
/* SNAPSHOTS */
@ -685,8 +688,29 @@ Editor::Editor (AudioEngine& eng)
fade_context_menu.set_name ("ArdourContextMenu");
/* icons, titles, WM stuff */
list<Glib::RefPtr<Gdk::Pixbuf> > window_icons;
Glib::RefPtr<Gdk::Pixbuf> icon;
if ((icon = ::get_icon ("ardour_icon_16px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_22px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_32px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_48px")) != 0) {
window_icons.push_back (icon);
}
if (!window_icons.empty()) {
set_icon_list (window_icons);
set_default_icon_list (window_icons);
}
set_title (_("ardour: editor"));
set_wmclass (_("ardour_editor"), "Ardour");
set_wmclass (X_("ardour_editor"), "Ardour");
add (vpacker);
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
@ -1516,7 +1540,7 @@ Editor::build_track_region_context_menu (nframes_t frame)
if (atv) {
boost::shared_ptr<Diskstream> ds;
Playlist* pl;
boost::shared_ptr<Playlist> pl;
if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()))) {
Playlist::RegionList* regions = pl->regions_at ((nframes_t) floor ( (double)frame * ds->speed()));
@ -1543,10 +1567,10 @@ Editor::build_track_crossfade_context_menu (nframes_t frame)
if (atv) {
boost::shared_ptr<Diskstream> ds;
Playlist* pl;
AudioPlaylist* apl;
boost::shared_ptr<Playlist> pl;
boost::shared_ptr<AudioPlaylist> apl;
if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()) != 0) && ((apl = dynamic_cast<AudioPlaylist*> (pl)) != 0)) {
if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()) != 0) && ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) != 0)) {
Playlist::RegionList* regions = pl->regions_at (frame);
AudioPlaylist::Crossfades xfades;
@ -1860,6 +1884,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Select all in range"), mem_fun(*this, &Editor::select_all_selectables_using_time_selection)));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Add Range Markers"), mem_fun (*this, &Editor::add_location_from_selection)));
items.push_back (MenuElem (_("Set range to loop range"), mem_fun(*this, &Editor::set_selection_from_loop)));
items.push_back (MenuElem (_("Set range to punch range"), mem_fun(*this, &Editor::set_selection_from_punch)));
items.push_back (SeparatorElem());
@ -2261,18 +2286,11 @@ Editor::get_state ()
TimeAxisView *
Editor::trackview_by_y_position (double y)
{
TrackViewList::iterator iter;
TimeAxisView *tv;
for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
for (iter = track_views.begin(); iter != track_views.end(); ++iter) {
TimeAxisView *tv;
tv = *iter;
if (tv->hidden()) {
continue;
}
if (tv->y_position <= y && y < ((tv->y_position + tv->height + track_spacing))) {
if ((tv = (*iter)->covers_y_position (y)) != 0) {
return tv;
}
}
@ -2292,7 +2310,8 @@ Editor::snap_to (nframes_t& start, int32_t direction, bool for_mark)
const nframes_t one_second = session->frame_rate();
const nframes_t one_minute = session->frame_rate() * 60;
const nframes_t one_smpte_second = (nframes_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame());
nframes_t one_smpte_minute = (nframes_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame() * 60);
nframes_t presnap = start;
switch (snap_type) {
@ -2306,8 +2325,9 @@ Editor::snap_to (nframes_t& start, int32_t direction, bool for_mark)
start = (nframes_t) floor ((double) start / (one_second / 75)) * (one_second / 75);
}
break;
case SnapToSMPTEFrame:
if (direction) {
if (fmod((double)start, (double)session->frames_per_smpte_frame()) > (session->frames_per_smpte_frame() / 2)) {
start = (nframes_t) (ceil ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame());
} else {
start = (nframes_t) (floor ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame());
@ -2321,10 +2341,10 @@ Editor::snap_to (nframes_t& start, int32_t direction, bool for_mark)
} else {
start -= session->smpte_offset ();
}
if (direction > 0) {
start = (nframes_t) ceil ((double) start / one_second) * one_second;
if (start % one_smpte_second > one_smpte_second / 2) {
start = (nframes_t) ceil ((double) start / one_smpte_second) * one_smpte_second;
} else {
start = (nframes_t) floor ((double) start / one_second) * one_second;
start = (nframes_t) floor ((double) start / one_smpte_second) * one_smpte_second;
}
if (session->smpte_offset_negative())
@ -2342,10 +2362,10 @@ Editor::snap_to (nframes_t& start, int32_t direction, bool for_mark)
} else {
start -= session->smpte_offset ();
}
if (direction) {
start = (nframes_t) ceil ((double) start / one_minute) * one_minute;
if (start % one_smpte_minute > one_smpte_minute / 2) {
start = (nframes_t) ceil ((double) start / one_smpte_minute) * one_smpte_minute;
} else {
start = (nframes_t) floor ((double) start / one_minute) * one_minute;
start = (nframes_t) floor ((double) start / one_smpte_minute) * one_smpte_minute;
}
if (session->smpte_offset_negative())
{
@ -2356,7 +2376,7 @@ Editor::snap_to (nframes_t& start, int32_t direction, bool for_mark)
break;
case SnapToSeconds:
if (direction) {
if (start % one_second > one_second / 2) {
start = (nframes_t) ceil ((double) start / one_second) * one_second;
} else {
start = (nframes_t) floor ((double) start / one_second) * one_second;
@ -2364,7 +2384,7 @@ Editor::snap_to (nframes_t& start, int32_t direction, bool for_mark)
break;
case SnapToMinutes:
if (direction) {
if (start % one_minute > one_minute / 2) {
start = (nframes_t) ceil ((double) start / one_minute) * one_minute;
} else {
start = (nframes_t) floor ((double) start / one_minute) * one_minute;
@ -2596,35 +2616,33 @@ Editor::setup_toolbar ()
zoom_box.set_border_width (2);
zoom_in_button.set_name ("EditorTimeButton");
zoom_in_button.set_size_request(-1,16);
zoom_in_button.add (*(manage (new Image (::get_icon("zoom_in")))));
zoom_in_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_in_button, _("Zoom In"));
zoom_out_button.set_name ("EditorTimeButton");
zoom_out_button.set_size_request(-1,16);
zoom_out_button.add (*(manage (new Image (::get_icon("zoom_out")))));
zoom_out_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_button, _("Zoom Out"));
zoom_out_full_button.set_name ("EditorTimeButton");
zoom_out_full_button.set_size_request(-1,16);
zoom_out_full_button.add (*(manage (new Image (::get_icon("zoom_full")))));
zoom_out_full_button.signal_clicked().connect (mem_fun(*this, &Editor::temporal_zoom_session));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_full_button, _("Zoom to Session"));
zoom_box.pack_start (zoom_out_button, false, false);
zoom_box.pack_start (zoom_in_button, false, false);
zoom_box.pack_start (zoom_range_clock, false, false);
zoom_box.pack_start (zoom_out_full_button, false, false);
ARDOUR_UI::instance()->tooltips().set_tip (zoom_range_clock, _("Current Zoom Range\n(Width of visible area)"));
zoom_focus_selector.set_name ("ZoomFocusSelector");
Gtkmm2ext::set_size_request_to_display_given_text (zoom_focus_selector, "Focus Center", 2+FUDGE, 0);
Gtkmm2ext::set_size_request_to_display_given_text (zoom_focus_selector, "Edit Cursor", 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"));
zoom_box.pack_start (zoom_focus_selector, false, false);
zoom_box.pack_start (zoom_focus_selector, true, true);
zoom_box.pack_start (zoom_out_button, false, false);
zoom_box.pack_start (zoom_in_button, false, false);
zoom_box.pack_start (zoom_out_full_button, false, false);
/* Edit Cursor / Snap */
@ -2686,7 +2704,7 @@ Editor::setup_toolbar ()
hbox->pack_start (snap_box, false, false);
hbox->pack_start (zoom_box, false, false);
// hbox->pack_start (zoom_box, false, false);
hbox->pack_start (*nudge_box, false, false);
hbox->show_all ();
@ -2850,6 +2868,119 @@ Editor::commit_reversible_command ()
}
}
struct TrackViewByPositionSorter
{
bool operator() (const TimeAxisView* a, const TimeAxisView *b) {
return a->y_position < b->y_position;
}
};
bool
Editor::extend_selection_to_track (TimeAxisView& view)
{
if (selection->selected (&view)) {
/* already selected, do nothing */
return false;
}
if (selection->tracks.empty()) {
if (!selection->selected (&view)) {
selection->set (&view);
return true;
} else {
return false;
}
}
/* something is already selected, so figure out which range of things to add */
TrackViewList to_be_added;
TrackViewList sorted = track_views;
TrackViewByPositionSorter cmp;
bool passed_clicked = false;
bool forwards;
sorted.sort (cmp);
if (!selection->selected (&view)) {
to_be_added.push_back (&view);
}
/* figure out if we should go forward or backwards */
for (TrackViewList::iterator i = sorted.begin(); i != sorted.end(); ++i) {
if ((*i) == &view) {
passed_clicked = true;
}
if (selection->selected (*i)) {
if (passed_clicked) {
forwards = true;
} else {
forwards = false;
}
break;
}
}
passed_clicked = false;
if (forwards) {
for (TrackViewList::iterator i = sorted.begin(); i != sorted.end(); ++i) {
if ((*i) == &view) {
passed_clicked = true;
continue;
}
if (passed_clicked) {
if ((*i)->hidden()) {
continue;
}
if (selection->selected (*i)) {
break;
} else if (!(*i)->hidden()) {
to_be_added.push_back (*i);
}
}
}
} else {
for (TrackViewList::reverse_iterator r = sorted.rbegin(); r != sorted.rend(); ++r) {
if ((*r) == &view) {
passed_clicked = true;
continue;
}
if (passed_clicked) {
if ((*r)->hidden()) {
continue;
}
if (selection->selected (*r)) {
break;
} else if (!(*r)->hidden()) {
to_be_added.push_back (*r);
}
}
}
}
if (!to_be_added.empty()) {
selection->add (to_be_added);
return true;
}
return false;
}
bool
Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no_remove)
{
@ -2878,13 +3009,14 @@ Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no
case Selection::Set:
if (selection->selected (&view) && selection->tracks.size() == 1) {
/* no commit necessary */
}
selection->set (&view);
} else {
selection->set (&view);
commit = true;
}
break;
case Selection::Extend:
/* not defined yet */
commit = extend_selection_to_track (view);
break;
}
@ -2975,7 +3107,7 @@ void
Editor::mapped_set_selected_regionview_from_click (RouteTimeAxisView& tv, uint32_t ignored,
RegionView* basis, vector<RegionView*>* all_equivs)
{
Playlist* pl;
boost::shared_ptr<Playlist> pl;
vector<boost::shared_ptr<Region> > results;
RegionView* marv;
boost::shared_ptr<Diskstream> ds;
@ -2991,7 +3123,7 @@ Editor::mapped_set_selected_regionview_from_click (RouteTimeAxisView& tv, uint32
}
if ((pl = dynamic_cast<Playlist*>(ds->playlist())) != 0) {
if ((pl = ds->playlist()) != 0) {
pl->get_equivalent_regions (basis->region(), results);
}
@ -3192,7 +3324,7 @@ Editor::set_selected_regionview_from_region_list (boost::shared_ptr<Region> regi
if ((tatv = dynamic_cast<RouteTimeAxisView*> (*i)) != 0) {
Playlist* pl;
boost::shared_ptr<Playlist> pl;
vector<boost::shared_ptr<Region> > results;
RegionView* marv;
boost::shared_ptr<Diskstream> ds;
@ -3201,8 +3333,8 @@ Editor::set_selected_regionview_from_region_list (boost::shared_ptr<Region> regi
/* bus */
continue;
}
if ((pl = dynamic_cast<Playlist*>(ds->playlist())) != 0) {
if ((pl = (ds->playlist())) != 0) {
pl->get_region_list_equivalent_regions (region, results);
}
@ -3347,7 +3479,7 @@ Editor::duplicate_dialog (bool dup_region)
entry.set_text ("1");
set_size_request_to_display_given_text (entry, X_("12345678"), 20, 15);
entry.select_region (0, entry.get_text_length());
entry.select_region (0, -1);
entry.grab_focus ();
@ -3823,17 +3955,19 @@ Editor::end_location_changed (Location* location)
}
int
Editor::playlist_deletion_dialog (Playlist* pl)
Editor::playlist_deletion_dialog (boost::shared_ptr<Playlist> pl)
{
ArdourDialog dialog ("playlist deletion dialog");
Label label (string_compose (_("Playlist %1 is currently unused.\n"
"If left alone, no audio files used by it will be cleaned.\n"
"If deleted, audio files used by it alone by will cleaned."),
pl->name()));
"If left alone, no audio files used by it will be cleaned.\n"
"If deleted, audio files used by it alone by will cleaned."),
pl->name()));
dialog.set_position (WIN_POS_CENTER);
dialog.get_vbox()->pack_start (label);
label.show ();
dialog.add_button (_("Delete playlist"), RESPONSE_ACCEPT);
dialog.add_button (_("Keep playlist"), RESPONSE_CANCEL);
dialog.add_button (_("Cancel"), RESPONSE_CANCEL);

View file

@ -217,6 +217,8 @@ class Editor : public PublicEditor
Selection& get_selection() const { return *selection; }
Selection& get_cut_buffer() const { return *cut_buffer; }
bool extend_selection_to_track (TimeAxisView&);
void play_selection ();
void select_all_in_track (Selection::Operation op);
void select_all (Selection::Operation op);
@ -257,7 +259,7 @@ class Editor : public PublicEditor
void route_name_changed (TimeAxisView *);
gdouble frames_per_unit;
nframes_t leftmost_frame;
void clear_playlist (ARDOUR::Playlist&);
void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
void new_playlists ();
void copy_playlists ();
@ -286,6 +288,7 @@ class Editor : public PublicEditor
void set_follow_playhead (bool yn);
void toggle_follow_playhead ();
bool follow_playhead() const { return _follow_playhead; }
bool dragging_playhead () const { return _dragging_playhead; }
void toggle_waveform_visibility ();
void toggle_waveforms_while_recording ();
@ -293,12 +296,13 @@ class Editor : public PublicEditor
/* SMPTE timecode & video sync */
void smpte_fps_chosen (ARDOUR::Session::SmpteFormat format);
void smpte_fps_chosen (ARDOUR::SmpteFormat format);
void video_pullup_chosen (ARDOUR::Session::PullupFormat pullup);
void subframes_per_frame_chosen (uint32_t);
void update_smpte_mode();
void update_video_pullup();
void update_subframes_per_frame ();
/* xfades */
void toggle_auto_xfade ();
@ -652,6 +656,7 @@ class Editor : public PublicEditor
double canvas_width;
double canvas_height;
double full_canvas_height;
nframes_t last_canvas_frame;
bool track_canvas_map_handler (GdkEventAny*);
@ -921,8 +926,8 @@ class Editor : public PublicEditor
void bring_in_external_audio (Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes_t& pos, bool prompt);
void do_import (vector<Glib::ustring> paths, bool split, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes_t&, bool);
void do_embed (vector<Glib::ustring> paths, bool split, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes_t&, bool);
int import_sndfile (Glib::ustring path, Editing::ImportMode mode, ARDOUR::AudioTrack* track, nframes_t& pos);
int embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
int import_sndfile (vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::AudioTrack* track, nframes_t& pos);
int embed_sndfile (vector<Glib::ustring> paths, bool split, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
ARDOUR::AudioTrack* track, nframes_t& pos, bool prompt);
int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, ARDOUR::AudioTrack* track, nframes_t& pos, Editing::ImportMode mode);
@ -953,7 +958,7 @@ class Editor : public PublicEditor
/* to support this ... */
void import_audio (bool as_tracks);
void do_import (vector<string> paths, bool split, bool as_tracks);
void do_import (vector<Glib::ustring> paths, bool split, bool as_tracks);
void move_to_start ();
void move_to_end ();
@ -977,6 +982,8 @@ class Editor : public PublicEditor
void clear_markers ();
void clear_ranges ();
void clear_locations ();
void unhide_markers ();
void unhide_ranges ();
void jump_forward_to_mark ();
void jump_backward_to_mark ();
void cursor_align (bool playhead_to_edit);
@ -1036,10 +1043,12 @@ class Editor : public PublicEditor
void fade_in_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
void fade_out_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
std::set<ARDOUR::Playlist*> motion_frozen_playlists;
std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
void region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
void region_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
bool _dragging_playhead;
void cursor_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
void cursor_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
void marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
@ -1198,6 +1207,7 @@ class Editor : public PublicEditor
void marker_menu_select_all_selectables_using_range ();
void marker_menu_separate_regions_using_location ();
void marker_menu_play_from ();
void marker_menu_play_range ();
void marker_menu_set_playhead ();
void marker_menu_set_from_playhead ();
void marker_menu_set_from_selection ();
@ -1210,14 +1220,14 @@ class Editor : public PublicEditor
void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
void build_range_marker_menu ();
void build_marker_menu ();
void build_range_marker_menu (bool loop_or_punch);
void build_marker_menu (bool start_or_end);
void build_tm_marker_menu ();
void build_transport_marker_menu ();
void build_new_transport_marker_menu ();
Gtk::Menu* tm_marker_menu;
Gtk::Menu* marker_menu;
Gtk::Menu* start_end_marker_menu;
Gtk::Menu* range_marker_menu;
Gtk::Menu* transport_marker_menu;
Gtk::Menu* new_transport_marker_menu;
@ -1750,7 +1760,7 @@ class Editor : public PublicEditor
/* handling cleanup */
int playlist_deletion_dialog (ARDOUR::Playlist*);
int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
vector<sigc::connection> session_connections;

View file

@ -42,6 +42,7 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, X_("Layering"), _("Layering"));
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_("addExistingAudioFiles"), _("Add Existing Audio"));
/* add named actions for the editor */
@ -59,7 +60,7 @@ Editor::register_actions ()
act = ActionManager::register_toggle_action (editor_actions, "toggle-xfades-active", _("Active"), mem_fun(*this, &Editor::toggle_xfades_active));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (editor_actions, "toggle-xfades-visible", _("Visible"), mem_fun(*this, &Editor::toggle_xfade_visibility));
act = ActionManager::register_toggle_action (editor_actions, "toggle-xfades-visible", _("Show"), mem_fun(*this, &Editor::toggle_xfade_visibility));
ActionManager::session_sensitive_actions.push_back (act);
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);
@ -379,16 +380,16 @@ Editor::register_actions ()
RadioAction::Group smpte_group;
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte23976"), _("23.976"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_23976));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte24"), _("24"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_24));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte24976"), _("24.976"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_24976));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte25"), _("25"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_25));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte2997"), _("29.97"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_2997));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte2997drop"), _("29.97 drop"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_2997drop));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte30"), _("30"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_30));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte30drop"), _("30 drop"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_30drop));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte5994"), _("59.94"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_5994));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte60"), _("60"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), Session::smpte_60));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte23976"), _("23.976"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_23976));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte24"), _("24"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_24));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte24976"), _("24.976"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_24976));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte25"), _("25"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_25));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte2997"), _("29.97"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_2997));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte2997drop"), _("29.97 drop"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_2997drop));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte30"), _("30"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_30));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte30drop"), _("30 drop"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_30drop));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte5994"), _("59.94"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_5994));
ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte60"), _("60"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_60));
RadioAction::Group pullup_group;
@ -402,6 +403,11 @@ Editor::register_actions ()
ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupMinus4"), _("-4.1667%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Minus4));
ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupMinus4Minus1"), _("-4.1667% - 0.1%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Minus4Minus1));
RadioAction::Group subframe_group;
ActionManager::register_radio_action (editor_actions, pullup_group, X_("Subframes80"), _("80 per frame"), bind (mem_fun (*this, &Editor::subframes_per_frame_chosen), 80));
ActionManager::register_radio_action (editor_actions, pullup_group, X_("Subframes100"), _("100 per frame"), bind (mem_fun (*this, &Editor::subframes_per_frame_chosen), 100));
ActionManager::add_action_group (rl_actions);
ActionManager::add_action_group (zoom_actions);
ActionManager::add_action_group (mouse_mode_actions);
@ -496,33 +502,37 @@ Editor::update_smpte_mode ()
RefPtr<Action> act;
const char* action = 0;
float frames = Config->get_smpte_frames_per_second();
bool drop = Config->get_smpte_drop_frames();
if ((frames < 23.976 * 1.0005) && !drop)
switch (Config->get_smpte_format()) {
case smpte_23976:
action = X_("Smpte23976");
else if ((frames < 24 * 1.0005) && !drop)
break;
case smpte_24:
action = X_("Smpte24");
else if ((frames < 24.976 * 1.0005) && !drop)
break;
case smpte_24976:
action = X_("Smpte24976");
else if ((frames < 25 * 1.0005) && !drop)
break;
case smpte_25:
action = X_("Smpte25");
else if ((frames < 29.97 * 1.0005) && !drop)
break;
case smpte_2997:
action = X_("Smpte2997");
else if ((frames < 29.97 * 1.0005) && drop)
break;
case smpte_2997drop:
action = X_("Smpte2997drop");
else if ((frames < 30 * 1.0005) && !drop)
break;
case smpte_30:
action = X_("Smpte30");
else if ((frames < 30 * 1.0005) && drop)
break;
case smpte_30drop:
action = X_("Smpte30drop");
else if ((frames < 59.94 * 1.0005) && !drop)
break;
case smpte_5994:
action = X_("Smpte5994");
else if ((frames < 60 * 1.0005) && !drop)
break;
case smpte_60:
action = X_("Smpte60");
else {
fatal << string_compose (_("programming error: Unexpected SMPTE value (%1, drop = %2) in update_smpte_mode. Menu is probably wrong."),
frames, drop) << endmsg;
/*NOTREACHED*/
break;
}
act = ActionManager::get_action (X_("Editor"), action);
@ -831,7 +841,7 @@ Editor::zoom_focus_chosen (ZoomFocus focus)
}
void
Editor::smpte_fps_chosen (Session::SmpteFormat format)
Editor::smpte_fps_chosen (SmpteFormat format)
{
/* this is driven by a toggle on a radio group, and so is invoked twice,
once for the item that became inactive and once for the one that became
@ -840,62 +850,39 @@ Editor::smpte_fps_chosen (Session::SmpteFormat format)
if (session) {
float fps = 10;
bool drop = false;
RefPtr<Action> act;
switch (format) {
case Session::smpte_23976: {
fps=23.976;
drop = false;
case smpte_23976:
act = ActionManager::get_action (X_("Editor"), X_("Smpte23976"));
} break;
case Session::smpte_24: {
fps=24;
drop = false;
break;
case smpte_24:
act = ActionManager::get_action (X_("Editor"), X_("Smpte24"));
} break;
case Session::smpte_24976: {
fps=24.976;
drop = false;
break;
case smpte_24976:
act = ActionManager::get_action (X_("Editor"), X_("Smpte24976"));
} break;
case Session::smpte_25: {
fps=25;
drop = false;
break;
case smpte_25:
act = ActionManager::get_action (X_("Editor"), X_("Smpte25"));
} break;
case Session::smpte_2997: {
fps=29.97;
drop = false;
break;
case smpte_2997:
act = ActionManager::get_action (X_("Editor"), X_("Smpte2997"));
} break;
case Session::smpte_2997drop: {
fps=29.97;
drop = true;
break;
case smpte_2997drop:
act = ActionManager::get_action (X_("Editor"), X_("Smpte2997drop"));
} break;
case Session::smpte_30: {
fps=30;
drop = false;
break;
case smpte_30:
act = ActionManager::get_action (X_("Editor"), X_("Smpte30"));
} break;
case Session::smpte_30drop: {
fps=30;
drop = true;
break;
case smpte_30drop:
act = ActionManager::get_action (X_("Editor"), X_("Smpte30drop"));
} break;
case Session::smpte_5994: {
fps=59.94;
drop = false;
break;
case smpte_5994:
act = ActionManager::get_action (X_("Editor"), X_("Smpte5994"));
} break;
case Session::smpte_60: {
fps=60;
drop = false;
break;
case smpte_60:
act = ActionManager::get_action (X_("Editor"), X_("Smpte60"));
} break;
break;
default:
cerr << "Editor received unexpected smpte type" << endl;
}
@ -903,7 +890,7 @@ Editor::smpte_fps_chosen (Session::SmpteFormat format)
if (act) {
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
if (ract && ract->get_active()) {
session->set_smpte_type (fps, drop);
session->set_smpte_format (format);
}
}
}
@ -978,6 +965,70 @@ Editor::video_pullup_chosen (Session::PullupFormat pullup)
}
}
void
Editor::update_subframes_per_frame ()
{
ENSURE_GUI_THREAD (mem_fun(*this, &Editor::update_subframes_per_frame));
RefPtr<Action> act;
const char* action = 0;
uint32_t sfpf = Config->get_subframes_per_frame();
if (sfpf == 80) {
action = X_("Subframes80");
} else if (sfpf == 100) {
action = X_("Subframes100");
} else {
warning << string_compose (_("Configuraton is using unhandled subframes per frame value: %1"), sfpf) << endmsg;
/*NOTREACHED*/
return;
}
act = ActionManager::get_action (X_("Editor"), action);
if (act) {
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
if (ract && !ract->get_active()) {
ract->set_active (true);
}
}
}
void
Editor::subframes_per_frame_chosen (uint32_t sfpf)
{
/* this is driven by a toggle on a radio group, and so is invoked twice,
once for the item that became inactive and once for the one that became
active.
*/
const char* action = 0;
RefPtr<Action> act;
if (sfpf == 80) {
action = X_("Subframes80");
} else if (sfpf == 100) {
action = X_("Subframes100");
} else {
fatal << string_compose (_("programming error: %1 %2"), "Session received unexpected subframes per frame value: ", sfpf) << endmsg;
/*NOTREACHED*/
}
act = ActionManager::get_action (X_("Editor"), action);
if (act) {
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
if (ract && ract->get_active()) {
Config->set_subframes_per_frame ((uint32_t) rint (sfpf));
}
} else {
error << string_compose (_("programming error: %1"), "Editor::subframes_per_frame_chosen could not find action to match value.") << endmsg;
}
}
void
Editor::toggle_auto_xfade ()
{
@ -1011,8 +1062,8 @@ Editor::parameter_changed (const char* parameter_name)
update_punch_range_view (true);
} else if (PARAM_IS ("layer-model")) {
update_layering_model ();
} else if (PARAM_IS ("smpte-frames-per-second") || PARAM_IS ("smpte-drop-frames")) {
update_smpte_mode ();
} else if (PARAM_IS ("smpte-format")) {
update_smpte_mode ();
update_just_smpte ();
} else if (PARAM_IS ("video-pullup")) {
update_video_pullup ();
@ -1026,6 +1077,9 @@ Editor::parameter_changed (const char* parameter_name)
update_crossfade_model ();
} else if (PARAM_IS ("edit-mode")) {
edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode()));
} else if (PARAM_IS ("subframes-per-frame")) {
update_subframes_per_frame ();
update_just_smpte ();
}
#undef PARAM_IS

View file

@ -49,6 +49,7 @@ using namespace PBD;
using namespace sigc;
using namespace Gtk;
using namespace Editing;
using Glib::ustring;
/* Functions supporting the incorporation of external (non-captured) audio material into ardour */
@ -95,7 +96,7 @@ Editor::bring_in_external_audio (ImportMode mode, AudioTrack* track, nframes_t&
}
void
Editor::do_import (vector<Glib::ustring> paths, bool split, ImportMode mode, AudioTrack* track, nframes_t& pos, bool prompt)
Editor::do_import (vector<ustring> paths, bool split, ImportMode mode, AudioTrack* track, nframes_t& pos, bool prompt)
{
/* SFDB sets "multichan" to true to indicate "split channels"
so reverse the setting to match the way libardour
@ -107,49 +108,119 @@ Editor::do_import (vector<Glib::ustring> paths, bool split, ImportMode mode, Aud
if (interthread_progress_window == 0) {
build_interthread_progress_window ();
}
/* for each path that was selected, import it and then potentially create a new track
containing the new region as the sole contents.
*/
for (vector<Glib::ustring>::iterator i = paths.begin(); i != paths.end(); ++i ) {
import_sndfile (*i, mode, track, pos);
vector<ustring> to_import;
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) {
to_import.clear ();
to_import.push_back (*a);
import_sndfile (to_import, mode, track, pos);
}
interthread_progress_window->hide_all ();
}
void
Editor::do_embed (vector<Glib::ustring> paths, bool split, ImportMode mode, AudioTrack* track, nframes_t& pos, bool prompt)
Editor::do_embed (vector<ustring> paths, bool split, ImportMode mode, AudioTrack* track, nframes_t& pos, bool prompt)
{
bool multiple_files = paths.size() > 1;
bool check_sample_rate = true;
vector<Glib::ustring>::iterator i;
for (i = paths.begin(); i != paths.end(); ++i) {
int ret = embed_sndfile (*i, split, multiple_files, check_sample_rate, mode, track, pos, prompt);
vector<ustring>::iterator a;
if (ret < -1) {
break;
for (a = paths.begin(); a != paths.end(); ) {
Glib::ustring path = *a;
Glib::ustring pair_base;
vector<ustring> to_embed;
to_embed.push_back (path);
a = paths.erase (a);
if (path_is_paired (path, pair_base)) {
ustring::size_type len = pair_base.length();
for (vector<Glib::ustring>::iterator b = paths.begin(); b != paths.end(); ) {
if (((*b).substr (0, len) == pair_base) && ((*b).length() == path.length())) {
to_embed.push_back (*b);
/* don't process this one again */
b = paths.erase (b);
break;
} else {
++b;
}
}
}
if (to_embed.size() > 1) {
vector<string> choices;
choices.push_back (string_compose (_("Import as a %1 region"),
to_embed.size() > 2 ? _("multichannel") : _("stereo")));
choices.push_back (_("Import as multiple regions"));
Gtkmm2ext::Choice chooser (string_compose (_("Paired files detected (%1, %2 ...).\nDo you want to:"),
to_embed[0],
to_embed[1]),
choices);
if (chooser.run () == 0) {
/* keep them paired */
if (embed_sndfile (to_embed, split, multiple_files, check_sample_rate, mode, track, pos, prompt) < -1) {
break;
}
} else {
/* one thing per file */
vector<ustring> foo;
for (vector<ustring>::iterator x = to_embed.begin(); x != to_embed.end(); ++x) {
foo.clear ();
foo.push_back (*x);
if (embed_sndfile (foo, split, multiple_files, check_sample_rate, mode, track, pos, prompt) < -1) {
break;
}
}
}
} else {
if (embed_sndfile (to_embed, split, multiple_files, check_sample_rate, mode, track, pos, prompt) < -1) {
break;
}
}
}
if (i == paths.end()) {
if (a == paths.end()) {
session->save_state ("");
}
}
int
Editor::import_sndfile (Glib::ustring path, ImportMode mode, AudioTrack* track, nframes_t& pos)
Editor::import_sndfile (vector<ustring> paths, ImportMode mode, AudioTrack* track, nframes_t& pos)
{
interthread_progress_window->set_title (string_compose (_("ardour: importing %1"), path));
interthread_progress_window->set_title (string_compose (_("ardour: importing %1"), paths.front()));
interthread_progress_window->set_position (Gtk::WIN_POS_MOUSE);
interthread_progress_window->show_all ();
interthread_progress_bar.set_fraction (0.0f);
interthread_cancel_label.set_text (_("Cancel Import"));
current_interthread_info = &import_status;
import_status.pathname = path;
import_status.paths = paths;
import_status.done = false;
import_status.cancel = false;
import_status.freeze = false;
@ -161,8 +232,8 @@ Editor::import_sndfile (Glib::ustring path, ImportMode mode, AudioTrack* track,
track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending ();
/* start import thread for this path. this will ultimately call Session::import_audiofile()
and if successful will add the file as a region to the session region list.
/* start import thread for this spec. this will ultimately call Session::import_audiofile()
and if successful will add the file(s) as a region to the session region list.
*/
pthread_create_and_store ("import", &import_status.thread, 0, _import_thread, this);
@ -187,7 +258,7 @@ Editor::import_sndfile (Glib::ustring path, ImportMode mode, AudioTrack* track,
}
int
Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool& check_sample_rate, ImportMode mode,
Editor::embed_sndfile (vector<Glib::ustring> paths, bool split, bool multiple_files, bool& check_sample_rate, ImportMode mode,
AudioTrack* track, nframes_t& pos, bool prompt)
{
boost::shared_ptr<AudioFileSource> source;
@ -196,96 +267,104 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
string idspec;
string linked_path;
SoundFileInfo finfo;
string region_name;
uint32_t input_chan;
uint32_t output_chan;
ustring region_name;
uint32_t input_chan = 0;
uint32_t output_chan = 0;
track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending ();
/* lets see if we can link it into the session */
linked_path = session->sound_dir();
linked_path += Glib::path_get_basename (path);
for (vector<Glib::ustring>::iterator p = paths.begin(); p != paths.end(); ++p) {
if (link (path.c_str(), linked_path.c_str()) == 0) {
ustring path = *p;
/* there are many reasons why link(2) might have failed.
but if it succeeds, we now have a link in the
session sound dir that will protect against
unlinking of the original path. nice.
*/
path = linked_path;
}
/* note that we temporarily truncated _id at the colon */
string error_msg;
if (!AudioFileSource::get_soundfile_info (path, finfo, error_msg)) {
error << string_compose(_("Editor: cannot open file \"%1\", (%2)"), selection, error_msg ) << endmsg;
return 0;
}
if (check_sample_rate && (finfo.samplerate != (int) session->frame_rate())) {
vector<string> choices;
/* lets see if we can link it into the session */
if (multiple_files) {
choices.push_back (_("Cancel entire import"));
choices.push_back (_("Don't embed it"));
choices.push_back (_("Embed all without questions"));
} else {
choices.push_back (_("Cancel"));
}
choices.push_back (_("Embed it anyway"));
linked_path = session->sound_dir();
linked_path += '/';
linked_path += Glib::path_get_basename (path);
Gtkmm2ext::Choice rate_choice (
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
choices, false);
switch (rate_choice.run()) {
case 0: /* stop a multi-file import */
case 1: /* don't import this one */
return -1;
case 2: /* do it, and the rest without asking */
check_sample_rate = false;
break;
case 3: /* do it */
break;
default:
return -2;
}
}
track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending ();
/* make the proper number of channels in the region */
for (int n = 0; n < finfo.channels; ++n)
{
idspec = path;
idspec += string_compose(":%1", n);
try {
source = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createReadable
(DataType::AUDIO, *session, idspec,
(mode == ImportAsTapeTrack ?
AudioFileSource::Destructive :
AudioFileSource::Flag (0))));
sources.push_back(source);
}
catch (failed_constructor& err) {
error << string_compose(_("could not open %1"), path) << endmsg;
goto out;
if (link (path.c_str(), linked_path.c_str()) == 0) {
/* there are many reasons why link(2) might have failed.
but if it succeeds, we now have a link in the
session sound dir that will protect against
unlinking of the original path. nice.
*/
path = linked_path;
}
/* note that we temporarily truncated _id at the colon */
string error_msg;
if (!AudioFileSource::get_soundfile_info (path, finfo, error_msg)) {
error << string_compose(_("Editor: cannot open file \"%1\", (%2)"), selection, error_msg ) << endmsg;
return 0;
}
if (check_sample_rate && (finfo.samplerate != (int) session->frame_rate())) {
vector<string> choices;
if (multiple_files) {
choices.push_back (_("Cancel entire import"));
choices.push_back (_("Don't embed it"));
choices.push_back (_("Embed all without questions"));
} else {
choices.push_back (_("Cancel"));
}
choices.push_back (_("Embed it anyway"));
Gtkmm2ext::Choice rate_choice (
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
choices, false);
switch (rate_choice.run()) {
case 0: /* stop a multi-file import */
case 1: /* don't import this one */
return -1;
case 2: /* do it, and the rest without asking */
check_sample_rate = false;
break;
case 3: /* do it */
break;
default:
return -2;
}
}
track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending ();
}
/* make the proper number of channels in the region */
input_chan += finfo.channels;
for (int n = 0; n < finfo.channels; ++n)
{
idspec = path;
idspec += string_compose(":%1", n);
try {
source = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createReadable
(DataType::AUDIO, *session, idspec,
(mode == ImportAsTapeTrack ?
AudioFileSource::Destructive :
AudioFileSource::Flag (0))));
sources.push_back(source);
}
catch (failed_constructor& err) {
error << string_compose(_("could not open %1"), path) << endmsg;
goto out;
}
ARDOUR_UI::instance()->flush_pending ();
}
}
if (sources.empty()) {
goto out;
}
@ -294,20 +373,17 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
pos = sources[0]->natural_position();
}
region_name = PBD::basename_nosuffix (path);
region_name += "-0";
region_name = region_name_from_path (paths.front(), (sources.size() > 1));
region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (sources, 0, sources[0]->length(), region_name, 0,
Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External)));
input_chan = finfo.channels;
if (Config->get_output_auto_connect() & AutoConnectMaster) {
output_chan = (session->master_out() ? session->master_out()->n_inputs().get(DataType::AUDIO) : input_chan);
} else {
output_chan = input_chan;
}
finish_bringing_in_audio (region, input_chan, output_chan, track, pos, mode);
out:
@ -325,7 +401,7 @@ Editor::finish_bringing_in_audio (boost::shared_ptr<AudioRegion> region, uint32_
case ImportToTrack:
if (track) {
Playlist* playlist = track->diskstream()->playlist();
boost::shared_ptr<Playlist> playlist = track->diskstream()->playlist();
boost::shared_ptr<AudioRegion> copy (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (region)));
begin_reversible_command (_("insert sndfile"));

View file

@ -294,7 +294,6 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc)
bool
Editor::track_canvas_idle ()
{
if (canvas_idle_queued) {
canvas_idle_queued = false;
}
@ -302,6 +301,27 @@ Editor::track_canvas_idle ()
canvas_width = canvas_allocation.get_width();
canvas_height = canvas_allocation.get_height();
full_canvas_height = canvas_height;
if (session) {
TrackViewList::iterator i;
double height = 0;
for (i = track_views.begin(); i != track_views.end(); ++i) {
if ((*i)->control_parent) {
height += (*i)->effective_height;
height += track_spacing;
}
}
if (height) {
height -= track_spacing;
}
full_canvas_height = height;
}
zoom_range_clock.set ((nframes_t) floor ((canvas_width * frames_per_unit)));
edit_cursor->set_position (edit_cursor->current_frame);
playhead_cursor->set_position (playhead_cursor->current_frame);
@ -313,7 +333,7 @@ Editor::track_canvas_idle ()
if (playhead_cursor) playhead_cursor->set_length (canvas_height);
if (marker_drag_line) {
marker_drag_line_points.back().set_x(canvas_height);
marker_drag_line_points.back().set_y(canvas_height);
marker_drag_line->property_points() = marker_drag_line_points;
}
@ -434,8 +454,6 @@ Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context
const SelectionData& data,
guint info, guint time)
{
cerr << "dropping, target = " << data.get_target() << endl;
if (data.get_target() == "regions") {
drop_regions (context, x, y, data, info, time);
} else {

View file

@ -76,7 +76,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
if (!(current_stepping_trackview = dynamic_cast<AudioTimeAxisView*> (trackview_by_y_position (ev->y)))) {
if (!(current_stepping_trackview = trackview_by_y_position (ev->y))) {
return false;
}
}
@ -107,7 +107,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
if (!(current_stepping_trackview = dynamic_cast<AudioTimeAxisView*> (trackview_by_y_position (ev->y)))) {
if (!(current_stepping_trackview = trackview_by_y_position (ev->y))) {
return false;
}
}
@ -513,8 +513,8 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
if (atv->is_audio_track()) {
AudioPlaylist* pl;
if ((pl = dynamic_cast<AudioPlaylist*> (atv->get_diskstream()->playlist())) != 0) {
boost::shared_ptr<AudioPlaylist> pl;
if ((pl = boost::dynamic_pointer_cast<AudioPlaylist> (atv->get_diskstream()->playlist())) != 0) {
Playlist::RegionList* rl = pl->regions_at (event_frame (event));

View file

@ -119,7 +119,7 @@ Editor::edit_group_list_button_press_event (GdkEventButton* ev)
if (edit_group_list_menu == 0) {
build_edit_group_list_menu ();
}
edit_group_list_menu->popup (1, 0);
edit_group_list_menu->popup (1, ev->time);
return true;
}

View file

@ -290,7 +290,7 @@ Editor::write_audio_selection (TimeSelection& ts)
if (atv->is_audio_track()) {
AudioPlaylist* playlist = dynamic_cast<AudioPlaylist*>(atv->get_diskstream()->playlist());
boost::shared_ptr<AudioPlaylist> playlist = boost::dynamic_pointer_cast<AudioPlaylist>(atv->get_diskstream()->playlist());
if (playlist && write_audio_range (*playlist, atv->get_diskstream()->n_channels(), ts) == 0) {
ret = -1;

View file

@ -100,16 +100,14 @@ Editor::scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item)
nframes_t offset = 0;
nframes_t x_pos = 0 ;
if(item->get_position() < offset)
{
if (item->get_position() < offset) {
x_pos = 0 ;
}
else
{
x_pos = item->get_position() - offset + (item->get_duration() / 2) ;
} else {
x_pos = item->get_position() - offset + (item->get_duration() / 2);
}
reposition_x_origin(x_pos) ;
reposition_x_origin (x_pos);
}
void

View file

@ -288,8 +288,10 @@ Editor::LocationMarkers::set_color_rgba (uint32_t rgba)
void
Editor::mouse_add_new_marker (nframes_t where)
{
string markername;
if (session) {
Location *location = new Location (where, where, "mark", Location::IsMark);
session->locations()->next_available_name(markername,"mark");
Location *location = new Location (where, where, markername, Location::IsMark);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
@ -313,17 +315,7 @@ Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
Location* loc = find_location_from_marker (marker, is_start);
if (session && loc) {
if (loc->is_end()) {
/* you can't hide or delete this marker */
return;
}
if (loc->is_auto_loop() || loc->is_auto_punch()) {
// just hide them
loc->set_hidden (true, this);
}
else {
Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
}
Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
}
}
@ -388,16 +380,24 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
Location * loc = find_location_from_marker (marker, is_start);
if (loc == transport_loop_location() || loc == transport_punch_location()) {
if (transport_marker_menu == 0) {
build_transport_marker_menu ();
build_range_marker_menu (true);
}
marker_menu_item = item;
transport_marker_menu->popup (1, ev->time);
} else {
if (loc->is_mark()) {
if (marker_menu == 0) {
build_marker_menu ();
}
bool start_or_end = loc->is_start() || loc->is_end();
Menu *markerMenu;
if (start_or_end) {
if (start_end_marker_menu == 0)
build_marker_menu (true);
markerMenu = start_end_marker_menu;
} else {
if (marker_menu == 0)
build_marker_menu (false);
markerMenu = marker_menu;
}
// GTK2FIX use action group sensitivity
@ -415,12 +415,12 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
}
#endif
marker_menu_item = item;
marker_menu->popup (1, ev->time);
markerMenu->popup (1, ev->time);
}
if (loc->is_range_marker()) {
if (range_marker_menu == 0){
build_range_marker_menu ();
build_range_marker_menu (false);
}
marker_menu_item = item;
range_marker_menu->popup (1, ev->time);
@ -443,20 +443,25 @@ void
Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
{
if (transport_marker_menu == 0) {
build_transport_marker_menu ();
build_range_marker_menu (true);
}
transport_marker_menu->popup (1, ev->time);
}
void
Editor::build_marker_menu ()
Editor::build_marker_menu (bool start_or_end)
{
using namespace Menu_Helpers;
marker_menu = new Menu;
MenuList& items = marker_menu->items();
marker_menu->set_name ("ArdourContextMenu");
Menu *markerMenu = new Menu;
if (start_or_end) {
start_end_marker_menu = markerMenu;
} else {
marker_menu = markerMenu;
}
MenuList& items = markerMenu->items();
markerMenu->set_name ("ArdourContextMenu");
items.push_back (MenuElem (_("Locate to Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
items.push_back (MenuElem (_("Play from Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
@ -464,32 +469,43 @@ Editor::build_marker_menu ()
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Rename Mark"), mem_fun(*this, &Editor::marker_menu_rename)));
items.push_back (MenuElem (_("Hide Mark"), mem_fun(*this, &Editor::marker_menu_hide)));
if (start_or_end) return;
items.push_back (MenuElem (_("Rename Mark"), mem_fun(*this, &Editor::marker_menu_rename)));
items.push_back (MenuElem (_("Remove Mark"), mem_fun(*this, &Editor::marker_menu_remove)));
}
void
Editor::build_range_marker_menu ()
Editor::build_range_marker_menu (bool loop_or_punch)
{
using namespace Menu_Helpers;
range_marker_menu = new Menu;
MenuList& items = range_marker_menu->items();
range_marker_menu->set_name ("ArdourContextMenu");
Menu *markerMenu = new Menu;
if (loop_or_punch) {
transport_marker_menu = markerMenu;
} else {
range_marker_menu = markerMenu;
}
MenuList& items = markerMenu->items();
markerMenu->set_name ("ArdourContextMenu");
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)));
items.push_back (MenuElem (_("Loop Range"), mem_fun(*this, &Editor::marker_menu_loop_range)));
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)));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Rename Range"), mem_fun(*this, &Editor::marker_menu_rename)));
items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
items.push_back (MenuElem (_("Remove Range"), mem_fun(*this, &Editor::marker_menu_remove)));
if (! loop_or_punch) {
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)));
}
items.push_back (SeparatorElem());
@ -526,26 +542,6 @@ Editor::build_new_transport_marker_menu ()
new_transport_marker_menu->signal_unmap_event().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown));
}
void
Editor::build_transport_marker_menu ()
{
using namespace Menu_Helpers;
transport_marker_menu = new Menu;
MenuList& items = transport_marker_menu->items();
transport_marker_menu->set_name ("ArdourContextMenu");
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)));
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)));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
items.push_back (SeparatorElem());
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)));
}
void
Editor::marker_menu_hide ()
{
@ -726,6 +722,32 @@ Editor::marker_menu_set_from_selection ()
}
}
void
Editor::marker_menu_play_range ()
{
Marker* marker;
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
}
Location* l;
bool is_start;
if ((l = find_location_from_marker (marker, is_start)) != 0) {
if (l->is_mark()) {
session->request_locate (l->start(), true);
}
else {
session->request_bounded_roll (l->start(), l->end());
}
}
}
void
Editor::marker_menu_loop_range ()
{

View file

@ -164,12 +164,16 @@ Editor::update_current_screen ()
frame = session->audible_frame();
if (_dragging_playhead) {
goto almost_done;
}
/* only update if the playhead is on screen or we are following it */
if (_follow_playhead) {
playhead_cursor->canvas_item.show();
if (frame != last_update_frame) {
const jack_nframes_t page_width = current_page_frames();
@ -209,6 +213,7 @@ Editor::update_current_screen ()
}
}
almost_done:
last_update_frame = frame;
if (current_mixer_strip) {

View file

@ -317,6 +317,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
switch (item_type) {
case RegionItem:
/* XXX make tying track/region selection optional */
c1 = set_selected_track_from_click (op, true);
c2 = set_selected_regionview_from_click (press, op, true);
commit = (c1 || c2);
@ -324,6 +325,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
case RegionViewNameHighlight:
case RegionViewName:
/* XXX make tying track/region selection optional */
c1 = set_selected_track_from_click (op, true);
c2 = set_selected_regionview_from_click (press, op, true);
commit = (c1 || c2);
@ -332,6 +334,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
case GainAutomationControlPointItem:
case PanAutomationControlPointItem:
case RedirectAutomationControlPointItem:
/* XXX make tying track/region selection optional */
c1 = set_selected_track_from_click (op, true);
c2 = set_selected_control_point_from_click (op, false);
commit = (c1 || c2);
@ -1943,8 +1946,10 @@ Editor::start_cursor_grab (ArdourCanvas::Item* item, GdkEvent* event)
Cursor* cursor = (Cursor *) drag_info.data;
if (session && cursor == playhead_cursor) {
if (drag_info.was_rolling) {
if (cursor == playhead_cursor) {
_dragging_playhead = true;
if (session && drag_info.was_rolling) {
session->request_stop ();
}
}
@ -1979,6 +1984,8 @@ Editor::cursor_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
if (cursor == edit_cursor) {
edit_cursor_clock.set (cursor->current_frame);
} else {
UpdateAllTransportClocks (cursor->current_frame);
}
show_verbose_time_cursor (cursor->current_frame, 10);
@ -1993,6 +2000,8 @@ Editor::cursor_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
if (drag_info.first_move) return;
cursor_drag_motion_callback (item, event);
_dragging_playhead = false;
if (item == &playhead_cursor->canvas_item) {
if (session) {
@ -2490,7 +2499,7 @@ Editor::start_control_point_grab (ArdourCanvas::Item* item, GdkEvent* event)
start_grab (event, fader_cursor);
control_point->line.start_drag (control_point, 0);
control_point->line.start_drag (control_point, drag_info.grab_frame, 0);
float fraction = 1.0 - (control_point->get_y() / control_point->line.height());
set_verbose_canvas_cursor (control_point->line.get_verbose_cursor_string (fraction),
@ -2623,7 +2632,7 @@ Editor::start_line_grab (AutomationLine* line, GdkEvent* event)
double fraction = 1.0 - (cy / line->height());
line->start_drag (0, fraction);
line->start_drag (0, drag_info.grab_frame, fraction);
set_verbose_canvas_cursor (line->get_verbose_cursor_string (fraction),
drag_info.current_pointer_x + 20, drag_info.current_pointer_y + 20);
@ -2700,6 +2709,8 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event)
void
Editor::start_region_copy_grab (ArdourCanvas::Item* item, GdkEvent* event)
{
cerr << "start region copy grab, selected regions = " << selection->regions.size() << endl;
if (selection->regions.empty() || clicked_regionview == 0) {
return;
}
@ -2725,6 +2736,7 @@ Editor::start_region_copy_grab (ArdourCanvas::Item* item, GdkEvent* event)
drag_info.want_move_threshold = true;
drag_info.motion_callback = &Editor::region_drag_motion_callback;
drag_info.finished_callback = &Editor::region_drag_finished_callback;
show_verbose_time_cursor (drag_info.last_frame_position, 10);
}
void
@ -2773,8 +2785,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
vector<int32_t> height_list(512) ;
vector<int32_t>::iterator j;
show_verbose_time_cursor (drag_info.last_frame_position, 10);
if (drag_info.copy && drag_info.move_threshold_passed && drag_info.want_move_threshold) {
drag_info.want_move_threshold = false; // don't copy again
@ -2787,15 +2797,16 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
vector<RegionView*> new_regionviews;
set<Playlist*> affected_playlists;
pair<set<Playlist*>::iterator,bool> insert_result;
set<boost::shared_ptr<Playlist> > affected_playlists;
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
// TODO: Crossfades need to be copied!
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) {
RegionView* rv;
rv = (*i);
Playlist* to_playlist = rv->region()->playlist();
boost::shared_ptr<Playlist> to_playlist = rv->region()->playlist();
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&rv->get_time_axis_view());
insert_result = affected_playlists.insert (to_playlist);
@ -2826,6 +2837,8 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
new_regionviews.push_back (latest_regionview);
}
}
if (new_regionviews.empty()) {
return;
@ -3116,7 +3129,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
MOTION
************************************************************/
pair<set<Playlist*>::iterator,bool> insert_result;
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
const list<RegionView*>& layered_regions = selection->regions.by_layer();
for (list<RegionView*>::const_iterator i = layered_regions.begin(); i != layered_regions.end(); ++i) {
@ -3227,8 +3240,8 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
*/
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view());
if (rtv && rtv->is_track()) {
Playlist* pl = dynamic_cast<Playlist*>(rtv->get_diskstream()->playlist());
if (rtv && rtv->is_audio_track()) {
boost::shared_ptr<AudioPlaylist> pl = boost::dynamic_pointer_cast<AudioPlaylist>(rtv->get_diskstream()->playlist());
if (pl) {
/* only freeze and capture state once */
@ -3239,6 +3252,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
}
}
}
rv->region()->set_opaque(false);
}
if (drag_info.brushing) {
@ -3265,7 +3279,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
{
nframes_t where;
RegionView* rv = reinterpret_cast<RegionView *> (drag_info.data);
pair<set<Playlist*>::iterator,bool> insert_result;
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
bool nocommit = true;
double speed;
RouteTimeAxisView* atv;
@ -3337,8 +3351,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
for (list<RegionView*>::const_iterator i = new_selection.begin(); i != new_selection.end();i++ ) {
Playlist* from_playlist;
Playlist* to_playlist;
boost::shared_ptr<Playlist> from_playlist;
boost::shared_ptr<Playlist> to_playlist;
double ix1, ix2, iy1, iy2;
@ -3346,6 +3360,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
(*i)->get_canvas_group()->i2w (ix1, iy1);
TimeAxisView* tvp2 = trackview_by_y_position (iy1);
RouteTimeAxisView* atv2 = dynamic_cast<RouteTimeAxisView*>(tvp2);
(*i)->region()->set_opaque (true);
from_playlist = (*i)->region()->playlist();
to_playlist = atv2->playlist();
@ -3372,8 +3388,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
for (list<RegionView*>::const_iterator i = new_selection.begin(); i != new_selection.end();i++ ) {
Playlist* from_playlist;
Playlist* to_playlist;
boost::shared_ptr<Playlist> from_playlist;
boost::shared_ptr<Playlist> to_playlist;
double ix1, ix2, iy1, iy2;
@ -3439,13 +3455,14 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
/* no need to add an undo here, we did that when we added this playlist to motion_frozen playlists */
rv->region()->set_position (where, (void *) this);
rv->region()->set_opaque (true);
}
}
out:
for (set<Playlist*>::iterator p = motion_frozen_playlists.begin(); p != motion_frozen_playlists.end(); ++p) {
for (set<boost::shared_ptr<Playlist> >::iterator p = motion_frozen_playlists.begin(); p != motion_frozen_playlists.end(); ++p) {
(*p)->thaw ();
session->add_command (new MementoCommand<Playlist>(*(*p), 0, & (*p)->get_state()));
session->add_command (new MementoCommand<Playlist>(*((*p).get()), 0, & (*p)->get_state()));
}
motion_frozen_playlists.clear ();
@ -3491,6 +3508,8 @@ Editor::show_verbose_time_cursor (nframes_t frame, double offset, double xpos, d
char buf[128];
SMPTE::Time smpte;
BBT_Time bbt;
int hours, mins;
nframes_t frame_rate;
float secs;
if (session == 0) {
@ -3509,10 +3528,14 @@ Editor::show_verbose_time_cursor (nframes_t frame, double offset, double xpos, d
break;
case AudioClock::MinSec:
/* XXX fix this to compute min/sec properly */
session->smpte_time (frame, smpte);
secs = smpte.seconds + ((float) smpte.frames / Config->get_smpte_frames_per_second());
snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%.4f", smpte.hours, smpte.minutes, secs);
/* XXX this is copied from show_verbose_duration_cursor() */
frame_rate = session->frame_rate();
hours = frame / (frame_rate * 3600);
frame = frame % (frame_rate * 3600);
mins = frame / (frame_rate * 60);
frame = frame % (frame_rate * 60);
secs = (float) frame / (float) frame_rate;
snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%.4f", hours, mins, secs);
break;
default:
@ -3536,6 +3559,8 @@ Editor::show_verbose_duration_cursor (nframes_t start, nframes_t end, double off
SMPTE::Time smpte;
BBT_Time sbbt;
BBT_Time ebbt;
int hours, mins;
nframes_t distance, frame_rate;
float secs;
Meter meter_at_start(session->tempo_map().meter_at(start));
@ -3576,10 +3601,15 @@ Editor::show_verbose_duration_cursor (nframes_t start, nframes_t end, double off
break;
case AudioClock::MinSec:
/* XXX fix this to compute min/sec properly */
session->smpte_duration (end - start, smpte);
secs = smpte.seconds + ((float) smpte.frames / Config->get_smpte_frames_per_second());
snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%.4f", smpte.hours, smpte.minutes, secs);
/* XXX this stuff should be elsewhere.. */
distance = end - start;
frame_rate = session->frame_rate();
hours = distance / (frame_rate * 3600);
distance = distance % (frame_rate * 3600);
mins = distance / (frame_rate * 60);
distance = distance % (frame_rate * 60);
secs = (float) distance / (float) frame_rate;
snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%.4f", hours, mins, secs);
break;
default:
@ -3638,7 +3668,7 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event)
begin_reversible_command (_("selection grab"));
Playlist* playlist = clicked_axisview->playlist();
boost::shared_ptr<Playlist> playlist = clicked_axisview->playlist();
XMLNode *before = &(playlist->get_state());
clicked_routeview->playlist()->add_region (region, selection->time[clicked_selection].start);
@ -3962,7 +3992,7 @@ Editor::trim_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
double speed = 1.0;
TimeAxisView* tvp = clicked_axisview;
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
pair<set<Playlist*>::iterator,bool> insert_result;
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
if (tv && tv->is_track()) {
speed = tv->get_diskstream()->speed();
@ -4001,13 +4031,14 @@ Editor::trim_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
begin_reversible_command (trim_type);
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) {
(*i)->region()->set_opaque(false);
(*i)->region()->freeze ();
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
if (arv)
arv->temporarily_hide_envelope ();
Playlist * pl = (*i)->region()->playlist();
boost::shared_ptr<Playlist> pl = (*i)->region()->playlist();
insert_result = motion_frozen_playlists.insert (pl);
if (insert_result.second) {
session->add_command(new MementoCommand<Playlist>(*pl, &pl->get_state(), 0));
@ -4195,12 +4226,13 @@ Editor::trim_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
i != selection->regions.by_layer().end(); ++i)
{
thaw_region_after_trim (**i);
(*i)->region()->set_opaque(true);
}
}
for (set<Playlist*>::iterator p = motion_frozen_playlists.begin(); p != motion_frozen_playlists.end(); ++p) {
for (set<boost::shared_ptr<Playlist> >::iterator p = motion_frozen_playlists.begin(); p != motion_frozen_playlists.end(); ++p) {
//(*p)->thaw ();
session->add_command (new MementoCommand<Playlist>(*(*p), 0, &(*p)->get_state()));
session->add_command (new MementoCommand<Playlist>(*(*p).get(), 0, &(*p)->get_state()));
}
motion_frozen_playlists.clear ();
@ -4234,22 +4266,22 @@ Editor::point_trim (GdkEvent* event)
i != selection->regions.by_layer().end(); ++i)
{
if (!(*i)->region()->locked()) {
Playlist *pl = (*i)->region()->playlist();
boost::shared_ptr<Playlist> pl = (*i)->region()->playlist();
XMLNode &before = pl->get_state();
(*i)->region()->trim_front (new_bound, this);
XMLNode &after = pl->get_state();
session->add_command(new MementoCommand<Playlist>(*pl, &before, &after));
session->add_command(new MementoCommand<Playlist>(*pl.get(), &before, &after));
}
}
} else {
if (!rv->region()->locked()) {
Playlist *pl = rv->region()->playlist();
boost::shared_ptr<Playlist> pl = rv->region()->playlist();
XMLNode &before = pl->get_state();
rv->region()->trim_front (new_bound, this);
XMLNode &after = pl->get_state();
session->add_command(new MementoCommand<Playlist>(*pl, &before, &after));
session->add_command(new MementoCommand<Playlist>(*pl.get(), &before, &after));
}
}
@ -4265,22 +4297,22 @@ Editor::point_trim (GdkEvent* event)
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i)
{
if (!(*i)->region()->locked()) {
Playlist *pl = (*i)->region()->playlist();
boost::shared_ptr<Playlist> pl = (*i)->region()->playlist();
XMLNode &before = pl->get_state();
(*i)->region()->trim_end (new_bound, this);
XMLNode &after = pl->get_state();
session->add_command(new MementoCommand<Playlist>(*pl, &before, &after));
session->add_command(new MementoCommand<Playlist>(*pl.get(), &before, &after));
}
}
} else {
if (!rv->region()->locked()) {
Playlist *pl = rv->region()->playlist();
boost::shared_ptr<Playlist> pl = rv->region()->playlist();
XMLNode &before = pl->get_state();
rv->region()->trim_end (new_bound, this);
XMLNode &after = pl->get_state();
session->add_command (new MementoCommand<Playlist>(*pl, &before, &after));
session->add_command (new MementoCommand<Playlist>(*pl.get(), &before, &after));
}
}
@ -4436,6 +4468,7 @@ void
Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
{
Location * newloc = 0;
string rangename;
if (!drag_info.first_move) {
drag_range_markerbar_op (item, event);
@ -4445,7 +4478,8 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
{
begin_reversible_command (_("new range marker"));
XMLNode &before = session->locations()->get_state();
newloc = new Location(temp_location->start(), temp_location->end(), "unnamed", Location::IsRangeMarker);
session->locations()->next_available_name(rangename,"unnamed");
newloc = new Location(temp_location->start(), temp_location->end(), rangename, Location::IsRangeMarker);
session->locations()->add (newloc, true);
XMLNode &after = session->locations()->get_state();
session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
@ -4584,7 +4618,7 @@ Editor::reposition_zoom_rect (nframes_t start, nframes_t end)
{
double x1 = frame_to_pixel (start);
double x2 = frame_to_pixel (end);
double y2 = canvas_height - 2;
double y2 = full_canvas_height - 1.0;
zoom_rect->property_x1() = x1;
zoom_rect->property_y1() = 1.0;
@ -4825,13 +4859,13 @@ Editor::mouse_brush_insert_region (RegionView* rv, nframes_t pos)
return;
}
Playlist* playlist = atv->playlist();
boost::shared_ptr<Playlist> playlist = atv->playlist();
double speed = atv->get_diskstream()->speed();
XMLNode &before = playlist->get_state();
playlist->add_region (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (arv->audio_region())), (nframes_t) (pos * speed));
XMLNode &after = playlist->get_state();
session->add_command(new MementoCommand<Playlist>(*playlist, &before, &after));
session->add_command(new MementoCommand<Playlist>(*playlist.get(), &before, &after));
// playlist is frozen, so we have to update manually

View file

@ -44,6 +44,7 @@
#include <ardour/audio_track.h>
#include <ardour/audioplaylist.h>
#include <ardour/region_factory.h>
#include <ardour/playlist_factory.h>
#include <ardour/reverse.h>
#include "ardour_ui.h"
@ -56,7 +57,6 @@
#include "rgb_macros.h"
#include "selection_templates.h"
#include "selection.h"
#include "sfdb_ui.h"
#include "editing.h"
#include "gtk-custom-hruler.h"
#include "gui_thread.h"
@ -122,7 +122,7 @@ Editor::split_regions_at (nframes_t where, RegionSelection& regions)
tmp = a;
++tmp;
Playlist* pl = (*a)->region()->playlist();
boost::shared_ptr<Playlist> pl = (*a)->region()->playlist();
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*a);
if (arv)
@ -149,7 +149,7 @@ Editor::remove_clicked_region ()
return;
}
Playlist* playlist = clicked_routeview->playlist();
boost::shared_ptr<Playlist> playlist = clicked_routeview->playlist();
begin_reversible_command (_("remove region"));
XMLNode &before = playlist->get_state();
@ -232,7 +232,7 @@ Editor::select_region_for_operation (int dir, TimeAxisView **tv)
RouteTimeAxisView* rtv;
if ((rtv = dynamic_cast<RouteTimeAxisView*> (*tv)) != 0) {
Playlist *pl;
boost::shared_ptr<Playlist> pl;
if ((pl = rtv->playlist()) == 0) {
return region;
@ -1197,6 +1197,8 @@ Editor::temporal_zoom_to_frame (bool coarser, nframes_t frame)
void
Editor::add_location_from_selection ()
{
string rangename;
if (selection->time.empty()) {
return;
}
@ -1208,7 +1210,8 @@ Editor::add_location_from_selection ()
nframes_t start = selection->time[clicked_selection].start;
nframes_t end = selection->time[clicked_selection].end;
Location *location = new Location (start, end, "selection");
session->locations()->next_available_name(rangename,"selection");
Location *location = new Location (start, end, rangename, Location::IsRangeMarker);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
@ -1221,9 +1224,12 @@ Editor::add_location_from_selection ()
void
Editor::add_location_from_playhead_cursor ()
{
string markername;
nframes_t where = session->audible_frame();
Location *location = new Location (where, where, "mark", Location::IsMark);
session->locations()->next_available_name(markername,"mark");
Location *location = new Location (where, where, markername, Location::IsMark);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
@ -1242,7 +1248,7 @@ Editor::add_location_from_audio_region ()
RegionView* rv = *(selection->regions.begin());
boost::shared_ptr<Region> region = rv->region();
Location *location = new Location (region->position(), region->last_frame(), region->name());
Location *location = new Location (region->position(), region->last_frame(), region->name(), Location::IsRangeMarker);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
@ -1649,6 +1655,7 @@ Editor::set_mark ()
nframes_t pos;
float prefix;
bool was_floating;
string markername;
if (get_prefix (prefix, was_floating)) {
pos = session->audible_frame ();
@ -1660,7 +1667,8 @@ Editor::set_mark ()
}
}
session->locations()->add (new Location (pos, 0, "mark", Location::IsMark), true);
session->locations()->next_available_name(markername,"mark");
session->locations()->add (new Location (pos, 0, markername, Location::IsMark), true);
}
void
@ -1709,6 +1717,28 @@ Editor::clear_locations ()
session->locations()->clear ();
}
void
Editor::unhide_markers ()
{
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
Location *l = (*i).first;
if (l->is_hidden() && l->is_mark()) {
l->set_hidden(false, this);
}
}
}
void
Editor::unhide_ranges ()
{
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
Location *l = (*i).first;
if (l->is_hidden() && l->is_range_marker()) {
l->set_hidden(false, this);
}
}
}
/* INSERT/REPLACE */
void
@ -1719,7 +1749,7 @@ Editor::insert_region_list_drag (boost::shared_ptr<Region> region, int x, int y)
TimeAxisView *tv;
nframes_t where;
AudioTimeAxisView *atv = 0;
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
track_canvas.window_to_world (x, y, wx, wy);
wx += horizontal_adjustment.get_value();
@ -1749,20 +1779,26 @@ Editor::insert_region_list_drag (boost::shared_ptr<Region> region, int x, int y)
return;
}
cerr << "drop target playlist, UC = " << playlist.use_count() << endl;
snap_to (where);
begin_reversible_command (_("insert dragged region"));
XMLNode &before = playlist->get_state();
cerr << "pre add target playlist, UC = " << playlist.use_count() << endl;
playlist->add_region (RegionFactory::create (region), where, 1.0);
cerr << "post add target playlist, UC = " << playlist.use_count() << endl;
session->add_command(new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
commit_reversible_command ();
cerr << "post drop target playlist, UC = " << playlist.use_count() << endl;
}
void
Editor::insert_region_list_selection (float times)
{
RouteTimeAxisView *tv = 0;
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
if (clicked_routeview != 0) {
tv = clicked_routeview;
@ -2097,7 +2133,7 @@ Editor::region_from_selection ()
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
boost::shared_ptr<AudioRegion> current;
boost::shared_ptr<Region> current_r;
Playlist *pl;
boost::shared_ptr<Playlist> pl;
nframes_t internal_start;
string new_name;
@ -2134,7 +2170,7 @@ Editor::create_region_from_selection (vector<boost::shared_ptr<AudioRegion> >& n
boost::shared_ptr<AudioRegion> current;
boost::shared_ptr<Region> current_r;
Playlist* playlist;
boost::shared_ptr<Playlist> playlist;
nframes_t internal_start;
string new_name;
@ -2191,7 +2227,7 @@ Editor::separate_region_from_selection ()
return;
}
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
@ -2239,7 +2275,7 @@ Editor::separate_regions_using_location (Location& loc)
return;
}
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
/* XXX i'm unsure as to whether this should operate on selected tracks only
or the entire enchillada. uncomment the below line to correct the behaviour
@ -2288,8 +2324,8 @@ Editor::crop_region_to_selection ()
return;
}
vector<Playlist*> playlists;
Playlist *playlist;
vector<boost::shared_ptr<Playlist> > playlists;
boost::shared_ptr<Playlist> playlist;
if (clicked_axisview != 0) {
@ -2322,7 +2358,7 @@ Editor::crop_region_to_selection ()
begin_reversible_command (_("trim to selection"));
for (vector<Playlist*>::iterator i = playlists.begin(); i != playlists.end(); ++i) {
for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) {
boost::shared_ptr<Region> region;
@ -2371,7 +2407,7 @@ Editor::region_fill_track ()
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region);
assert(ar);
Playlist* pl = region->playlist();
boost::shared_ptr<Playlist> pl = region->playlist();
if (end <= region->last_frame()) {
return;
@ -2415,7 +2451,7 @@ Editor::region_fill_selection ()
nframes_t start = selection->time[clicked_selection].start;
nframes_t end = selection->time[clicked_selection].end;
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
if (selection->tracks.empty()) {
return;
@ -2781,7 +2817,7 @@ Editor::bounce_range_selection ()
continue;
}
Playlist* playlist;
boost::shared_ptr<Playlist> playlist;
if ((playlist = atv->playlist()) == 0) {
return;
@ -2897,7 +2933,7 @@ Editor::cut_copy_points (CutCopyOp op)
}
struct PlaylistState {
Playlist* playlist;
boost::shared_ptr<Playlist> playlist;
XMLNode* before;
};
@ -2910,7 +2946,7 @@ struct lt_playlist {
void
Editor::cut_copy_regions (CutCopyOp op)
{
typedef std::map<AudioPlaylist*,AudioPlaylist*> PlaylistMapping;
typedef std::map<boost::shared_ptr<AudioPlaylist>,boost::shared_ptr<AudioPlaylist> > PlaylistMapping;
PlaylistMapping pmap;
nframes_t first_position = max_frames;
@ -2921,7 +2957,8 @@ Editor::cut_copy_regions (CutCopyOp op)
first_position = min ((*x)->region()->position(), first_position);
if (op == Cut || op == Clear) {
AudioPlaylist *pl = dynamic_cast<AudioPlaylist*>((*x)->region()->playlist());
boost::shared_ptr<AudioPlaylist> pl = boost::dynamic_pointer_cast<AudioPlaylist>((*x)->region()->playlist());
if (pl) {
PlaylistState before;
@ -2939,8 +2976,8 @@ Editor::cut_copy_regions (CutCopyOp op)
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ) {
AudioPlaylist *pl = dynamic_cast<AudioPlaylist*>((*x)->region()->playlist());
AudioPlaylist* npl;
boost::shared_ptr<AudioPlaylist> pl = boost::dynamic_pointer_cast<AudioPlaylist>((*x)->region()->playlist());
boost::shared_ptr<AudioPlaylist> npl;
RegionSelection::iterator tmp;
tmp = x;
@ -2951,7 +2988,8 @@ Editor::cut_copy_regions (CutCopyOp op)
PlaylistMapping::iterator pi = pmap.find (pl);
if (pi == pmap.end()) {
npl = new AudioPlaylist (*session, "cutlist", true);
// FIXME
npl = boost::dynamic_pointer_cast<AudioPlaylist> (PlaylistFactory::create (DataType::AUDIO, *session, "cutlist", true));
npl->freeze();
pmap[pl] = npl;
} else {
@ -2983,7 +3021,7 @@ Editor::cut_copy_regions (CutCopyOp op)
x = tmp;
}
list<Playlist*> foo;
list<boost::shared_ptr<Playlist> > foo;
for (PlaylistMapping::iterator i = pmap.begin(); i != pmap.end(); ++i) {
foo.push_back (i->second);
@ -3080,8 +3118,8 @@ Editor::paste_named_selection (float times)
TreeModel::iterator i = selected->get_selected();
NamedSelection* ns = (*i)[named_selection_columns.selection];
list<Playlist*>::iterator chunk;
list<Playlist*>::iterator tmp;
list<boost::shared_ptr<Playlist> >::iterator chunk;
list<boost::shared_ptr<Playlist> >::iterator tmp;
chunk = ns->playlists.begin();
@ -3090,8 +3128,8 @@ Editor::paste_named_selection (float times)
for (t = selection->tracks.begin(); t != selection->tracks.end(); ++t) {
AudioTimeAxisView* atv;
Playlist* pl;
AudioPlaylist* apl;
boost::shared_ptr<Playlist> pl;
boost::shared_ptr<AudioPlaylist> apl;
if ((atv = dynamic_cast<AudioTimeAxisView*> (*t)) == 0) {
continue;
@ -3100,8 +3138,8 @@ Editor::paste_named_selection (float times)
if ((pl = atv->playlist()) == 0) {
continue;
}
if ((apl = dynamic_cast<AudioPlaylist*> (pl)) == 0) {
if ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) == 0) {
continue;
}
@ -3109,7 +3147,7 @@ Editor::paste_named_selection (float times)
++tmp;
XMLNode &before = apl->get_state();
apl->paste (**chunk, edit_cursor->current_frame, times);
apl->paste (*chunk, edit_cursor->current_frame, times);
session->add_command(new MementoCommand<AudioPlaylist>(*apl, &before, &apl->get_state()));
if (tmp != ns->playlists.end()) {
@ -3123,7 +3161,7 @@ Editor::paste_named_selection (float times)
void
Editor::duplicate_some_regions (RegionSelection& regions, float times)
{
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
RegionSelection sel = regions; // clear (below) will clear the argument list
begin_reversible_command (_("duplicate region"));
@ -3161,7 +3199,7 @@ Editor::duplicate_selection (float times)
return;
}
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
vector<boost::shared_ptr<AudioRegion> > new_regions;
vector<boost::shared_ptr<AudioRegion> >::iterator ri;
@ -3227,20 +3265,20 @@ Editor::center_edit_cursor ()
}
void
Editor::clear_playlist (Playlist& playlist)
Editor::clear_playlist (boost::shared_ptr<Playlist> playlist)
{
begin_reversible_command (_("clear playlist"));
XMLNode &before = playlist.get_state();
playlist.clear ();
XMLNode &after = playlist.get_state();
session->add_command (new MementoCommand<Playlist>(playlist, &before, &after));
XMLNode &before = playlist->get_state();
playlist->clear ();
XMLNode &after = playlist->get_state();
session->add_command (new MementoCommand<Playlist>(*playlist.get(), &before, &after));
commit_reversible_command ();
}
void
Editor::nudge_track (bool use_edit_cursor, bool forwards)
{
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
nframes_t distance;
nframes_t next_distance;
nframes_t start;
@ -3388,7 +3426,7 @@ Editor::apply_filter (AudioFilter& filter, string command)
if (!arv)
continue;
Playlist* playlist = arv->region()->playlist();
boost::shared_ptr<Playlist> playlist = arv->region()->playlist();
RegionSelection::iterator tmp;

View file

@ -26,7 +26,7 @@
#include <pbd/basename.h>
#include <ardour/audioregion.h>
#include <ardour/audiosource.h>
#include <ardour/audiofilesource.h>
#include <ardour/session_region.h>
#include <gtkmm2ext/stop_signal.h>
@ -101,7 +101,8 @@ Editor::add_region_to_region_display (boost::shared_ptr<Region> region)
parent = *(region_list_model->append());
parent[region_list_columns.name] = _("Hidden");
/// XXX FIX ME parent[region_list_columns.region]->reset ();
boost::shared_ptr<Region> proxy = parent[region_list_columns.region];
proxy.reset ();
} else {
@ -109,7 +110,8 @@ Editor::add_region_to_region_display (boost::shared_ptr<Region> region)
parent = *(region_list_model->insert(iter));
parent[region_list_columns.name] = _("Hidden");
/// XXX FIX ME parent[region_list_columns.region]->reset ();
boost::shared_ptr<Region> proxy = parent[region_list_columns.region];
proxy.reset ();
} else {
parent = *iter;
@ -129,8 +131,15 @@ Editor::add_region_to_region_display (boost::shared_ptr<Region> region)
if (region->whole_file()) {
str = ".../";
str += PBD::basename_nosuffix (region->source()->name());
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource>(region->source());
if (afs) {
str += region_name_from_path (afs->path(), region->n_channels() > 1);
} else {
str += region->source()->name();
}
} else {
str = region->name();
}
@ -342,20 +351,15 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
}
}
if (region == 0) {
return false;
}
if (Keyboard::is_delete_event (ev)) {
session->remove_region_from_region_list (region);
return true;
}
if (Keyboard::is_context_menu_event (ev)) {
show_region_list_display_context_menu (ev->button, ev->time);
return true;
}
if (region == 0) {
return false;
}
switch (ev->button) {
case 1:
/* audition on double click */

View file

@ -479,7 +479,7 @@ Editor::show_route_list_menu()
build_route_list_menu ();
}
route_list_menu->popup (1, 0);
route_list_menu->popup (1, gtk_get_current_event_time());
}
bool

View file

@ -338,11 +338,13 @@ Editor::popup_ruler_menu (nframes_t where, ItemType 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 (_("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 ());
break;
case RangeMarkerBarItem:
//ruler_items.push_back (MenuElem (_("New Range")));
ruler_items.push_back (MenuElem (_("Clear all ranges"), mem_fun(*this, &Editor::clear_ranges)));
ruler_items.push_back (MenuElem (_("Unhide ranges"), mem_fun(*this, &Editor::unhide_ranges)));
ruler_items.push_back (SeparatorElem ());
break;
@ -422,7 +424,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
mitem->set_active(true);
}
editor_ruler_menu->popup (1, 0);
editor_ruler_menu->popup (1, gtk_get_current_event_time());
no_ruler_shown_update = false;
}
@ -468,7 +470,7 @@ Editor::store_ruler_visibility ()
session->add_extra_xml (*node);
session->set_dirty ();
}
void
Editor::restore_ruler_visibility ()
{
@ -854,7 +856,7 @@ Editor::metric_get_smpte (GtkCustomRulerMark **marks, gdouble lower, gdouble upp
if (range < (2 * session->frames_per_smpte_frame())) { /* 0 - 2 frames */
show_bits = true;
mark_modulo = 20;
nmarks = 1 + 160;
nmarks = 1 + (2 * Config->get_subframes_per_frame());
} else if (range <= (fr / 4)) { /* 2 frames - 0.250 second */
show_frames = true;
mark_modulo = 1;

View file

@ -79,7 +79,7 @@ Editor::named_selection_display_button_press (GdkEventButton *ev)
case 1:
if (Keyboard::is_delete_event (ev)) {
session->remove_named_selection ((*i)[named_selection_columns.selection]);
return stop_signal (named_selection_display, "button_press_event");
return true;
}
break;
case 2:
@ -150,12 +150,12 @@ Editor::create_named_selection (const string & name)
return;
}
Playlist* what_we_found;
list<Playlist*> thelist;
boost::shared_ptr<Playlist> what_we_found;
list<boost::shared_ptr<Playlist> > thelist;
for (TrackViewList::iterator i = views->begin(); i != views->end(); ++i) {
Playlist *pl = (*i)->playlist();
boost::shared_ptr<Playlist> pl = (*i)->playlist();
if (pl) {

View file

@ -159,7 +159,7 @@ void
Editor::do_timestretch (TimeStretchDialog& dialog)
{
Track* t;
Playlist* playlist;
boost::shared_ptr<Playlist> playlist;
boost::shared_ptr<Region> new_region;
for (RegionSelection::iterator i = dialog.regions.begin(); i != dialog.regions.end(); ) {

View file

@ -63,3 +63,55 @@ static const gchar speaker_cursor_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0xf0, 0x00, 0xf0,
0x00, 0xc0, 0x00, 0xc0 };
#define cursor_audition_width 13
#define cursor_audition_height 16
#define cursor_audition_x_hot 0
#define cursor_audition_y_hot 7
static const short cursor_audition_bits[] = {
0x1000, 0x1800, 0x1400, 0x1200, 0x11f0, 0x1110, 0x111f, 0x1111, 0x1112,
0x111e, 0x1110, 0x11f0, 0x1200, 0x1400, 0x1800, 0x1000 };
#define cursor_audition_mask_width 13
#define cursor_audition_mask_height 16
#define cursor_audition_mask_x_hot 0
#define cursor_audition_mask_y_hot 7
static const short cursor_audition_mask_bits[] = {
0x1000, 0x1800, 0x1c00, 0x1e00, 0x1ff0, 0x1ff0, 0x1fff, 0x1fff, 0x1ffe,
0x1ffe, 0x1ff0, 0x1ff0, 0x1e00, 0x1c00, 0x1800, 0x1000 };
#define cursor_timestretch_width 15
#define cursor_timestretch_height 16
#define cursor_timestretch_x_hot 7
#define cursor_timestretch_y_hot 8
static const short cursor_timestretch_bits[] = {
0x01c0, 0x0140, 0x0140, 0x0140, 0x0540, 0x0d40, 0x1548, 0x274c, 0x417e,
0x274c, 0x1548, 0x0d40, 0x0540, 0x0140, 0x0140, 0x01c0 };
#define cursor_timestretch_mask_width 15
#define cursor_timestretch_mask_height 16
#define cursor_timestretch_mask_x_hot 7
#define cursor_timestretch_mask_y_hot 8
static const short cursor_timestretch_mask_bits[] = {
0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x05d0, 0x0dd8, 0x1ddc, 0x3ffe, 0x7fff,
0x3ffe, 0x1ddc, 0x0dd8, 0x05d0, 0x01c0, 0x01c0, 0x01c0 };
#define cursor_zoom_width 17
#define cursor_zoom_height 16
#define cursor_zoom_x_hot 6
#define cursor_zoom_y_hot 6
static const short cursor_zoom_bits[] = {
0x00e0, 0x0000, 0x03b8, 0x0000, 0x0604, 0x0000, 0x0806, 0x0000, 0x0842,
0x0000, 0x1843, 0x0000, 0x11f1, 0x0000, 0x1843, 0x0000, 0x0842, 0x0000,
0x1806, 0x0000, 0x2604, 0x0000, 0x4758, 0x0000, 0x88e0, 0x0000, 0x1000,
0x0001, 0x2000, 0x0001, 0xc000, 0x0000 };
#define cursor_zoom_mask_width 17
#define cursor_zoom_mask_height 16
#define cursor_zoom_mask_x_hot 6
#define cursor_zoom_mask_y_hot 6
static const short cursor_zoom_mask_bits[] = {
0x00e0, 0x0000, 0x03f8, 0x0000, 0x07fc, 0x0000, 0x0ffe, 0x0000, 0x0ffe,
0x0000, 0x1fff, 0x0000, 0x1fff, 0x0000, 0x1fff, 0x0000, 0x0ffe, 0x0000,
0x1ffe, 0x0000, 0x3ffc, 0x0000, 0x7ff8, 0x0000, 0xf8e0, 0x0000, 0xf000,
0x0001, 0xe000, 0x0001, 0xc000, 0x0000 };

29
gtk2_ardour/enums.cc Normal file
View file

@ -0,0 +1,29 @@
#include <pbd/enumwriter.h>
#include "audio_clock.h"
using namespace std;
using namespace PBD;
using namespace ARDOUR;
void
setup_gtk_ardour_enums ()
{
EnumWriter& enum_writer (EnumWriter::instance());
vector<int> i;
vector<string> s;
AudioClock::Mode clock_mode;
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
#define REGISTER_ENUM(e) i.push_back (e); s.push_back (#e)
#define REGISTER_CLASS_ENUM(t,e) i.push_back (t::e); s.push_back (#e)
REGISTER_CLASS_ENUM (AudioClock, SMPTE);
REGISTER_CLASS_ENUM (AudioClock, BBT);
REGISTER_CLASS_ENUM (AudioClock, MinSec);
REGISTER_CLASS_ENUM (AudioClock, Frames);
REGISTER_CLASS_ENUM (AudioClock, Off);
REGISTER (clock_mode);
}

View file

@ -8,6 +8,11 @@ enum WaveformShape {
Rectified
};
enum WaveformScale {
LinearWaveform=0,
LogWaveform,
};
enum Width {
Wide,
@ -27,4 +32,6 @@ struct SelectionRect {
uint32_t id;
};
extern void setup_gtk_ardour_enums ();
#endif /* __ardour_gtk_enums_h__ */

View file

@ -123,7 +123,7 @@ ExportDialog::ExportDialog(PublicEditor& e)
export_cd_markers_allowed = true;
set_title (_("ardour: export"));
set_wmclass (_("ardour_export"), "Ardour");
set_wmclass (X_("ardour_export"), "Ardour");
set_name ("ExportWindow");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);

View file

@ -123,7 +123,7 @@ FFTGraph::setWindowSize_internal(int windowSize)
}
_logScale = (int *) malloc(sizeof(int) * _dataSize);
float count = 0;
//float count = 0;
for (int i = 0; i < _dataSize; i++) {
_logScale[i] = 0;
}
@ -389,7 +389,7 @@ FFTGraph::on_size_request(Gtk::Requisition* requisition)
pixel++;
freq_at_pixel = FFT_START * exp( FFT_RANGE * pixel / (double)scaleWidth );
}
_logScale[i] = floor(pixel);
_logScale[i] = (int)floor(pixel);
//printf("logscale at %d = %3.3f, freq_at_pixel %3.3f, freq_at_bin %3.3f, scaleWidth %d\n", i, pixel, freq_at_pixel, freq_at_bin, scaleWidth);
}

View file

@ -63,20 +63,7 @@ map<string,Glib::RefPtr<Gdk::Pixmap> > GainMeter::metric_pixmaps;
int
GainMeter::setup_slider_pix ()
{
string path = ARDOUR::find_data_file("vslider02_slider.xpm", "pixmaps");
if (path.empty()) {
error << _("cannot find images for fader slider") << endmsg;
return -1;
}
slider = Gdk::Pixbuf::create_from_file (path);
path = ARDOUR::find_data_file("vslider02_rail.xpm", "pixmaps");
if (path.empty()) {
error << _("cannot find images for fader rail") << endmsg;
return -1;
}
rail = Gdk::Pixbuf::create_from_file (path);
slider = ::get_icon ("fader_belt");
return 0;
}
@ -86,7 +73,6 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
gain_slider (0),
// 0.781787 is the value needed for gain to be set to 0.
gain_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1),
gain_display (&gain_adjustment, "MixerStripGainDisplay"),
gain_automation_style_button (""),
gain_automation_state_button ("")
@ -97,36 +83,38 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
ignore_toggle = false;
meter_menu = 0;
gain_slider = manage (new VSliderController (slider, rail,
next_release_selects = false;
gain_slider = manage (new VSliderController (slider,
&gain_adjustment,
_io->gain_control(),
false));
gain_slider->signal_button_press_event().connect (mem_fun(*this, &GainMeter::start_gain_touch));
gain_slider->signal_button_release_event().connect (mem_fun(*this, &GainMeter::end_gain_touch));
gain_slider->set_name ("MixerGainMeter");
gain_slider->set_name ("GainFader");
gain_display.set_print_func (_gain_printer, this);
gain_display.set_name ("MixerStripGainDisplay");
gain_display.set_has_frame (false);
set_size_request_to_display_given_text (gain_display, "-80.g", 2, 6); /* note the descender */
gain_display.signal_activate().connect (mem_fun (*this, &GainMeter::gain_activated));
gain_display.signal_focus_in_event().connect (mem_fun (*this, &GainMeter::gain_focused), false);
gain_display.signal_focus_out_event().connect (mem_fun (*this, &GainMeter::gain_focused), false);
gain_display_box.set_homogeneous (true);
gain_display_box.set_spacing (2);
set_size_request_to_display_given_text (gain_display_frame, "-86.g", 2, 6); /* note the descender */
gain_display_frame.set_shadow_type (Gtk::SHADOW_IN);
gain_display_frame.set_name ("BaseFrame");
gain_display_frame.add (gain_display);
gain_display_box.pack_start (gain_display_frame, Gtk::PACK_SHRINK);
gain_display_box.pack_start (gain_display, true, true);
peak_display.set_name ("MixerStripPeakDisplay");
peak_display.add (peak_display_label);
set_size_request_to_display_given_text (peak_display_frame, "-86.g", 2, 6); /* note the descender */
peak_display_frame.set_shadow_type (Gtk::SHADOW_IN);
peak_display_frame.set_name ("BaseFrame");
peak_display_frame.add (peak_display);
peak_display.set_has_frame (false);
peak_display.set_editable (false);
set_size_request_to_display_given_text (peak_display, "-80.g", 2, 6); /* note the descender */
max_peak = minus_infinity();
peak_display_label.set_text (_("-inf"));
peak_display.set_text (_("-inf"));
peak_display.unset_flags (Gtk::CAN_FOCUS);
meter_metric_area.set_size_request (25, -1);
meter_metric_area.set_name ("MeterMetricsStrip");
set_size_request_to_display_given_text (meter_metric_area, "-50", 0, 0);
meter_packer.set_spacing (2);
@ -142,12 +130,15 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
gain_automation_state_button.set_size_request(15, 15);
gain_automation_style_button.set_size_request(15, 15);
HBox* fader_centering_box = manage (new HBox);
fader_centering_box->pack_start (*gain_slider, true, false);
fader_vbox = manage (new Gtk::VBox());
fader_vbox->set_spacing (0);
fader_vbox->pack_start (*gain_slider, false, false, 0);
fader_vbox->pack_start (*fader_centering_box, false, false, 0);
hbox.set_spacing (0);
hbox.set_spacing (2);
hbox.pack_start (*fader_vbox, true, true);
if (_io->default_type() == ARDOUR::DataType::AUDIO)
hbox.pack_start (*fader_vbox, false, false, 2);
@ -157,14 +148,15 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
Route* r;
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
/*
if we don't have a route (if we're the click),
if we have a route (ie. we're not the click),
pack some route-dependent stuff.
*/
gain_display_box.pack_end (peak_display_frame, Gtk::PACK_SHRINK);
gain_display_box.pack_end (peak_display, true, true);
hbox.pack_start (meter_packer, true, false);
hbox.pack_end (meter_packer, true, true);
using namespace Menu_Helpers;
@ -193,23 +185,25 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
gain_automation_state_changed ();
}
set_spacing (2);
set_spacing (4);
pack_start (gain_display_box, Gtk::PACK_SHRINK);
pack_start (hbox, Gtk::PACK_SHRINK);
pack_start (gain_display_box, Gtk::PACK_SHRINK);
pack_start (hbox, Gtk::PACK_SHRINK);
_io->gain_changed.connect (mem_fun(*this, &GainMeter::gain_changed));
meter_metric_area.signal_expose_event().connect (mem_fun(*this, &GainMeter::meter_metrics_expose));
gain_adjustment.signal_value_changed().connect (mem_fun(*this, &GainMeter::gain_adjusted));
peak_display.signal_button_release_event().connect (mem_fun(*this, &GainMeter::peak_button_release));
peak_display.signal_button_release_event().connect (mem_fun(*this, &GainMeter::peak_button_release), false);
gain_display.signal_key_press_event().connect (mem_fun(*this, &GainMeter::gain_key_press), false);
Config->ParameterChanged.connect (mem_fun (*this, &GainMeter::parameter_changed));
gain_changed (0);
update_gain_sensitive ();
show_gain ();
update_gain_sensitive ();
ResetAllPeakDisplays.connect (mem_fun(*this, &GainMeter::reset_peak_display));
ResetGroupPeakDisplays.connect (mem_fun(*this, &GainMeter::reset_group_peak_display));
}
@ -219,10 +213,10 @@ GainMeter::set_width (Width w)
{
switch (w) {
case Wide:
peak_display_frame.show_all();
peak_display.show();
break;
case Narrow:
peak_display_frame.hide_all();
peak_display.hide();
break;
}
@ -322,7 +316,7 @@ GainMeter::update_meters ()
{
vector<MeterInfo>::iterator i;
uint32_t n;
float peak;
float peak, mpeak;
char buf[32];
for (n = 0, i = meters.begin(); i != meters.end(); ++i, ++n) {
@ -330,15 +324,17 @@ GainMeter::update_meters ()
peak = _io->peak_meter().peak_power (n);
(*i).meter->set (log_meter (peak), peak);
if (peak > max_peak) {
max_peak = peak;
/* set peak display */
mpeak = _io->peak_meter().max_peak_power(n);
if (mpeak > max_peak) {
max_peak = mpeak;
/* set peak display */
if (max_peak <= -200.0f) {
peak_display_label.set_text (_("-inf"));
peak_display.set_text (_("-inf"));
} else {
snprintf (buf, sizeof(buf), "%.1f", max_peak);
peak_display_label.set_text (buf);
peak_display.set_text (buf);
}
if (max_peak >= 0.0f) {
@ -432,7 +428,14 @@ GainMeter::setup_meters ()
meters.push_back (MeterInfo());
}
for (uint32_t n = 0; n < nmeters; ++n) {
/* pack them backwards */
if (_width == Wide) {
meter_packer.pack_end (meter_metric_area, false, false);
meter_metric_area.show_all ();
}
for (int32_t n = nmeters-1; nmeters && n >= 0 ; --n) {
if (meters[n].width != width) {
delete meters[n].meter;
meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, FastMeter::Vertical);
@ -442,18 +445,24 @@ GainMeter::setup_meters ()
meters[n].meter->signal_button_release_event().connect (bind (mem_fun(*this, &GainMeter::meter_button_release), n));
}
meter_packer.pack_start (*meters[n].meter, Gtk::PACK_SHRINK);
meter_packer.pack_end (*meters[n].meter, false, false);
meters[n].meter->show_all ();
meters[n].packed = true;
}
if (_width == Wide) {
meter_packer.pack_start (meter_metric_area, Gtk::PACK_SHRINK);
meter_metric_area.show_all ();
}
}
gint
bool
GainMeter::gain_key_press (GdkEventKey* ev)
{
if (key_is_legal_for_numeric_entry (ev->keyval)) {
/* drop through to normal handling */
return false;
}
/* illegal key for gain entry */
return true;
}
bool
GainMeter::peak_button_release (GdkEventButton* ev)
{
/* reset peak label */
@ -468,14 +477,20 @@ GainMeter::peak_button_release (GdkEventButton* ev)
} else {
reset_peak_display ();
}
return TRUE;
return true;
}
void
GainMeter::reset_peak_display ()
{
max_peak = minus_infinity();
peak_display_label.set_text (_("-Inf"));
Route * r;
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
r->peak_meter().reset_max();
}
max_peak = -INFINITY;
peak_display.set_text (_("-Inf"));
peak_display.set_name ("MixerStripPeakDisplay");
}
@ -497,7 +512,7 @@ GainMeter::meter_button_release (GdkEventButton* ev, uint32_t which)
case 1:
meters[which].meter->clear();
max_peak = minus_infinity();
peak_display_label.set_text (_("-inf"));
peak_display.set_text (_("-inf"));
peak_display.set_name ("MixerStripPeakDisplay");
break;
@ -530,22 +545,46 @@ GainMeter::popup_meter_menu (GdkEventButton *ev)
meter_menu->popup (1, ev->time);
}
void
GainMeter::_gain_printer (char buf[32], Gtk::Adjustment& adj, void *arg)
bool
GainMeter::gain_focused (GdkEventFocus* ev)
{
static_cast<GainMeter *>(arg)->gain_printer (buf, adj);
if (ev->in) {
gain_display.select_region (0, -1);
} else {
gain_display.select_region (0, 0);
}
return false;
}
void
GainMeter::gain_printer (char buf[32], Gtk::Adjustment& adj)
GainMeter::gain_activated ()
{
float v = adj.get_value();
float f;
if (sscanf (gain_display.get_text().c_str(), "%f", &f) == 1) {
/* clamp to displayable values */
f = min (f, 6.0f);
_io->set_gain (dB_to_coefficient (f), this);
}
}
void
GainMeter::show_gain ()
{
char buf[32];
float v = gain_adjustment.get_value();
if (v == 0.0) {
strcpy (buf, _("-inf"));
} else {
snprintf (buf, 32, "%.1f", coefficient_to_dB (slider_position_to_gain (v)));
}
gain_display.set_text (buf);
}
void
@ -554,6 +593,7 @@ GainMeter::gain_adjusted ()
if (!ignore_toggle) {
_io->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this);
}
show_gain ();
}
void
@ -562,7 +602,7 @@ GainMeter::effective_gain_display ()
gfloat value = gain_to_slider_position (_io->effective_gain());
if (gain_adjustment.get_value() != value) {
ignore_toggle = true;
ignore_toggle = true;
gain_adjustment.set_value (value);
ignore_toggle = false;
}
@ -649,7 +689,13 @@ GainMeter::meter_press(GdkEventButton* ev)
/* ctrl-shift-click applies change to all routes */
_session.begin_reversible_command (_("meter point change"));
Session::GlobalMeteringStateCommand *cmd = new Session::GlobalMeteringStateCommand (_session, this);
_session.foreach_route (this, &GainMeter::set_meter_point, next_meter_point (_route->meter_point()));
cmd->mark();
_session.add_command (cmd);
_session.commit_reversible_command ();
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
@ -658,12 +704,19 @@ GainMeter::meter_press(GdkEventButton* ev)
*/
if (ev->button == 1) {
_session.begin_reversible_command (_("meter point change"));
Session::GlobalMeteringStateCommand *cmd = new Session::GlobalMeteringStateCommand (_session, this);
set_mix_group_meter_point (*_route, next_meter_point (_route->meter_point()));
cmd->mark();
_session.add_command (cmd);
_session.commit_reversible_command ();
}
} else {
/* click: solo this route */
/* click: change just this route */
// XXX no undo yet
_route->set_meter_point (next_meter_point (_route->meter_point()), this);
}

View file

@ -35,6 +35,7 @@
#include <ardour/types.h>
#include <gtkmm2ext/click_box.h>
#include <gtkmm2ext/focus_entry.h>
#include <gtkmm2ext/slider_controller.h>
#include "enums.h"
@ -79,14 +80,12 @@ class GainMeter : public Gtk::VBox
ARDOUR::Session& _session;
bool ignore_toggle;
bool next_release_selects;
Gtkmm2ext::VSliderController *gain_slider;
Gtk::Adjustment gain_adjustment;
Gtk::Frame gain_display_frame;
Gtkmm2ext::ClickBox gain_display;
Gtk::Frame peak_display_frame;
Gtk::EventBox peak_display;
Gtk::Label peak_display_label;
Gtkmm2ext::FocusEntry gain_display;
Gtk::Entry peak_display;
Gtk::HBox gain_display_box;
Gtk::HBox fader_box;
Gtk::DrawingArea meter_metric_area;
@ -122,9 +121,10 @@ class GainMeter : public Gtk::VBox
gint meter_metrics_expose (GdkEventExpose *);
static void _gain_printer (char buf[32], Gtk::Adjustment&, void *);
void gain_printer (char buf[32], Gtk::Adjustment&);
void show_gain ();
void gain_activated ();
bool gain_focused (GdkEventFocus*);
struct MeterInfo {
Gtkmm2ext::FastMeter *meter;
gint16 width;
@ -157,7 +157,8 @@ class GainMeter : public Gtk::VBox
gint meter_button_press (GdkEventButton*, uint32_t);
gint meter_button_release (GdkEventButton*, uint32_t);
gint peak_button_release (GdkEventButton*);
bool peak_button_release (GdkEventButton*);
bool gain_key_press (GdkEventKey*);
Gtk::Menu* meter_menu;
void popup_meter_menu (GdkEventButton*);

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -458,7 +458,7 @@ IOSelector::display_ports ()
really_short_name = port->short_name();
really_short_name = really_short_name.substr (really_short_name.find ('/') + 1);
tview = manage (new TreeView());
RefPtr<ListStore> port_model = ListStore::create (port_display_columns);
@ -478,7 +478,6 @@ IOSelector::display_ports ()
/* now fill the clist with the current connections */
const char **connections = port->get_connections ();
if (connections) {
@ -487,7 +486,7 @@ IOSelector::display_ports ()
row[port_display_columns.displayed_name] = connections[c];
row[port_display_columns.full_name] = connections[c];
}
}
}
if (for_input) {

View file

@ -575,7 +575,7 @@ LadspaPluginUI::astate_clicked (ControlUI* cui, uint32_t port)
items.push_back (MenuElem (_("Touch"),
bind (mem_fun(*this, &LadspaPluginUI::set_automation_state), (AutoState) Touch, cui)));
automation_menu->popup (1, 0);
automation_menu->popup (1, gtk_get_current_event_time());
}
void

View file

@ -48,11 +48,11 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
item_table (1, 7, false),
start_set_button (_("Set")),
start_go_button (_("Go")),
start_clock (X_("LocationEditRowClock"), true),
start_clock (X_("locationstart"), true, X_("LocationEditRowClock"), true),
end_set_button (_("Set")),
end_go_button (_("Go")),
end_clock (X_("LocationEditRowClock"), true),
length_clock (X_("LocationEditRowClock"), true, true),
end_clock (X_("locationend"), true, X_("LocationEditRowClock"), true),
length_clock (X_("locationlength"), true, X_("LocationEditRowClock"), true, true),
cd_check_button (_("CD")),
hide_check_button (_("Hidden")),
remove_button (_("Remove")),
@ -215,7 +215,7 @@ LocationEditRow::set_location (Location *loc)
}
hide_check_button.set_active (location->is_hidden());
if (location->is_auto_loop() || location->is_auto_punch()) {
if (location->is_auto_loop() || location-> is_auto_punch()) {
// use label instead of entry
name_label.set_text (location->name());
@ -574,7 +574,7 @@ LocationUI::LocationUI ()
i_am_the_modifier = 0;
set_title(_("ardour: locations"));
set_wmclass(_("ardour_locations"), "Ardour");
set_wmclass(X_("ardour_locations"), "Ardour");
set_name ("LocationWindow");
@ -770,9 +770,12 @@ LocationUI::map_locations (Locations::LocationList& locations)
void
LocationUI::add_new_location()
{
string markername;
if (session) {
nframes_t where = session->audible_frame();
Location *location = new Location (where, where, "mark", Location::IsMark);
session->locations()->next_available_name(markername,"mark");
Location *location = new Location (where, where, markername, Location::IsMark);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
@ -786,10 +789,12 @@ LocationUI::add_new_location()
void
LocationUI::add_new_range()
{
string rangename;
if (session) {
nframes_t where = session->audible_frame();
Location *location = new Location (where, where, "unnamed",
Location::IsRangeMarker);
session->locations()->next_available_name(rangename,"unnamed");
Location *location = new Location (where, where, rangename, Location::IsRangeMarker);
session->begin_reversible_command (_("add range marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);

View file

@ -1,7 +1,7 @@
#ifndef __ardour_gtk_log_meter_h__
#define __ardour_gtk_log_meter_h__
#if 0
#if 1
inline float
_log_meter (float power, double lower_db, double upper_db, double non_linearity)
{
@ -9,7 +9,7 @@ _log_meter (float power, double lower_db, double upper_db, double non_linearity)
}
inline float
log_meter (float power)
alt_log_meter (float power)
{
return _log_meter (power, -192.0, 0.0, 8.0);
}

View file

@ -48,6 +48,7 @@
#include "version.h"
#include "ardour_ui.h"
#include "opts.h"
#include "enums.h"
#include "i18n.h"
@ -79,8 +80,6 @@ shutdown (int status)
} else {
if (ui) {
msg = _("stopping user interface\n");
write (1, msg, strlen (msg));
ui->kill();
}
@ -301,7 +300,7 @@ maybe_load_session ()
if (!session_name.length()) {
ui->hide_splash ();
if (!Config->get_no_new_session_dialog()) {
ui->new_session (true);
ui->new_session ();
}
return true;
@ -321,12 +320,16 @@ maybe_load_session ()
/* Loading a 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;
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 false;
}
ui->load_session (path, name);
if (ui->load_session (path, name)) {
/* it failed */
return false;
}
} else {
@ -338,7 +341,7 @@ To create it from the command line, start ardour as \"ardour --new %1"), path) <
/* Show the NSD */
ui->hide_splash ();
if (!Config->get_no_new_session_dialog()) {
ui->new_session (true);
ui->new_session ();
}
}
@ -360,14 +363,15 @@ int main (int argc, char *argv[])
ARDOUR::AudioEngine *engine;
vector<Glib::ustring> null_file_list;
Glib::thread_init();
gtk_set_locale ();
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
// catch_signals ();
// catch error message system signals ();
text_receiver.listen_to (error);
text_receiver.listen_to (info);
@ -407,9 +411,6 @@ int main (int argc, char *argv[])
<< endl;
}
// needs a better home.
Glib::thread_init();
try {
ui = new ARDOUR_UI (&argc, &argv, which_ui_rcfile());
} catch (failed_constructor& err) {
@ -417,6 +418,9 @@ int main (int argc, char *argv[])
exit (1);
}
if (!keybindings_path.empty()) {
ui->set_keybindings_path (keybindings_path);
}
if (!no_splash) {
ui->show_splash ();
@ -425,25 +429,27 @@ int main (int argc, char *argv[])
}
}
try {
engine = new ARDOUR::AudioEngine (jack_client_name);
} catch (AudioEngine::NoBackendAvailable& err) {
gui_jack_error ();
error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
return -1;
}
try {
ARDOUR::init (*engine, use_vst, try_hw_optimization);
setup_gtk_ardour_enums ();
Config->set_current_owner (ConfigVariableBase::Interface);
try {
engine = new ARDOUR::AudioEngine (jack_client_name);
} catch (AudioEngine::NoBackendAvailable& err) {
gui_jack_error ();
error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
return -1;
}
ui->set_engine (*engine);
} catch (failed_constructor& err) {
error << _("could not initialize Ardour.") << endmsg;
return -1;
}
ui->start_engine ();
if (maybe_load_session ()) {
ui->run (text_receiver);

View file

@ -76,7 +76,7 @@ MeterBridge::MeterBridge ()
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
set_name ("MeterBridgeWindow");
set_title (_("ardour: meter bridge"));
set_wmclass (_("ardour_meter_bridge"), "Ardour");
set_wmclass (X_("ardour_meter_bridge"), "Ardour");
// set_policy (false, false, false); // no user resizing of any kind
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), static_cast<Gtk::Window*>(this)));

View file

@ -233,15 +233,17 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt
global_vpacker.set_border_width (0);
global_vpacker.set_spacing (0);
Gtk::VBox *whvbox = manage (new Gtk::VBox);
VBox *whvbox = manage (new VBox);
width_button.set_name ("MixerWidthButton");
hide_button.set_name ("MixerHideButton");
top_event_box.set_name ("MixerTopEventBox");
width_button.signal_clicked().connect (mem_fun(*this, &MixerStrip::width_clicked));
hide_button.signal_clicked().connect (mem_fun(*this, &MixerStrip::hide_clicked));
width_hide_box.pack_start (width_button, false, true);
width_hide_box.pack_start (top_event_box, true, true);
width_hide_box.pack_end (hide_button, false, true);
Gtk::Alignment *gain_meter_alignment = Gtk::manage(new Gtk::Alignment());
gain_meter_alignment->set_padding(0, 4, 0, 0);
@ -425,8 +427,8 @@ MixerStrip::set_width (Width w)
if (rec_enable_button) {
rec_enable_button->set_label (_("record"));
}
mute_button->set_label (_("mute"));
solo_button->set_label (_("solo"));
mute_button->set_label (_("Mute"));
solo_button->set_label (_("Solo"));
if (_route->comment() == "") {
comment_button.unset_bg (STATE_NORMAL);
@ -962,6 +964,7 @@ void
MixerStrip::show_route_color ()
{
name_button.modify_bg (STATE_NORMAL, color());
top_event_box.modify_bg (STATE_NORMAL, color());
route_active_changed ();
}

View file

@ -111,6 +111,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
Gtk::Button hide_button;
Gtk::Button width_button;
Gtk::HBox width_hide_box;
Gtk::EventBox top_event_box;
void hide_clicked();
void width_clicked ();

View file

@ -81,7 +81,7 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
track_model = ListStore::create (track_columns);
track_display.set_model (track_model);
track_display.append_column (_("Strips"), track_columns.text);
track_display.append_column (_("Visible"), track_columns.visible);
track_display.append_column (_("Show"), track_columns.visible);
track_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
track_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
track_display.get_column (0)->set_expand(true);
@ -107,7 +107,7 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
group_display.set_model (group_model);
group_display.append_column (_("Group"), group_columns.text);
group_display.append_column (_("Active"), group_columns.active);
group_display.append_column (_("Visible"), group_columns.visible);
group_display.append_column (_("Show"), group_columns.visible);
group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
group_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
group_display.get_column (2)->set_data (X_("colnum"), GUINT_TO_POINTER(2));
@ -199,15 +199,12 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
rhs_pane1.set_data ("collapse-direction", (gpointer) 0);
list_hpane.set_data ("collapse-direction", (gpointer) 1);
rhs_pane1.signal_button_release_event().connect (bind (sigc::ptr_fun (pane_handler), static_cast<Paned*>(&rhs_pane1)));
list_hpane.signal_button_release_event().connect (bind (sigc::ptr_fun (pane_handler), static_cast<Paned*>(&list_hpane)));
global_vpacker.pack_start (list_hpane, true, true);
add (global_vpacker);
set_name ("MixerWindow");
set_title (_("ardour: mixer"));
set_wmclass (_("ardour_mixer"), "Ardour");
set_wmclass (X_("ardour_mixer"), "Ardour");
add_accel_group (ActionManager::ui_manager->get_accel_group());
@ -656,7 +653,7 @@ Mixer_UI::show_track_list_menu ()
build_track_menu ();
}
track_menu->popup (1, 0);
track_menu->popup (1, gtk_get_current_event_time());
}
bool
@ -765,7 +762,7 @@ Mixer_UI::group_display_button_press (GdkEventButton* ev)
if (mix_group_context_menu == 0) {
build_mix_group_context_menu ();
}
mix_group_context_menu->popup (1, 0);
mix_group_context_menu->popup (1, ev->time);
return true;
}

View file

@ -357,17 +357,29 @@ NewSessionDialog::NewSessionDialog()
m_treeview->get_selection()->set_mode (Gtk::SELECTION_SINGLE);
std::string path = ARDOUR::get_user_ardour_path();
if (path.empty()) {
path = ARDOUR::get_system_data_path();
}
const char * const template_dir_name = X_("templates");
if (!path.empty()) {
m_template->set_current_folder (path + X_("templates/"));
string user_template_path = path + template_dir_name;
if (Glib::file_test(user_template_path, Glib::FILE_TEST_IS_DIR))
{
m_template->set_current_folder (user_template_path);
}
}
const std::string sys_templates_dir = ARDOUR::get_system_data_path() + X_("templates");
if (Glib::file_test(sys_templates_dir, Glib::FILE_TEST_IS_DIR))
m_template->add_shortcut_folder(sys_templates_dir);
const std::string sys_templates_dir = ARDOUR::get_system_data_path() + template_dir_name;
if (Glib::file_test(sys_templates_dir, Glib::FILE_TEST_IS_DIR))
{
m_template->add_shortcut_folder(sys_templates_dir);
}
m_template->set_title(_("select template"));
Gtk::FileFilter* session_filter = manage (new (Gtk::FileFilter));
session_filter->add_pattern(X_("*.ardour"));

View file

@ -20,7 +20,6 @@
#include <pbd/whitespace.h>
#include <ardour/audio_library.h>
#include <ardour/session.h>
#include <ardour/audioengine.h>
#include <ardour/configuration.h>
@ -60,7 +59,6 @@ OptionEditor::OptionEditor (ARDOUR_UI& uip, PublicEditor& ed, Mixer_UI& mixui)
/* Paths */
path_table (11, 2),
sfdb_path_view(),
/* Fades */
@ -71,7 +69,7 @@ OptionEditor::OptionEditor (ARDOUR_UI& uip, PublicEditor& ed, Mixer_UI& mixui)
/* Sync */
smpte_offset_clock (X_("SMPTEOffsetClock"), true, true),
smpte_offset_clock (X_("smpteoffset"), false, X_("SMPTEOffsetClock"), true, true),
smpte_offset_negative_button (_("SMPTE offset is negative")),
/* MIDI */
@ -99,7 +97,7 @@ OptionEditor::OptionEditor (ARDOUR_UI& uip, PublicEditor& ed, Mixer_UI& mixui)
set_default_size (300, 300);
set_title (_("ardour: options editor"));
set_wmclass (_("ardour_option_editor"), "Ardour");
set_wmclass (X_("ardour_option_editor"), "Ardour");
set_name ("OptionsWindow");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
@ -224,23 +222,9 @@ OptionEditor::setup_path_options()
path_table.attach (*label, 0, 1, 0, 1, FILL|EXPAND, FILL);
path_table.attach (session_raid_entry, 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
label = manage(new Label(_("Soundfile Search Paths")));
label->set_name("OptionsLabel");
path_table.attach(*label, 0, 1, 2, 3, FILL|EXPAND, FILL);
path_table.attach(sfdb_path_view, 1, 3, 2, 3, Gtk::FILL|Gtk::EXPAND, FILL);
sfdb_path_view.set_paths(Library->get_paths());
sfdb_path_view.PathsUpdated.connect (mem_fun(*this, &OptionEditor::sfdb_paths_changed));
path_table.show_all();
}
void
OptionEditor::sfdb_paths_changed ()
{
Library->set_paths (sfdb_path_view.get_paths());
}
void
OptionEditor::add_session_paths ()
{
@ -549,7 +533,7 @@ void
OptionEditor::port_online_toggled (MIDI::Port* port, ToggleButton* tb)
{
bool wanted = tb->get_active();
if (wanted != port->input()->offline()) {
port->input()->set_offline (wanted);
}
@ -558,12 +542,16 @@ OptionEditor::port_online_toggled (MIDI::Port* port, ToggleButton* tb)
void
OptionEditor::map_port_online (MIDI::Port* port, ToggleButton* tb)
{
if (port->input()->offline()) {
tb->set_label (_("offline"));
tb->set_active (false);
} else {
tb->set_label (_("online"));
tb->set_active (true);
bool bstate = tb->get_active ();
if (bstate != port->input()->offline()) {
if (port->input()->offline()) {
tb->set_label (_("offline"));
tb->set_active (false);
} else {
tb->set_label (_("online"));
tb->set_active (true);
}
}
}
@ -659,19 +647,12 @@ OptionEditor::click_sound_changed ()
return;
}
if (path.empty()) {
strip_whitespace_edges (path);
if (path == _("internal")) {
Config->set_click_sound ("");
} else {
strip_whitespace_edges (path);
if (path == _("internal")) {
Config->set_click_sound ("");
} else {
Config->set_click_sound (path);
}
Config->set_click_sound (path);
}
}
}
@ -686,19 +667,12 @@ OptionEditor::click_emphasis_sound_changed ()
return;
}
if (path.empty()) {
strip_whitespace_edges (path);
if (path == _("internal")) {
Config->set_click_emphasis_sound ("");
} else {
strip_whitespace_edges (path);
if (path == _("internal")) {
Config->set_click_emphasis_sound ("");
} else {
Config->set_click_emphasis_sound (path);
}
Config->set_click_emphasis_sound (path);
}
}
}

View file

@ -33,8 +33,6 @@
#include <gtkmm/radiobutton.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm2ext/pathlist.h>
#include <ardour/session.h>
#include "ardour_dialog.h"
@ -75,13 +73,10 @@ class OptionEditor : public Gtk::Dialog
Gtk::Table path_table;
Gtk::Entry session_raid_entry;
Gtkmm2ext::PathList sfdb_path_view;
void setup_path_options();
void add_session_paths ();
void remove_session_paths ();
void raid_path_changed ();
void sfdb_paths_changed ();
/* fades */

View file

@ -37,6 +37,7 @@ bool GTK_ARDOUR::use_vst = true;
bool GTK_ARDOUR::new_session = false;
char* GTK_ARDOUR::curvetest_file = 0;
bool GTK_ARDOUR::try_hw_optimization = true;
string GTK_ARDOUR::keybindings_path = ""; /* empty means use builtin default */
using namespace GTK_ARDOUR;
@ -50,13 +51,13 @@ print_help (const char *execname)
<< _(" -n, --show-splash Show splash screen\n")
<< _(" -c, --name name Use a specific jack client name, default is ardour\n")
<< _(" -N, --new session-name Create a new session from the command line\n")
<< _(" -o, --use-hw-optimizations Try to use h/w specific optimizations\n")
<< _(" -O, --no-hw-optimizations Disable h/w specific optimizations\n")
#ifdef VST_SUPPORT
<< _(" -V, --novst Do not use VST support\n")
#endif
<< _(" [session-name] Name of session to load\n")
<< _(" -C, --curvetest filename Curve algorithm debugger\n")
<< _(" -g, --gtktheme Allow GTK to load a theme\n")
<< _(" -k, --keybindings filename Name of key bindings to load (default is ~/.ardour2/ardour.bindings)\n")
;
return 1;
@ -66,7 +67,7 @@ int
GTK_ARDOUR::parse_opts (int argc, char *argv[])
{
const char *optstring = "U:hbvVnoc:C:N:g";
const char *optstring = "U:hbvVnOc:C:N:k:";
const char *execname = strrchr (argv[0], '/');
if (execname == 0) {
@ -85,7 +86,6 @@ GTK_ARDOUR::parse_opts (int argc, char *argv[])
{ "new", 1, 0, 'N' },
{ "no-hw-optimizations", 0, 0, 'O' },
{ "curvetest", 1, 0, 'C' },
{ "gtktheme", 0, 0, 'g' },
{ 0, 0, 0, 0 }
};
@ -142,6 +142,10 @@ GTK_ARDOUR::parse_opts (int argc, char *argv[])
curvetest_file = optarg;
break;
case 'k':
keybindings_path = optarg;
break;
default:
return print_help(execname);
}

View file

@ -37,6 +37,7 @@ extern bool new_session;
extern char* curvetest_file;
extern bool try_hw_optimization;
extern bool use_gtk_theme;
extern string keybindings_path;
extern int32_t parse_opts (int argc, char *argv[]);

104
gtk2_ardour/panner.cc Normal file
View file

@ -0,0 +1,104 @@
#include <iostream>
#include "panner.h"
using namespace std;
static const int triangle_size = 5;
static void
null_label_callback (char* buf, unsigned int bufsize)
{
/* no label */
buf[0] = '\0';
}
PannerBar::PannerBar (Gtk::Adjustment& adj, PBD::Controllable& c)
: BarController (adj, c, sigc::ptr_fun (null_label_callback))
{
set_style (BarController::Line);
}
PannerBar::~PannerBar ()
{
}
bool
PannerBar::expose (GdkEventExpose* ev)
{
Glib::RefPtr<Gdk::Window> win (darea.get_window());
Glib::RefPtr<Gdk::GC> gc (get_style()->get_base_gc (get_state()));
BarController::expose (ev);
/* now draw triangles for left, right and center */
GdkPoint points[3];
// left
points[0].x = 0;
points[0].y = 0;
points[1].x = triangle_size;
points[1].y = 0;
points[2].x = 0;
points[2].y = triangle_size;
gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
// center
points[0].x = (darea.get_width()/2 - triangle_size);
points[0].y = 0;
points[1].x = (darea.get_width()/2 + triangle_size) - 1;
points[1].y = 0;
points[2].x = darea.get_width()/2 - 1;
points[2].y = triangle_size - 1;
gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
// right
points[0].x = (darea.get_width() - triangle_size) - 1;
points[0].y = 0;
points[1].x = darea.get_width() - 1;
points[1].y = 0;
points[2].x = darea.get_width() - 1;
points[2].y = triangle_size;
gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
return true;
}
bool
PannerBar::button_press (GdkEventButton* ev)
{
if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS && ev->y < 10) {
if (ev->x < triangle_size) {
adjustment.set_value (adjustment.get_lower());
} else if (ev->x > (darea.get_width() - triangle_size)) {
adjustment.set_value (adjustment.get_upper());
} else if (ev->x > (darea.get_width()/2 - triangle_size) &&
ev->x < (darea.get_width()/2 + triangle_size)) {
adjustment.set_value (adjustment.get_lower() + ((adjustment.get_upper() - adjustment.get_lower()) / 2.0));
}
}
return BarController::button_press (ev);
}
bool
PannerBar::button_release (GdkEventButton* ev)
{
return BarController::button_release (ev);
}

18
gtk2_ardour/panner.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef __gtk_ardour_panner_h__
#define __gtk_ardour_panner_h__
#include <gtkmm2ext/barcontroller.h>
class PannerBar : public Gtkmm2ext::BarController
{
public:
PannerBar (Gtk::Adjustment& adj, PBD::Controllable&);
~PannerBar ();
protected:
bool expose (GdkEventExpose*);
bool button_press (GdkEventButton*);
bool button_release (GdkEventButton*);
};
#endif /* __gtk_ardour_panner_h__ */

View file

@ -593,7 +593,7 @@ Panner2d::show_context_menu ()
}
bypass_menu_item->set_active (panner.bypassed());
context_menu->popup (1, 0);
context_menu->popup (1, gtk_get_current_event_time());
}
void

View file

@ -30,6 +30,7 @@
#include "panner_ui.h"
#include "panner2d.h"
#include "utils.h"
#include "panner.h"
#include "gui_thread.h"
#include <ardour/session.h>
@ -44,6 +45,7 @@ using namespace Gtkmm2ext;
using namespace Gtk;
using namespace sigc;
const int PannerUI::pan_bar_height = 30;
PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
: _io (io),
@ -71,7 +73,7 @@ PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
//set_size_request_to_display_given_text (pan_automation_style_button, X_("0"), 2, 2);
pan_bar_packer.set_size_request (-1, 61);
panning_viewport.set_size_request (61, 61);
panning_viewport.set_size_request (64, 61);
panning_viewport.set_name (X_("BaseFrame"));
@ -131,7 +133,7 @@ PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
panning_up_arrow.set_name (X_("PanScrollerArrow"));
panning_down_arrow.set_name (X_("PanScrollerArrow"));
pan_vbox.set_spacing (4);
pan_vbox.set_spacing (2);
pan_vbox.pack_start (panning_viewport, Gtk::PACK_SHRINK);
pan_vbox.pack_start (panning_link_box, Gtk::PACK_SHRINK);
@ -213,22 +215,22 @@ PannerUI::set_width (Width w)
{
switch (w) {
case Wide:
panning_viewport.set_size_request (61, 61);
panning_viewport.set_size_request (64, 61);
if (panner) {
panner->set_size_request (61, 61);
panner->set_size_request (63, 61);
}
for (vector<BarController*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
(*i)->set_size_request (61, 15);
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
(*i)->set_size_request (63, pan_bar_height);
}
panning_link_button.set_label (_("link"));
break;
case Narrow:
panning_viewport.set_size_request (31, 61);
panning_viewport.set_size_request (34, 61);
if (panner) {
panner->set_size_request (31, 61);
panner->set_size_request (33, 61);
}
for (vector<BarController*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
(*i)->set_size_request (31, 15);
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
(*i)->set_size_request (33, pan_bar_height);
}
panning_link_button.set_label (_("L"));
break;
@ -244,7 +246,7 @@ PannerUI::~PannerUI ()
delete (*i);
}
for (vector<BarController*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
delete (*i);
}
@ -301,25 +303,36 @@ PannerUI::setup_pan ()
while ((asz = pan_adjustments.size()) < npans) {
float x;
BarController* bc;
float x, rx;
PannerBar* bc;
/* initialize adjustment with current value of panner */
/* initialize adjustment with 0.0 (L) or 1.0 (R) for the first and second panners,
which serves as a default, otherwise use current value */
_io->panner()[asz]->get_position (x);
_io->panner()[asz]->get_position (rx);
if (npans == 1) {
x = 0.5;
} else if (asz == 0) {
x = 0.0;
} else if (asz == 1) {
x = 1.0;
} else {
x = rx;
}
pan_adjustments.push_back (new Adjustment (x, 0, 1.0, 0.05, 0.1));
bc = new PannerBar (*pan_adjustments[asz], _io->panner()[asz]->control());
/* now set adjustment with current value of panner, then connect the signals */
pan_adjustments.back()->set_value(rx);
pan_adjustments.back()->signal_value_changed().connect (bind (mem_fun(*this, &PannerUI::pan_adjustment_changed), (uint32_t) asz));
_io->panner()[asz]->Changed.connect (bind (mem_fun(*this, &PannerUI::pan_value_changed), (uint32_t) asz));
bc = new BarController (*pan_adjustments[asz],
_io->panner()[asz]->control(),
bind (mem_fun(*this, &PannerUI::pan_printer), pan_adjustments[asz]));
bc->set_name ("PanSlider");
bc->set_shadow_type (Gtk::SHADOW_NONE);
bc->set_style (BarController::Line);
bc->StartGesture.connect (bind (mem_fun (*_io, &IO::start_pan_touch), (uint32_t) asz));
bc->StopGesture.connect (bind (mem_fun (*_io, &IO::end_pan_touch), (uint32_t) asz));
@ -334,14 +347,14 @@ PannerUI::setup_pan ()
pan_bars.push_back (bc);
switch (_width) {
case Wide:
pan_bars.back()->set_size_request (61, 15);
bc->set_size_request (63, pan_bar_height);
break;
case Narrow:
pan_bars.back()->set_size_request (31, 15);
bc->set_size_request (33, pan_bar_height);
break;
}
pan_bar_packer.pack_start (*pan_bars.back(), false, false);
pan_bar_packer.pack_start (*bc, false, false);
}
/* now that we actually have the pan bars,
@ -361,10 +374,10 @@ PannerUI::setup_pan ()
switch (_width) {
case Wide:
w = 61;
w = 63;
break;
case Narrow:
w = 31;
w = 33;
break;
}
@ -631,7 +644,7 @@ PannerUI::update_pan_sensitive ()
case 1:
break;
case 2:
for (vector<BarController*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
(*i)->set_sensitive (sensitive);
}
break;

View file

@ -37,6 +37,7 @@
#include "enums.h"
class Panner2d;
class PannerBar;
namespace ARDOUR {
class IO;
@ -44,7 +45,6 @@ namespace ARDOUR {
}
namespace Gtkmm2ext {
class FastMeter;
class BarController;
}
namespace Gtk {
@ -78,6 +78,8 @@ class PannerUI : public Gtk::HBox
bool ignore_toggle;
bool in_pan_update;
static const int pan_bar_height;
Panner2d* panner;
Gtk::VBox pan_bar_packer;
@ -107,7 +109,7 @@ class PannerUI : public Gtk::HBox
void panning_link_direction_clicked ();
vector<Gtk::Adjustment*> pan_adjustments;
vector<Gtkmm2ext::BarController*> pan_bars;
vector<PannerBar*> pan_bars;
void pan_adjustment_changed (uint32_t which);
void pan_value_changed (uint32_t which);

View file

@ -5,6 +5,6 @@ import glob
pixmap_files = glob.glob('*.xpm')
Import('env install_prefix')
env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour/pixmaps'), pixmap_files))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour', 'pixmaps'), pixmap_files))
env.Alias('tarball', env.Distribute(env['DISTTREE'], [ 'SConscript' ] + pixmap_files))

View file

@ -2,11 +2,12 @@
#define __ardour_gtk_playlist_selection_h__
#include <list>
#include <boost/shared_ptr.hpp>
namespace ARDOUR {
class Playlist;
}
struct PlaylistSelection : list<ARDOUR::Playlist*> {};
struct PlaylistSelection : list<boost::shared_ptr<ARDOUR::Playlist> > {};
#endif /* __ardour_gtk_playlist_selection_h__ */

View file

@ -61,9 +61,8 @@ PlaylistSelector::PlaylistSelector ()
scroller.add (tree);
scroller.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC);
// GTK2FIX do we need this stuff or is GTK applying some policy now?
//set_border_width (6);
// set_spacing (12);
get_vbox()->set_border_width (6);
get_vbox()->set_spacing (12);
get_vbox()->pack_start (scroller);
@ -86,6 +85,17 @@ PlaylistSelector::clear_map ()
dspl_map.clear ();
}
bool
PlaylistSelector::on_unmap_event (GdkEventAny* ev)
{
cerr << "PLselector unmapped\n";
clear_map ();
if (model) {
model->clear ();
}
return Dialog::on_unmap_event (ev);
}
void
PlaylistSelector::show_for (RouteUI* ruix)
{
@ -112,7 +122,8 @@ PlaylistSelector::show_for (RouteUI* ruix)
TreeModel::Row others = *(model->append ());
others[columns.text] = _("Other tracks");
others[columns.playlist] = 0;
boost::shared_ptr<Playlist> proxy = others[columns.playlist];
proxy.reset ();
for (DSPL_Map::iterator x = dspl_map.begin(); x != dspl_map.end(); ++x) {
@ -139,18 +150,20 @@ PlaylistSelector::show_for (RouteUI* ruix)
if (ds == this_ds) {
row = *(model->prepend());
row[columns.text] = nodename;
row[columns.playlist] = 0;
boost::shared_ptr<Playlist> proxy = row[columns.playlist];
proxy.reset ();
} else {
row = *(model->append (others.children()));
row[columns.text] = nodename;
row[columns.playlist] = 0;
boost::shared_ptr<Playlist> proxy = row[columns.playlist];
proxy.reset ();
}
/* Now insert all the playlists for this diskstream/track in a subtree */
list<Playlist*> *pls = x->second;
list<boost::shared_ptr<Playlist> > *pls = x->second;
for (list<Playlist*>::iterator p = pls->begin(); p != pls->end(); ++p) {
for (list<boost::shared_ptr<Playlist> >::iterator p = pls->begin(); p != pls->end(); ++p) {
TreeModel::Row child_row;
@ -173,15 +186,15 @@ PlaylistSelector::show_for (RouteUI* ruix)
}
void
PlaylistSelector::add_playlist_to_map (Playlist *pl)
PlaylistSelector::add_playlist_to_map (boost::shared_ptr<Playlist> pl)
{
AudioPlaylist* apl;
boost::shared_ptr<AudioPlaylist> apl;
if (pl->frozen()) {
return;
}
if ((apl = dynamic_cast<AudioPlaylist*> (pl)) == 0) {
if ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) == 0) {
return;
}
@ -189,7 +202,7 @@ PlaylistSelector::add_playlist_to_map (Playlist *pl)
if ((x = dspl_map.find (apl->get_orig_diskstream_id())) == dspl_map.end()) {
pair<PBD::ID,list<Playlist*>*> newp (apl->get_orig_diskstream_id(), new list<Playlist*>);
pair<PBD::ID,list<boost::shared_ptr<Playlist> >*> newp (apl->get_orig_diskstream_id(), new list<boost::shared_ptr<Playlist> >);
x = dspl_map.insert (dspl_map.end(), newp);
}
@ -219,7 +232,7 @@ PlaylistSelector::close_button_click ()
void
PlaylistSelector::selection_changed ()
{
Playlist *playlist;
boost::shared_ptr<Playlist> playlist;
TreeModel::iterator iter = tree.get_selection()->get_selected();
@ -231,14 +244,14 @@ PlaylistSelector::selection_changed ()
if ((playlist = ((*iter)[columns.playlist])) != 0) {
AudioTrack* at;
AudioPlaylist* apl;
boost::shared_ptr<AudioPlaylist> apl;
if ((at = rui->audio_track()) == 0) {
/* eh? */
return;
}
if ((apl = dynamic_cast<AudioPlaylist*> (playlist)) == 0) {
if ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (playlist)) == 0) {
/* eh? */
return;
}

View file

@ -20,6 +20,8 @@
#ifndef __ardour_playlist_selector_h__
#define __ardour_playlist_selector_h__
#include <boost/shared_ptr.hpp>
#include <gtkmm/box.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/button.h>
@ -45,8 +47,11 @@ class PlaylistSelector : public ArdourDialog
void set_session (ARDOUR::Session*);
void show_for (RouteUI*);
protected:
bool on_unmap_event (GdkEventAny*);
private:
typedef std::map<PBD::ID,std::list<ARDOUR::Playlist*>*> DSPL_Map;
typedef std::map<PBD::ID,std::list<boost::shared_ptr<ARDOUR::Playlist> >*> DSPL_Map;
ARDOUR::Session* session;
Gtk::ScrolledWindow scroller;
@ -55,7 +60,7 @@ class PlaylistSelector : public ArdourDialog
sigc::connection select_connection;
void add_playlist_to_map (ARDOUR::Playlist*);
void add_playlist_to_map (boost::shared_ptr<ARDOUR::Playlist>);
void clear_map ();
void close_button_click ();
void selection_changed ();
@ -66,7 +71,7 @@ class PlaylistSelector : public ArdourDialog
add (playlist);
}
Gtk::TreeModelColumn<std::string> text;
Gtk::TreeModelColumn<ARDOUR::Playlist*> playlist;
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Playlist> > playlist;
};
ModelColumns columns;

View file

@ -102,6 +102,7 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, bool scr
set_position (Gtk::WIN_POS_MOUSE);
set_name ("PluginEditor");
set_wmclass (X_("ardour_plugin_editor"), "Ardour");
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)));

File diff suppressed because it is too large Load diff

View file

@ -553,7 +553,7 @@ msgstr "fil"
#: ../ardour_ui.cc:2030
msgid "Are you sure you want to cleanup?"
msgstr "Är du säker på att du vill göra en rensning?"
msgstr "Är du säker på att du vill rensa upp?"
#: ../ardour_ui.cc:2035
msgid ""
@ -562,17 +562,17 @@ msgid ""
"After cleanup, unused audio files will be moved to a \"dead sounds\" "
"location."
msgstr ""
"Rensning är en destruktiv funktion.\n"
"ALL ångra-/gör om-information kommer att förloras om du rensar.\n"
"Att rensa är en destruktiv funktion.\n"
"ALL ångra-/gör om-information kommer att gå förlorad om du rensar.\n"
"Oanvända filer kommer att flyttas till en \"döda ljud\"-plats."
#: ../ardour_ui.cc:2041
msgid "Clean Up"
msgstr "Rensning"
msgstr "Rensa upp"
#: ../ardour_ui.cc:2044
msgid "CleanupDialog"
msgstr "Rensningsdialog"
msgstr "Rensadialog"
#: ../ardour_ui.cc:2045
msgid "ardour_cleanup"
@ -596,7 +596,7 @@ msgstr ""
"och har flyttats till:\n"
"%3. \n"
"\n"
"Tömma papperskorgen kommer att \n"
"Att tömma papperskorgen kommer att \n"
"frigöra ytterligarel\n"
"%4 %5byte diskutrymme.\n"
@ -616,7 +616,7 @@ msgstr ""
#: ../ardour_ui.cc:2214
msgid "Recording was stopped because your system could not keep up."
msgstr "Inspelningen avstannades eftersom ditt system inte kunde hänga med."
msgstr "Inspelningen stoppades eftersom ditt system inte kunde hänga med."
#: ../ardour_ui.cc:2237
msgid ""
@ -932,7 +932,7 @@ msgstr "Återanslut"
#: ../ardour_ui_ed.cc:146 ../mixer_strip.cc:497 ../mixer_strip.cc:565
msgid "Disconnect"
msgstr "Koppla ifrån"
msgstr "Koppla från"
#: ../ardour_ui_ed.cc:173
msgid "Windows"
@ -1082,11 +1082,11 @@ msgstr "Gå till slutet"
#: gtk2_ardour/ardour_ui.cc:119 gtk2_ardour/ardour_ui_ed.cc:267
msgid "Punch In"
msgstr "Punch-in"
msgstr "Inslag"
#: gtk2_ardour/ardour_ui.cc:120 gtk2_ardour/ardour_ui_ed.cc:270
msgid "Punch Out"
msgstr "Punch-ut"
msgstr "Utslag"
#: gtk2_ardour/ardour_ui.cc:121 gtk2_ardour/ardour_ui_ed.cc:282
msgid "Auto Return"
@ -1371,6 +1371,11 @@ msgstr "Nya fulla övertoningar är påslagna"
msgid "ST"
msgstr "HT"
#: gtk2_ardour/audio_clock.cc:1796 gtk2_ardour/editor.cc:180
msgid "Timecode"
msgstr "Tidskod"
#: ../ardour_ui_options.cc:407 ../ardour_ui_options.cc:417
#: ../ardour_ui_options.cc:484
msgid "Internal"
@ -1560,10 +1565,18 @@ msgstr "Efter inspelningstiden"
msgid "Alignment"
msgstr "Justera"
#: gtk2_ardour/route_time_axis.cc:458
msgid "Normal mode"
msgstr "Normalt läge"
#: gtk2_ardour/route_time_axis.cc:461
msgid "Tape mode"
msgstr "Band-läge"
#: ../audio_time_axis.cc:787 ../editor.cc:526 ../editor_actions.cc:59
#: ../mixer_strip.cc:1000 ../mixer_ui.cc:110
msgid "Active"
msgstr "Aktiva"
msgstr "Aktiv"
#: ../audio_time_axis.cc:792 ../editor.cc:1921 ../editor_actions.cc:319
#: ../editor_markers.cc:507 ../imageframe_time_axis.cc:258
@ -1633,7 +1646,7 @@ msgstr "ta bort kontrollpunkt"
#: ../automation_time_axis.cc:32 ../editor_ops.cc:2886
msgid "clear"
msgstr "rensa"
msgstr "Rensa"
#: ../automation_time_axis.cc:74
msgid "track height"
@ -1661,7 +1674,7 @@ msgstr "Manuell"
#: ../gain_meter.cc:173 ../panner_ui.cc:90 ../plugin_ui.cc:394
#: ../plugin_ui.cc:636 ../sfdb_ui.cc:55
msgid "Play"
msgstr "Spela"
msgstr "Uppspelning"
#: ../automation_time_axis.cc:187 ../automation_time_axis.cc:234
#: ../automation_time_axis.cc:468 ../gain_meter.cc:175 ../panner_ui.cc:92
@ -2109,8 +2122,8 @@ msgstr "Zoom-räckvidd"
#: ../editor.cc:501 ../editor.cc:527 ../editor_actions.cc:61 ../mixer_ui.cc:85
#: ../mixer_ui.cc:111
msgid "Visible"
msgstr "Synliga"
msgid "Show"
msgstr "Visa"
#: ../editor.cc:502 ../editor.cc:525
msgid "Name"
@ -2263,6 +2276,10 @@ msgstr "Analysera regioner"
msgid "Lock"
msgstr "Lås"
#: gtk2_ardour/editor.cc:1755
msgid "Opaque"
msgstr "Ogenomskinlig"
#: ../editor.cc:1852
msgid "Unlock"
msgstr "Lås upp"
@ -2271,6 +2288,18 @@ msgstr "Lås upp"
msgid "Original position"
msgstr "Ursprunglig position"
#: gtk2_ardour/editor.cc:1773
msgid "Reset Envelope"
msgstr "Nollställ konvolut"
#: gtk2_ardour/editor.cc:1775
msgid "Envelope Visible"
msgstr "Konvolut synligt"
#: gtk2_ardour/editor.cc:1782
msgid "Envelope Active"
msgstr "Konvolut aktivt"
#: ../editor.cc:1868
msgid "Toggle envelope visibility"
msgstr "Ändra konvolutsvisning"
@ -2296,6 +2325,10 @@ msgstr "Motsatt riktning"
msgid "Add Range Markers"
msgstr "Lägg till omfångsmarkörer"
#: gtk2_ardour/editor.cc:1804
msgid "Set Range Selection"
msgstr "Definiera omfångsmarkering"
#: ../editor.cc:1885
msgid "Set Range"
msgstr "Definiera omfång"
@ -2683,6 +2716,26 @@ msgstr "Automatisk anslutning"
msgid "Layering"
msgstr "Lager"
#: gtk2_ardour/editor_actions.cc:43
msgid "Timecode fps"
msgstr "Tidskod-FPS"
#: gtk2_ardour/editor_actions.cc:44
msgid "Pullup / Pulldown"
msgstr "Uppåtdrag / Nedåtdrag"
#: gtk2_ardour/editor_actions.cc:45
msgid "Subframes"
msgstr "Underrutor"
#: gtk2_ardour/editor_actions.cc:388
msgid "29.97 drop"
msgstr "29.97 fall"
#: gtk2_ardour/editor_actions.cc:390
msgid "30 drop"
msgstr "30 fall"
#: ../editor_actions.cc:41
msgid "Metering"
msgstr "Nivåmätning"
@ -2782,7 +2835,7 @@ msgstr "Redigeringsmarkören till regionslutet"
#: ../editor_actions.cc:104 ../editor_ops.cc:1364
msgid "select all"
msgstr "välj allt"
msgstr "Välj allt"
#: ../editor_actions.cc:106
msgid "Select All After Edit Cursor"
@ -2991,7 +3044,7 @@ msgstr "Normalisera region"
#: ../editor_actions.cc:232
msgid "crop"
msgstr "beskär"
msgstr "Beskär"
#: ../editor_actions.cc:234
msgid "Insert Chunk"
@ -3263,6 +3316,14 @@ msgstr "Senast flyttade/tillagda är högre"
msgid "Most Recently Added is Higher"
msgstr "Senast tillagda är högre"
#: gtk2_ardour/editor_actions.cc:408
msgid "80 per frame"
msgstr "80 per ruta"
#: gtk2_ardour/editor_actions.cc:409
msgid "100 per frame"
msgstr "100 per ruta"
#: ../editor_audio_import.cc:72
msgid "You can't import or embed an audiofile until you have a session loaded."
msgstr "Du kan inte importera en ljudfil innan du har laddat en session."
@ -4242,19 +4303,19 @@ msgstr ""
#: ../gain_meter.cc:776 ../mixer_strip.cc:770 ../panner_ui.cc:770
msgid "O"
msgstr ""
msgstr "A"
#: ../gain_meter.cc:779 ../panner_ui.cc:773
msgid "P"
msgstr ""
msgstr "U"
#: ../gain_meter.cc:782 ../panner_ui.cc:776
msgid "T"
msgstr ""
msgstr "B"
#: ../gain_meter.cc:785 ../panner_ui.cc:779
msgid "W"
msgstr ""
msgstr "S"
#: ../gtk-custom-ruler.c:126
msgid "Lower"
@ -4664,7 +4725,7 @@ msgstr "Nytt namn för taktart"
#: ../mixer_strip.cc:94 ../mixer_strip.cc:140 ../mixer_strip.cc:1227
msgid "pre"
msgstr "för"
msgstr "pre"
#: ../mixer_strip.cc:95 ../mixer_strip.cc:822
msgid "Comments"
@ -4676,18 +4737,18 @@ msgstr "Ingång"
#: ../mixer_strip.cc:136 ../mixer_strip.cc:1223
msgid "input"
msgstr "ingång"
msgstr "in"
#: ../mixer_strip.cc:144 ../mixer_strip.cc:1231
msgid "post"
msgstr "efter"
msgstr "post"
#. TRANSLATORS: this string should be longest of the strings
#. used to describe meter points. In english, its "input".
#.
#: ../mixer_strip.cc:152
msgid "tupni"
msgstr "gnågni"
msgstr "ni"
#: ../mixer_strip.cc:207
msgid "Varispeed"
@ -4703,7 +4764,7 @@ msgstr "okänd strip-bredd \"%1\" i XML-GUI-informationen"
#: ../mixer_strip.cc:417
msgid "record"
msgstr "spela in"
msgstr "Spela in"
#: ../mixer_strip.cc:418 ../region_editor.cc:46
msgid "mute"
@ -5431,7 +5492,7 @@ msgstr "Aktivera alla"
#: ../redirect_box.cc:1075
msgid "Deactivate all"
msgstr "Aktivera alla"
msgstr "Avaktivera alla"
#: ../region_editor.cc:44
msgid "NAME:"
@ -5450,8 +5511,8 @@ msgid "active"
msgstr "aktivt"
#: ../region_editor.cc:49
msgid "visible"
msgstr "synligt"
msgid "show"
msgstr "visa"
#: ../region_editor.cc:52
msgid "Layer"

View file

@ -94,6 +94,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual gulong frame_to_pixel (nframes_t frame) = 0;
virtual Selection& get_selection() const = 0;
virtual Selection& get_cut_buffer() const = 0;
virtual bool extend_selection_to_track (TimeAxisView&) = 0;
virtual void play_selection () = 0;
virtual void set_show_measures (bool yn) = 0;
virtual bool show_measures () const = 0;
@ -107,7 +108,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual gdouble get_current_zoom () = 0;
virtual PlaylistSelector& playlist_selector() const = 0;
virtual void route_name_changed (TimeAxisView *) = 0;
virtual void clear_playlist (ARDOUR::Playlist&) = 0;
virtual void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>) = 0;
virtual void new_playlists () = 0;
virtual void copy_playlists () = 0;
virtual void clear_playlists () = 0;
@ -118,6 +119,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual void set_follow_playhead (bool yn) = 0;
virtual void toggle_follow_playhead () = 0;
virtual bool follow_playhead() const = 0;
virtual bool dragging_playhead() const = 0;
virtual void ensure_float (Gtk::Window&) = 0;
virtual void show_window () = 0;
virtual TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0) = 0;
@ -138,6 +140,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
sigc::signal<void> ZoomChanged;
sigc::signal<void> Resized;
sigc::signal<void> Realized;
sigc::signal<void,nframes_t> UpdateAllTransportClocks;
Glib::RefPtr<Gtk::ActionGroup> editor_actions;

View file

@ -19,6 +19,7 @@
*/
#include <cmath>
#include <iostream>
#include <sigc++/bind.h>
@ -136,11 +137,12 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, boost::shared_ptr<Rout
pack_start (redirect_eventbox, true, true);
_route->redirects_changed.connect (mem_fun(*this, &RedirectBox::redisplay_redirects));
_route->GoingAway.connect (mem_fun (*this, &RedirectBox::route_going_away));
redirect_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this));
redirect_display.signal_button_press_event().connect (mem_fun(*this, &RedirectBox::redirect_button_press_event), false);
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button_press_event));
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button_release_event));
/* start off as a passthru strip. we'll correct this, if necessary,
in update_diskstream_display().
@ -155,6 +157,13 @@ RedirectBox::~RedirectBox ()
{
}
void
RedirectBox::route_going_away ()
{
/* don't keep updating display as redirects are deleted */
no_redirect_redisplay = true;
}
void
RedirectBox::object_drop (string type, uint32_t cnt, const boost::shared_ptr<Redirect>* ptr)
{
@ -282,13 +291,8 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
}
}
if (redirect && Keyboard::is_delete_event (ev)) {
Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), redirect));
ret = true;
} else if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) {
if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) {
if (_session.engine().connected()) {
/* XXX giving an error message here is hard, because we may be in the midst of a button press */
@ -296,18 +300,7 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
}
ret = true;
} else if (Keyboard::is_context_menu_event (ev)) {
show_redirect_menu(ev->time);
ret = true;
} else if (redirect && ev->button == 2 && ev->state == 0) {
redirect->set_active (!redirect->active(), this);
ret = true;
}
else if (redirect && ev->button == 1 && selected) {
} else if (redirect && ev->button == 1 && selected) {
// this is purely informational but necessary
RedirectSelected (redirect); // emit
@ -316,6 +309,44 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
return ret;
}
bool
RedirectBox::redirect_button_release_event (GdkEventButton *ev)
{
TreeIter iter;
TreeModel::Path path;
TreeViewColumn* column;
int cellx;
int celly;
boost::shared_ptr<Redirect> redirect;
int ret = false;
if (redirect_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
if ((iter = model->get_iter (path))) {
redirect = (*iter)[columns.redirect];
}
}
if (redirect && Keyboard::is_delete_event (ev)) {
Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), boost::weak_ptr<Redirect>(redirect)));
ret = true;
} else if (Keyboard::is_context_menu_event (ev)) {
show_redirect_menu(ev->time);
ret = true;
} else if (redirect && ev->button == 2 && ev->state == GDK_BUTTON2_MASK) {
redirect->set_active (!redirect->active(), this);
ret = true;
}
return ret;
}
Menu *
RedirectBox::build_redirect_menu ()
{
@ -362,7 +393,7 @@ RedirectBox::insert_plugin_chosen (boost::shared_ptr<Plugin> plugin)
boost::shared_ptr<Redirect> redirect (new PluginInsert (_session, plugin, _placement));
redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active));
redirect->active_changed.connect (bind (mem_fun (*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect)));
uint32_t err_streams;
@ -440,7 +471,7 @@ void
RedirectBox::choose_insert ()
{
boost::shared_ptr<Redirect> redirect (new PortInsert (_session, _placement));
redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active));
redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect)));
_route->add_redirect (redirect, this);
}
@ -457,15 +488,24 @@ RedirectBox::choose_send ()
IOSelectorWindow *ios = new IOSelectorWindow (_session, send, false, true);
ios->show_all ();
ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), boost::static_pointer_cast<Redirect>(send), ios));
boost::shared_ptr<Redirect> r = boost::static_pointer_cast<Redirect>(send);
ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), boost::weak_ptr<Redirect>(r), ios));
}
void
RedirectBox::send_io_finished (IOSelector::Result r, boost::shared_ptr<Redirect> redirect, IOSelectorWindow* ios)
RedirectBox::send_io_finished (IOSelector::Result r, boost::weak_ptr<Redirect> weak_redirect, IOSelectorWindow* ios)
{
boost::shared_ptr<Redirect> redirect (weak_redirect.lock());
if (!redirect) {
return;
}
switch (r) {
case IOSelector::Cancelled:
// delete redirect; XXX SHAREDPTR HOW TO DESTROY THE REDIRECT ? do we even need to think about it?
// redirect will go away when all shared_ptrs to it vanish
break;
case IOSelector::Accepted:
@ -484,7 +524,7 @@ RedirectBox::redisplay_redirects (void *src)
if (no_redirect_redisplay) {
return;
}
ignore_delete = true;
model->clear ();
ignore_delete = false;
@ -515,16 +555,22 @@ RedirectBox::add_redirect_to_display (boost::shared_ptr<Redirect> redirect)
Gtk::TreeModel::Row row = *(model->append());
row[columns.text] = redirect_name (redirect);
row[columns.redirect] = redirect;
show_redirect_active (redirect.get(), this);
redirect_active_connections.push_back (redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active)));
redirect_name_connections.push_back (redirect->name_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_name), redirect)));
show_redirect_active (redirect);
redirect_active_connections.push_back (redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect))));
redirect_name_connections.push_back (redirect->name_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_name), boost::weak_ptr<Redirect>(redirect))));
}
string
RedirectBox::redirect_name (boost::shared_ptr<Redirect> redirect)
RedirectBox::redirect_name (boost::weak_ptr<Redirect> weak_redirect)
{
boost::shared_ptr<Redirect> redirect (weak_redirect.lock());
if (!redirect) {
return string();
}
boost::shared_ptr<Send> send;
string name_display;
@ -586,16 +632,28 @@ RedirectBox::build_redirect_tooltip (EventBox& box, string start)
}
void
RedirectBox::show_redirect_name (void* src, boost::shared_ptr<Redirect> redirect)
RedirectBox::show_redirect_name (void* src, boost::weak_ptr<Redirect> redirect)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_name), src, redirect));
show_redirect_active (redirect.get(), src);
show_redirect_active (redirect);
}
void
RedirectBox::show_redirect_active (Redirect* redirect, void *src)
RedirectBox::show_redirect_active_r (Redirect* r, void *src, boost::weak_ptr<Redirect> weak_redirect)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), redirect, src));
show_redirect_active (weak_redirect);
}
void
RedirectBox::show_redirect_active (boost::weak_ptr<Redirect> weak_redirect)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), weak_redirect));
boost::shared_ptr<Redirect> redirect (weak_redirect.lock());
if (!redirect) {
return;
}
Gtk::TreeModel::Children children = model->children();
Gtk::TreeModel::Children::iterator iter = children.begin();
@ -604,7 +662,7 @@ RedirectBox::show_redirect_active (Redirect* redirect, void *src)
boost::shared_ptr<Redirect> r = (*iter)[columns.redirect];
if (r.get() == redirect) {
if (r == redirect) {
(*iter)[columns.text] = redirect_name (r);
if (redirect->active()) {
@ -699,6 +757,7 @@ RedirectBox::cut_redirects ()
_rr_selection.set (to_be_removed);
no_redirect_redisplay = true;
for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_removed.begin(); i != to_be_removed.end(); ++i) {
void* gui = (*i)->get_gui ();
@ -713,6 +772,8 @@ RedirectBox::cut_redirects ()
}
}
no_redirect_redisplay = false;
redisplay_redirects (this);
}
void
@ -735,12 +796,22 @@ RedirectBox::copy_redirects ()
}
gint
RedirectBox::idle_delete_redirect (boost::shared_ptr<Redirect> redirect)
RedirectBox::idle_delete_redirect (boost::weak_ptr<Redirect> weak_redirect)
{
boost::shared_ptr<Redirect> redirect (weak_redirect.lock());
if (!redirect) {
return false;
}
/* NOT copied to _mixer.selection() */
no_redirect_redisplay = true;
_route->remove_redirect (redirect, this);
return FALSE;
no_redirect_redisplay = false;
redisplay_redirects (this);
return false;
}
void
@ -765,7 +836,6 @@ RedirectBox::rename_redirect (boost::shared_ptr<Redirect> redirect)
}
return;
}
void
@ -784,9 +854,12 @@ RedirectBox::cut_redirect (boost::shared_ptr<Redirect> redirect)
static_cast<Gtk::Widget*>(gui)->hide ();
}
no_redirect_redisplay = true;
if (_route->remove_redirect (redirect, this)) {
_rr_selection.remove (redirect);
}
no_redirect_redisplay = false;
redisplay_redirects (this);
}
void
@ -847,8 +920,9 @@ RedirectBox::get_selected_redirects (vector<boost::shared_ptr<Redirect> >& redir
{
vector<Gtk::TreeModel::Path> pathlist = redirect_display.get_selection()->get_selected_rows();
for (vector<Gtk::TreeModel::Path>::iterator iter = pathlist.begin(); iter != pathlist.end(); ++iter)
redirects.push_back ((*(model->get_iter(*iter)))[columns.redirect]);
for (vector<Gtk::TreeModel::Path>::iterator iter = pathlist.begin(); iter != pathlist.end(); ++iter) {
redirects.push_back ((*(model->get_iter(*iter)))[columns.redirect]);
}
}
void
@ -980,7 +1054,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect)
plugin_insert->set_gui (plugin_ui);
// change window title when route name is changed
_route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, plugin_insert));
_route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, boost::weak_ptr<PluginInsert> (plugin_insert)));
} else {
@ -1240,11 +1314,13 @@ RedirectBox::rb_edit ()
}
void
RedirectBox::route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::shared_ptr<PluginInsert> pi)
RedirectBox::route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::weak_ptr<PluginInsert> wpi)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), src, plugin_ui, pi));
plugin_ui->set_title (generate_redirect_title (pi));
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), src, plugin_ui, wpi));
boost::shared_ptr<PluginInsert> pi (wpi.lock());
if (pi) {
plugin_ui->set_title (generate_redirect_title (pi));
}
}
string

View file

@ -97,7 +97,9 @@ class RedirectBox : public Gtk::HBox
PluginSelector & _plugin_selector;
RouteRedirectSelection & _rr_selection;
void route_going_away ();
struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
ModelColumns () {
add (text);
@ -140,7 +142,7 @@ class RedirectBox : public Gtk::HBox
void show_redirect_menu (gint arg);
void choose_send ();
void send_io_finished (IOSelector::Result, boost::shared_ptr<ARDOUR::Redirect>, IOSelectorWindow*);
void send_io_finished (IOSelector::Result, boost::weak_ptr<ARDOUR::Redirect>, IOSelectorWindow*);
void choose_insert ();
void choose_plugin ();
void insert_plugin_chosen (boost::shared_ptr<ARDOUR::Plugin>);
@ -149,18 +151,14 @@ class RedirectBox : public Gtk::HBox
bool ignore_delete;
bool redirect_button_press_event (GdkEventButton *);
bool redirect_button_release_event (GdkEventButton *);
void redisplay_redirects (void* src);
void add_redirect_to_display (boost::shared_ptr<ARDOUR::Redirect>);
void row_deleted (const Gtk::TreeModel::Path& path);
void show_redirect_name (void*, boost::shared_ptr<ARDOUR::Redirect>);
/* these are handlers for Redirect signals, so they take Redirect*
directly, rather than shared_ptr<Redirect>
*/
void show_redirect_active (ARDOUR::Redirect*, void *);
string redirect_name (boost::shared_ptr<ARDOUR::Redirect>);
void show_redirect_active_r (ARDOUR::Redirect*, void *, boost::weak_ptr<ARDOUR::Redirect>);
void show_redirect_active (boost::weak_ptr<ARDOUR::Redirect>);
void show_redirect_name (void* src, boost::weak_ptr<ARDOUR::Redirect>);
string redirect_name (boost::weak_ptr<ARDOUR::Redirect>);
void remove_redirect_gui (boost::shared_ptr<ARDOUR::Redirect>);
@ -195,7 +193,7 @@ class RedirectBox : public Gtk::HBox
void hide_redirect_editor (boost::shared_ptr<ARDOUR::Redirect>);
void rename_redirect (boost::shared_ptr<ARDOUR::Redirect>);
gint idle_delete_redirect (boost::shared_ptr<ARDOUR::Redirect>);
gint idle_delete_redirect (boost::weak_ptr<ARDOUR::Redirect>);
void wierd_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, boost::shared_ptr<ARDOUR::IO> io);
@ -219,7 +217,7 @@ class RedirectBox : public Gtk::HBox
static void rb_deactivate_all ();
static void rb_edit ();
void route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::shared_ptr<ARDOUR::PluginInsert> pi);
void route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::weak_ptr<ARDOUR::PluginInsert> pi);
std::string generate_redirect_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
};

View file

@ -44,9 +44,9 @@ AudioRegionGainLine::model_to_view_y (double& y)
}
void
AudioRegionGainLine::start_drag (ControlPoint* cp, float fraction)
AudioRegionGainLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
{
AutomationLine::start_drag(cp,fraction);
AutomationLine::start_drag (cp, x, fraction);
if (!rv.audio_region()->envelope_active()) {
trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), &rv.audio_region()->get_state(), 0));
rv.audio_region()->set_envelope_active(false);

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