Skip to content

Commit

Permalink
merge from 2.0-ongoing @ 3581
Browse files Browse the repository at this point in the history
git-svn-id: svn://localhost/ardour2/branches/3.0@3711 d708f5d6-7413-0410-9779-e7cbd77b26cf
  • Loading branch information
pauldavisthefirst committed Sep 10, 2008
1 parent e4372df commit 68e9432
Show file tree
Hide file tree
Showing 283 changed files with 7,822 additions and 3,495 deletions.
28 changes: 20 additions & 8 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#

import os
import os.path
import sys
import re
import shutil
Expand Down Expand Up @@ -35,7 +36,6 @@ opts.AddOptions(
BoolOption('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0),
BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0),
BoolOption('GTKOSX', 'Compile for use with GTK-OSX, not GTK-X11', 0),
BoolOption('NATIVE_OSX_KEYS', 'Build key bindings file that matches OS X conventions', 0),
BoolOption('OLDFONTS', 'Old school font sizes', 0),
BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0),
BoolOption('STL_DEBUG', 'Set to build with Standard Template Library Debugging', 0),
Expand All @@ -57,7 +57,8 @@ opts.AddOptions(
BoolOption('LV2', 'Compile with support for LV2 (if slv2 is available)', 0),
BoolOption('GPROFILE', 'Compile with support for gprofile (Developers only)', 0),
BoolOption('FREEDESKTOP', 'Install MIME type, icons and .desktop file as per the freedesktop.org spec (requires xdg-utils and shared-mime-info). "scons uninstall" removes associations in desktop database', 0),
BoolOption('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 1)
BoolOption('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 1),
BoolOption('AUBIO', "Use Paul Brossier's aubio library for feature detection (if available)", 1)
)

#----------------------------------------------------------------------
Expand Down Expand Up @@ -450,7 +451,8 @@ deps = \
'raptor' : '1.4.2',
'lrdf' : '0.4.0',
'jack' : '0.109.0',
'libgnomecanvas-2.0' : '2.0'
'libgnomecanvas-2.0' : '2.0',
'aubio' : '0.3.2'
}

def DependenciesRequiredMessage():
Expand Down Expand Up @@ -523,6 +525,13 @@ if conf.CheckPKGExists ('fftw3'):
libraries['fftw3'] = LibraryInfo()
libraries['fftw3'].ParseConfig('pkg-config --cflags --libs fftw3')

if conf.CheckPKGExists ('aubio'):
libraries['aubio'] = LibraryInfo()
libraries['aubio'].ParseConfig('pkg-config --cflags --libs aubio')
env['AUBIO'] = 1
else:
env['AUBIO'] = 0

env = conf.Finish ()

if env['FFT_ANALYSIS']:
Expand Down Expand Up @@ -828,8 +837,9 @@ def prep_libcheck(topenv, libinfo):
# rationale: GTK-Quartz uses jhbuild and installs to /opt/gtk by default.
# All libraries needed should be built against this location
if topenv['GTKOSX']:
libinfo.Append(CPPPATH="/opt/gtk/include", LIBPATH="/opt/gtk/lib")
libinfo.Append(CXXFLAGS="-I/opt/gtk/include", LINKFLAGS="-L/opt/gtk/lib")
gtkroot = os.path.expanduser ("~");
libinfo.Append(CPPPATH="$GTKROOT/include", LIBPATH="$GTKROOT/lib")
libinfo.Append(CXXFLAGS="-I$GTKROOT/include", LINKFLAGS="-L$GTKROOT/lib")
libinfo.Append(CPPPATH="/opt/local/include", LIBPATH="/opt/local/lib")
libinfo.Append(CXXFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")

Expand Down Expand Up @@ -921,7 +931,7 @@ prep_libcheck(env, libraries['boost'])
libraries['boost'].Append(CPPPATH="/usr/local/include", LIBPATH="/usr/local/lib")
conf = Configure (libraries['boost'])
if conf.CheckHeader ('boost/shared_ptr.hpp', language='CXX') == False:
print "Boost header files do not appear to be installed."
print "Boost header files do not appear to be installed. You also might be running a buggy version of scons. Try scons 0.97 if you can."
sys.exit (1)

libraries['boost'] = conf.Finish ()
Expand Down Expand Up @@ -1081,7 +1091,8 @@ if env['SYSLIBS']:
CPPPATH='#libs/appleutility')

coredirs = [
'templates'
'templates',
'manual'
]

subdirs = [
Expand Down Expand Up @@ -1155,7 +1166,8 @@ else:
CPPPATH='#libs/appleutility')

coredirs = [
'templates'
'templates',
'manual'
]

subdirs = [
Expand Down
7 changes: 4 additions & 3 deletions gtk2_ardour/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import glob

Import('env install_prefix final_prefix config_prefix libraries i18n ardour_version')

gtkardour = env.Copy()
gtkmmtests = env.Copy()
gtkardour = env.Clone()
gtkmmtests = env.Clone()

#
# this defines the version number of the GTK interface to ardour
Expand Down Expand Up @@ -409,7 +409,7 @@ my_subst_dict = { }

keybindings_dict = { }

if gtkardour['GTKOSX'] and gtkardour['NATIVE_OSX_KEYS']:
if gtkardour['GTKOSX']:
#
# Command(Meta), Alt(Mod1), Ctrl, Shift
# **** as of february 4th 2008, OUR VERSION OF *****
Expand Down Expand Up @@ -487,6 +487,7 @@ env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3'
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3', 'pixmaps'), pixmap_files))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3', 'icons'), icon_files))
env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], []))
env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], []))

# This will install icons and MIME type as per freedesktop.org specs. #
if env['FREEDESKTOP']:
Expand Down
57 changes: 57 additions & 0 deletions gtk2_ardour/actions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,50 @@ struct SortActionsByLabel {
}
};

void
ActionManager::get_all_actions (vector<string>& groups, vector<string>& names, vector<AccelKey>& bindings)
{
/* the C++ API for functions used here appears to be broken in
gtkmm2.6, so we fall back to the C level.
*/

GList* list = gtk_ui_manager_get_action_groups (ui_manager->gobj());
GList* node;
GList* acts;

for (node = list; node; node = g_list_next (node)) {

GtkActionGroup* group = (GtkActionGroup*) node->data;

/* first pass: collect them all */

typedef std::list<Glib::RefPtr<Gtk::Action> > action_list;
action_list the_acts;

for (acts = gtk_action_group_list_actions (group); acts; acts = g_list_next (acts)) {
GtkAction* action = (GtkAction*) acts->data;
the_acts.push_back (Glib::wrap (action, true));
}

/* now sort by label */

SortActionsByLabel cmp;
the_acts.sort (cmp);

for (action_list::iterator a = the_acts.begin(); a != the_acts.end(); ++a) {

string accel_path = (*a)->get_accel_path ();

groups.push_back (gtk_action_group_get_name(group));
names.push_back (accel_path.substr (accel_path.find_last_of ('/') + 1));

AccelKey key;
lookup_entry (accel_path, key);
bindings.push_back (AccelKey (key.get_key(), Gdk::ModifierType (key.get_mod())));
}
}
}

void
ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, vector<string>& keys, vector<AccelKey>& bindings)
{
Expand Down Expand Up @@ -226,6 +270,19 @@ ActionManager::get_widget (const char * name)
return ui_manager->get_widget (name);
}

RefPtr<Action>
ActionManager::get_action (const char* path)
{
GtkAction* _act;
RefPtr<Action> act;

if ((_act = gtk_ui_manager_get_action (ui_manager->gobj(), path)) != 0) {
return Glib::wrap (_act, true);
}

return act;
}

RefPtr<Action>
ActionManager::get_action (const char* group_name, const char* action_name)
{
Expand Down
5 changes: 5 additions & 0 deletions gtk2_ardour/actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ActionManager

static Gtk::Widget* get_widget (const char * name);
static Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
static Glib::RefPtr<Gtk::Action> get_action (const char* path);

static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);

Expand Down Expand Up @@ -100,6 +101,10 @@ class ActionManager
std::vector<std::string>& keys,
std::vector<Gtk::AccelKey>& bindings);

static void get_all_actions (std::vector<std::string>& groups,
std::vector<std::string>& paths,
std::vector<Gtk::AccelKey>& bindings);

static void uncheck_toggleaction (const char * actionname);
};

Expand Down
81 changes: 46 additions & 35 deletions gtk2_ardour/analysis_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
continue;

RouteUI *rui = dynamic_cast<RouteUI *>(*i);

int n_inputs = rui->route()->n_inputs().n_audio(); // FFT is audio only

// Busses don't have playlists, so we need to check that we actually are working with a playlist
if (!pl || !rui)
continue;
Expand All @@ -275,29 +276,31 @@ AnalysisWindow::analyze_data (Gtk::Button *button)

for (std::list<AudioRange>::iterator j = ts.begin(); j != ts.end(); ++j) {

nframes_t i = 0;
int n;

while ( i < (*j).length() ) {
// TODO: What about stereo+ channels? composite all to one, I guess
for (int channel = 0; channel < n_inputs; channel++) {
nframes_t x = 0;

n = fft_graph.windowSize();
while ( x < (*j).length() ) {
// TODO: What about stereo+ channels? composite all to one, I guess

if (i + n >= (*j).length() ) {
n = (*j).length() - i;
}

n = pl->read(buf, mixbuf, gain, (*j).start + i, n);

if ( n < fft_graph.windowSize()) {
for (int j = n; j < fft_graph.windowSize(); j++) {
buf[j] = 0.0;
n = fft_graph.windowSize();

if (x + n >= (*j).length() ) {
n = (*j).length() - x;
}

n = pl->read(buf, mixbuf, gain, (*j).start + x, n, channel);

if ( n < fft_graph.windowSize()) {
for (int j = n; j < fft_graph.windowSize(); j++) {
buf[j] = 0.0;
}
}

res->analyzeWindow(buf);

x += n;
}

res->analyzeWindow(buf);

i += n;
}
}
} else if (source_selection_regions_rb.get_active()) {
Expand All @@ -316,28 +319,36 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
continue;

// cerr << " - " << (*j)->region().name() << ": " << (*j)->region().length() << " samples starting at " << (*j)->region().position() << endl;
nframes_t i = 0;
int n;
for (int channel = 0; channel < n_inputs; channel++) {

while ( i < arv->region()->length() ) {
// TODO: What about stereo+ channels? composite all to one, I guess
nframes_t x = 0;

n = fft_graph.windowSize();
if (i + n >= arv->region()->length() ) {
n = arv->region()->length() - i;
}
nframes_t length = arv->region()->length();

n = arv->audio_region()->read_at(buf, mixbuf, gain, arv->region()->position() + i, n);

if ( n < fft_graph.windowSize()) {
for (int j = n; j < fft_graph.windowSize(); j++) {
buf[j] = 0.0;
while ( x < length ) {
// TODO: What about stereo+ channels? composite all to one, I guess

n = fft_graph.windowSize();
if (x + n >= length ) {
n = length - x;
}

n = arv->audio_region()->read_at(buf, mixbuf, gain, arv->region()->position() + x, n, channel);

if (n == 0)
break;

if ( n < fft_graph.windowSize()) {
for (int j = n; j < fft_graph.windowSize(); j++) {
buf[j] = 0.0;
}
}

res->analyzeWindow(buf);

x += n;
}

res->analyzeWindow(buf);

i += n;
}
// cerr << "Found: " << (*j)->get_item_name() << endl;

Expand Down
16 changes: 16 additions & 0 deletions gtk2_ardour/ardour-sae.menus
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@

</menubar>

<<<<<<< .working
<popup action="RulerMenuPopup">
<menuitem action="toggle-minsec-ruler"/>
<menuitem action="toggle-samples-ruler"/>
Expand All @@ -339,6 +340,21 @@
</popup>

<popup name='processormenu'>
=======
<popup action="RulerMenuPopup">
<menuitem action="toggle-minsec-ruler"/>
<menuitem action="toggle-samples-ruler"/>
<menuitem action="toggle-bbt-ruler"/>
<separator/>
<menuitem action="toggle-meter-ruler"/>
<menuitem action="toggle-tempo-ruler"/>
<menuitem action="toggle-loop-punch-ruler"/>
<menuitem action="toggle-cd-marker-ruler"/>
<menuitem action="toggle-marker-ruler"/>
</popup>

<popup name='redirectmenu'>
>>>>>>> .merge-right.r3622
<menuitem action='newplugin'/>
<menuitem action='newinsert'/>
<menuitem action='newsend'/>
Expand Down
Loading

0 comments on commit 68e9432

Please sign in to comment.