All included libraries now link dynamically instead of statically.

Moved items from gtk2_ardour/utils to pbd3/convert.
Various cleanups.


git-svn-id: svn://localhost/trunk/ardour2@475 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Taybin Rutkin 2006-04-25 20:23:50 +00:00
parent bc46c6e5d4
commit 49ab3aa0b3
61 changed files with 387 additions and 281 deletions

View file

@ -4,3 +4,4 @@ ardour.rc
config.log
scache.conf
.gdb_history
docs/

View file

@ -28,7 +28,6 @@ opts.AddOptions(
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('DEBUG', 'Set to build with debugging information and no optimizations', 0),
PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'),
BoolOption('DEVBUILD', 'Use shared libardour (developers only)', 0),
BoolOption('NLS', 'Set to turn on i18n support', 1),
PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
BoolOption('VST', 'Compile with support for VST', 0),
@ -409,9 +408,9 @@ libraries['usb'] = LibraryInfo ()
conf = Configure (libraries['usb'])
if conf.CheckLib ('usb', 'usb_interrupt_write'):
have_libusb = 1
have_libusb = True
else:
have_libusb = 0
have_libusb = False
libraries['usb'] = conf.Finish ()
@ -512,7 +511,7 @@ else:
]
subdirs = [
# 'libs/cassowary',
# 'libs/cassowary',
'libs/sigc++2',
'libs/pbd3',
'libs/midi++2',
@ -539,7 +538,6 @@ if env['SURFACES']:
if have_libusb:
surface_subdirs += [ 'libs/surfaces/tranzport' ]
opts.Save('scache.conf', env)
Help(opts.GenerateHelpText(env))

View file

@ -24,6 +24,7 @@
#include <sigc++/bind.h>
#include <gtkmm/stock.h>
#include <pbd/error.h>
#include <pbd/convert.h>
#include <gtkmm2ext/utils.h>
#include "utils.h"
@ -64,11 +65,11 @@ AddRouteDialog::AddRouteDialog ()
routes_spinner (routes_adjustment)
{
if (channel_combo_strings.empty()) {
channel_combo_strings = internationalize (channel_setup_names);
channel_combo_strings = PBD::internationalize (channel_setup_names);
}
if (track_mode_strings.empty()) {
track_mode_strings = internationalize (track_mode_names);
track_mode_strings = PBD::internationalize (track_mode_names);
}
set_name ("AddRouteDialog");
@ -195,10 +196,10 @@ AddRouteDialog::channels ()
return 1;
} else if (str == _("Stereo")) {
return 2;
} else if ((chns = atoi (str)) != 0) {
} else if ((chns = PBD::atoi (str)) != 0) {
return chns;
} else {
return 0;
}
return 0;
}

View file

@ -2,4 +2,7 @@
export ARDOUR_PATH=./glade:./pixmaps:.:..
export LD_LIBRARY_PATH=../libs/ardour:../libs/midi++2:../libs/pbd3:../libs/soundtouch:../libs/gtkmm2ext:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../libs/ardour:../libs/midi++2:../libs/pbd3:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libglademm:$LD_LIBRARY_PATH
# DYLD_LIBRARY_PATH is for darwin.
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH

View file

@ -18,6 +18,8 @@
$Id$
*/
#include <pbd/convert.h>
#include <gtkmm2ext/utils.h>
#include <ardour/configuration.h>
@ -380,7 +382,7 @@ ARDOUR_UI::mtc_port_changed ()
0
};
positional_sync_strings = internationalize (psync_strings);
positional_sync_strings = PBD::internationalize (psync_strings);
} else {
const gchar *psync_strings[] = {
@ -388,7 +390,7 @@ ARDOUR_UI::mtc_port_changed ()
N_("JACK"),
0
};
positional_sync_strings = internationalize (psync_strings);
positional_sync_strings = PBD::internationalize (psync_strings);
}
set_popdown_strings (sync_option_combo, positional_sync_strings);

View file

@ -20,6 +20,9 @@
#include <cstdio> // for sprintf
#include <cmath>
#include <pbd/convert.h>
#include <gtkmm2ext/utils.h>
#include <ardour/ardour.h>
@ -37,6 +40,8 @@ using namespace ARDOUR;
using namespace sigc;
using namespace Gtk;
using PBD::atoi;
const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = {
2, /* SMPTE_Hours */
2, /* SMPTE_Minutes */

View file

@ -26,6 +26,7 @@
#include <sigc++/bind.h>
#include <pbd/convert.h>
#include <pbd/error.h>
#include <gtkmm/image.h>
@ -87,6 +88,8 @@ using namespace Glib;
using namespace Gtkmm2ext;
using namespace Editing;
using PBD::internationalize;
const double Editor::timebar_height = 15.0;
#include "editor_xpms"

View file

@ -22,12 +22,13 @@
#include <unistd.h>
#include <utility>
#include <sys/stat.h>
#include <fstream>
#include <samplerate.h>
#include <pbd/xml++.h>
#include <pbd/convert.h>
#include <pbd/dirname.h>
#include <pbd/xml++.h>
#include <gtkmm2ext/utils.h>
#include <ardour/export.h>
@ -48,11 +49,12 @@
#define FRAME_NAME "BaseFrame"
using namespace std;
using namespace ARDOUR;
using namespace sigc;
using namespace Gtk;
using PBD::internationalize;
static const gchar *sample_rates[] = {
N_("22.05kHz"),
N_("44.1kHz"),

View file

@ -7,8 +7,6 @@
#include <vector>
#include <string>
std::vector<std::string> internationalize (const char **);
#define _(Text) dgettext (PACKAGE,Text)
#define N_(Text) gettext_noop (Text)
#define X_(Text) Text

View file

@ -19,10 +19,11 @@
*/
#include <cmath>
#include <glib.h>
#include <sigc++/bind.h>
#include <pbd/convert.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/choice.h>
@ -1318,7 +1319,7 @@ MixerStrip::name_changed (void *src)
RouteUI::name_changed (src);
break;
case Narrow:
name_label.set_text (short_version (_route.name(), 5));
name_label.set_text (PBD::short_version (_route.name(), 5));
break;
}
}

View file

@ -23,7 +23,9 @@
#include <gtkmm/accelmap.h>
#include <pbd/convert.h>
#include <pbd/lockmonitor.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/stop_signal.h>
@ -53,6 +55,8 @@ using namespace Gtkmm2ext;
using namespace sigc;
using namespace std;
using PBD::atoi;
Mixer_UI::Mixer_UI (AudioEngine& eng)
: Window (Gtk::WINDOW_TOPLEVEL),
engine (eng)

View file

@ -168,7 +168,6 @@ PluginSelector::set_session (Session* s)
void
PluginSelector::_input_refiller (void *arg)
{
((PluginSelector *) arg)->input_refiller ();
}

View file

@ -19,10 +19,11 @@
*/
#include <cmath>
#include <glib.h>
#include <sigc++/bind.h>
#include <pbd/convert.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm2ext/gtk_ui.h>
@ -539,7 +540,7 @@ RedirectBox::redirect_name (Redirect& redirect)
name_display += send->name().substr (lbracket+1, lbracket-rbracket-1);
break;
case Narrow:
name_display += short_version (send->name().substr (lbracket+1, lbracket-rbracket-1), 4);
name_display += PBD::short_version (send->name().substr (lbracket+1, lbracket-rbracket-1), 4);
break;
}
@ -550,7 +551,7 @@ RedirectBox::redirect_name (Redirect& redirect)
name_display += redirect.name();
break;
case Narrow:
name_display += short_version (redirect.name(), 5);
name_display += PBD::short_version (redirect.name(), 5);
break;
}

View file

@ -26,6 +26,7 @@
#include <gtkmm/stock.h>
#include <pbd/basename.h>
#include <pbd/convert.h>
#include <gtkmm2ext/utils.h>
@ -44,8 +45,6 @@
using namespace ARDOUR;
using namespace std;
string length2string (const int32_t frames, const float sample_rate);
SoundFileBox::SoundFileBox ()
:
_session(0),
@ -129,7 +128,7 @@ SoundFileBox::setup_labels (string filename)
}
length.set_alignment (0.0f, 0.0f);
length.set_text (string_compose("Length: %1", length2string(sf_info.length, sf_info.samplerate)));
length.set_text (string_compose("Length: %1", PBD::length2string(sf_info.length, sf_info.samplerate)));
format.set_alignment (0.0f, 0.0f);
format.set_text (sf_info.format_name);
@ -334,7 +333,7 @@ SoundFileOmega::SoundFileOmega (string title)
split_check (_("Split Channels"))
{
if (mode_strings.empty()) {
mode_strings = internationalize (import_mode_strings);
mode_strings = PBD::internationalize (import_mode_strings);
}
ARDOUR_UI::instance()->tooltips().set_tip(split_check,

View file

@ -44,70 +44,6 @@ using namespace Gtk;
using namespace sigc;
using namespace Glib;
string
short_version (string orig, string::size_type target_length)
{
/* this tries to create a recognizable abbreviation
of "orig" by removing characters until we meet
a certain target length.
note that we deliberately leave digits in the result
without modification.
*/
string::size_type pos;
/* remove white-space and punctuation, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("\"\n\t ,<.>/?:;'[{}]~`!@#$%^&*()_-+="))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove lower-case vowels, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("aeiou"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove upper-case vowels, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("AEIOU"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove lower-case consonants, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("bcdfghjklmnpqrtvwxyz"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove upper-case consonants, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("BCDFGHJKLMNPQRTVWXYZ"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* whatever the length is now, use it */
return orig;
}
ustring
fit_to_pixels (const ustring& str, int pixel_width, Pango::FontDescription& font, int& actual_width)
{
@ -141,30 +77,6 @@ fit_to_pixels (const ustring& str, int pixel_width, Pango::FontDescription& font
return ustr;
}
int
atoi (const string& s)
{
return atoi (s.c_str());
}
double
atof (const string& s)
{
return atof (s.c_str());
}
vector<string>
internationalize (const char **array)
{
vector<string> v;
for (uint32_t i = 0; array[i]; ++i) {
v.push_back (_(array[i]));
}
return v;
}
gint
just_hide_it (GdkEventAny *ev, Gtk::Window *win)
{
@ -297,79 +209,6 @@ get_canvas_points (string who, uint32_t npoints)
return new ArdourCanvas::Points (npoints);
}
static int32_t
int_from_hex (char hic, char loc)
{
int hi; /* hi byte */
int lo; /* low byte */
hi = (int) hic;
if( ('0'<=hi) && (hi<='9') ) {
hi -= '0';
} else if( ('a'<= hi) && (hi<= 'f') ) {
hi -= ('a'-10);
} else if( ('A'<=hi) && (hi<='F') ) {
hi -= ('A'-10);
}
lo = (int) loc;
if( ('0'<=lo) && (lo<='9') ) {
lo -= '0';
} else if( ('a'<=lo) && (lo<='f') ) {
lo -= ('a'-10);
} else if( ('A'<=lo) && (lo<='F') ) {
lo -= ('A'-10);
}
return lo + (16 * hi);
}
void
url_decode (string& url)
{
string::iterator last;
string::iterator next;
for (string::iterator i = url.begin(); i != url.end(); ++i) {
if ((*i) == '+') {
*i = ' ';
}
}
if (url.length() <= 3) {
return;
}
last = url.end();
--last; /* points at last char */
--last; /* points at last char - 1 */
for (string::iterator i = url.begin(); i != last; ) {
if (*i == '%') {
next = i;
url.erase (i);
i = next;
++next;
if (isxdigit (*i) && isxdigit (*next)) {
/* replace first digit with char */
*i = int_from_hex (*i,*next);
++i; /* points at 2nd of 2 digits */
url.erase (i);
}
} else {
++i;
}
}
}
Pango::FontDescription
get_font_for_style (string widgetname)
{
@ -595,21 +434,3 @@ get_xpm (std::string name)
return (xpm_map[name]);
}
string
length2string (const int32_t frames, const float sample_rate)
{
int secs = (int) (frames / sample_rate);
int hrs = secs / 3600;
secs -= (hrs * 3600);
int mins = secs / 60;
secs -= (mins * 60);
int total_secs = (hrs * 3600) + (mins * 60) + secs;
int frames_remaining = (int) floor (frames - (total_secs * sample_rate));
float fractional_secs = (float) frames_remaining / sample_rate;
char duration_str[32];
sprintf (duration_str, "%02d:%02d:%05.2f", hrs, mins, (float) secs + fractional_secs);
return duration_str;
}

View file

@ -52,12 +52,8 @@ slider_position_to_gain (double pos)
return pow (2.0,(sqrt(sqrt(sqrt(pos)))*198.0-192.0)/6.0);
}
std::string short_version (std::string, std::string::size_type target_length);
Glib::ustring fit_to_pixels (const Glib::ustring&, int pixel_width, Pango::FontDescription& font, int& actual_width);
int atoi (const std::string&);
double atof (const std::string&);
void url_decode (std::string&);
gint just_hide_it (GdkEventAny*, Gtk::Window*);
void allow_keyboard_focus (bool);
@ -82,6 +78,5 @@ bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev);
Glib::RefPtr<Gdk::Pixbuf> get_xpm(std::string);
static std::map<std::string, Glib::RefPtr<Gdk::Pixbuf> > xpm_map;
const char* const *get_xpm_data (std::string path);
std::string length2string (const int32_t frames, const float sample_rate);
#endif /* __ardour_gtk_utils_h__ */

View file

@ -5,3 +5,4 @@ version.cc
*.os
*.mo
*.pot
*.dylib

View file

@ -168,6 +168,7 @@ if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/Core
if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
ardour.Append(LINKFLAGS="-framework AudioToolbox")
extra_sources += coreaudio_files
ardour = conf.Finish ()
@ -199,26 +200,15 @@ env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o
src_suffix = '.s',
single_source = 1)
if env['DEVBUILD'] == 1:
if env['FPU_OPTIMIZATION']:
if env['DIST_TARGET'] == "i386":
arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
if env['DIST_TARGET'] == "i686":
arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
if env['DIST_TARGET'] == "x86_64":
arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
if env['FPU_OPTIMIZATION']:
if env['DIST_TARGET'] == "i386":
arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
if env['DIST_TARGET'] == "i686":
arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
if env['DIST_TARGET'] == "x86_64":
arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
else:
if env['FPU_OPTIMIZATION']:
if env['DIST_TARGET'] == "i386":
arch_specific_objects = env.StaticObject(target='sse_functions',source='sse_functions.s')
if env['DIST_TARGET'] == "i686":
arch_specific_objects = env.StaticObject(target='sse_functions',source='sse_functions.s')
if env['DIST_TARGET'] == "x86_64":
arch_specific_objects = env.StaticObject(target='sse_functions_64bit',source='sse_functions_64bit.s')
libardour = ardour.StaticLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
Default(libardour)

View file

@ -47,6 +47,7 @@ class Session;
class PluginInfo {
public:
enum Type {
AudioUnit,
LADSPA,
VST
};

View file

@ -231,22 +231,22 @@ ControlProtocolManager::set_state (const XMLNode& node)
for (citer = clist.begin(); citer != clist.end(); ++citer) {
if ((*citer)->name() == X_("Protocol")) {
if ((prop = (*citer)->property (X_("active"))) != 0) {
if (prop->value() == X_("yes")) {
if ((prop = (*citer)->property (X_("name"))) != 0) {
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
if (cpi) {
if (_session) {
instantiate (*cpi);
} else {
cpi->requested = true;
}
prop = (*citer)->property (X_("active"));
if (prop && prop->value() == X_("yes")) {
if ((prop = (*citer)->property (X_("name"))) != 0) {
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
if (cpi) {
if (_session) {
instantiate (*cpi);
} else {
cpi->requested = true;
}
}
}
}
}
}
return 0;
}
XMLNode&

View file

@ -7,8 +7,6 @@
#include <vector>
#include <string>
std::vector<std::string> internationalize (const char **);
#define _(Text) dgettext (PACKAGE,Text)
#define N_(Text) gettext_noop (Text)
#define X_(Text) Text

View file

@ -198,7 +198,6 @@ PluginManager::add_presets(string domain)
vector_delete (presets);
}
void
PluginManager::add_lrdf_data (const string &path)
{
@ -341,6 +340,9 @@ ARDOUR::find_plugin(Session& session, string name, long unique_id, PluginInfo::T
plugs = &mgr->vst_plugin_info();
unique_id = 0; // VST plugins don't have a unique id.
break;
case PluginInfo::AudioUnit:
default:
return 0;
}
for (i = plugs->begin(); i != plugs->end(); ++i) {

View file

@ -1,6 +1,8 @@
#include <map>
#include <vector>
#include <pbd/convert.h>
#include <sndfile.h>
#include <ardour/sndfile_helpers.h>
@ -108,7 +110,7 @@ sndfile_file_ending_from_string (string str)
static vector<string> file_endings;
if (file_endings.empty()) {
file_endings = internationalize((const char **) sndfile_file_endings_strings);
file_endings = PBD::internationalize((const char **) sndfile_file_endings_strings);
}
for (int n = 0; sndfile_header_formats_strings[n]; ++n) {

View file

@ -28,5 +28,5 @@ cassowary.Append(CCFLAGS="-D_REENTRANT")
cassowary.CXXFile(target = ['ClReader.cc', 'ClReader.cc.h'], source = 'ClReader.yy')
cassowary.CXXFile(target = 'ClReader-lex.cc', source = 'ClReader.ll')
libcassowary = cassowary.StaticLibrary('cassowary', cassowary_files)
libcassowary = cassowary.SharedLibrary('cassowary', cassowary_files)
Default(libcassowary)

View file

@ -35,7 +35,7 @@ src/Module.cpp
src/Port.cpp
""")
libflowcanvas = flowcanvas.StaticLibrary('flowcanvas', flowcanvas_files)
libflowcanvas = flowcanvas.SharedLibrary('flowcanvas', flowcanvas_files)
Default(libflowcanvas)

View file

@ -9,3 +9,5 @@ glibmm-2.4.pc
glibmmconfig.h
libtool
stamp-h1
*.os
*.dylib

View file

@ -1,3 +1,5 @@
# -*- python -*-
import glob
import os
@ -12,7 +14,7 @@ glibmm2.Append(CXXFLAGS='-DHAVE_CONFIG_H')
#glibmm2.Append(CXXFLAGS='-DG_DISABLE_DEPRECATED')
glibmm2.Append(CXXFLAGS='-DG_LOG_DOMAIN=\\\"glibmm\\\"')
libglibmm2 = glibmm2.StaticLibrary('glibmm2', glibmm2_files)
libglibmm2 = glibmm2.SharedLibrary('glibmm2', glibmm2_files)
if os.path.exists ('CVS'):
glibmm2_configure_script = glibmm2.Command ('configure', 'configure.ac', 'cd libs/glibmm2; ./autogen.sh; cd -', ENV=os.environ)

View file

@ -1,2 +1,3 @@
Makefile
Makefile.in
*.os

View file

@ -0,0 +1 @@
*.dylib

View file

@ -1,3 +1,5 @@
# -*- python -*-
import glob
atkmm_files = glob.glob('atkmm/*.cc')
@ -6,7 +8,7 @@ Import('env libraries')
atkmm = env.Copy()
atkmm.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'] ])
libatkmm = atkmm.StaticLibrary('atkmm', atkmm_files)
libatkmm = atkmm.SharedLibrary('atkmm', atkmm_files)
Default(libatkmm)
env.Alias('tarball', env.Distribute (env['DISTTREE'],

View file

@ -0,0 +1 @@
*.os

View file

@ -0,0 +1 @@
*.dylib

View file

@ -1,12 +1,15 @@
# -*- python -*-
import glob
gdkmm2_files = glob.glob('gdkmm/*.cc')
Import('env libraries')
gdkmm2 = env.Copy()
gdkmm2.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'], libraries['pangomm'], libraries['gtkmm2']])
gdkmm2.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'], libraries['pangomm']])
gdkmm2.Append(CXXFLAGS="-Ilibs/gtkmm2/gtk")
libgdkmm2 = gdkmm2.StaticLibrary('gdkmm2', gdkmm2_files)
libgdkmm2 = gdkmm2.SharedLibrary('gdkmm2', gdkmm2_files)
Default(libgdkmm2)
env.Alias('tarball', env.Distribute (env['DISTTREE'],

View file

@ -0,0 +1 @@
*.os

View file

@ -0,0 +1 @@
*.dylib

View file

@ -1,3 +1,5 @@
# -*- python -*-
import glob
gtkmm2_files = glob.glob('gtkmm/*.cc')
@ -6,7 +8,7 @@ Import('env libraries')
gtkmm2 = env.Copy()
gtkmm2.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'], libraries['pangomm'], libraries['atkmm'], libraries['gdkmm2'] ])
libgtkmm2 = gtkmm2.StaticLibrary('gtkmm2', gtkmm2_files)
libgtkmm2 = gtkmm2.SharedLibrary('gtkmm2', gtkmm2_files)
Default(libgtkmm2)
env.Alias('tarball', env.Distribute (env['DISTTREE'],

View file

@ -0,0 +1 @@
*.os

View file

@ -0,0 +1 @@
*.dylib

View file

@ -1,3 +1,5 @@
# -*- python -*-
import glob
import os
@ -7,7 +9,7 @@ Import('env libraries')
pangomm = env.Copy()
pangomm.Merge([libraries['glibmm2'], libraries['pango'], libraries['sigc2']])
libpangomm = pangomm.StaticLibrary('pangomm', pangomm_files)
libpangomm = pangomm.SharedLibrary('pangomm', pangomm_files)
Default(libpangomm)
env.Alias('tarball', env.Distribute (env['DISTTREE'],

View file

@ -0,0 +1 @@
*.os

View file

@ -3,3 +3,5 @@ libgtkmmext.spec
version.cc
*.mo
*.pot
*.os
*.dylib

View file

@ -60,10 +60,7 @@ gtkmm2ext.VersionBuild(['version.cc','gtkmm2ext/version.h'], 'SConscript')
gtkmm2ext.Append(CCFLAGS="-D_REENTRANT")
gtkmm2ext.Append(CCFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
if env['DEVBUILD']:
libgtkmm2ext = gtkmm2ext.SharedLibrary('gtkmm2ext', gtkmm2ext_files)
else:
libgtkmm2ext = gtkmm2ext.StaticLibrary('gtkmm2ext', gtkmm2ext_files)
libgtkmm2ext = gtkmm2ext.SharedLibrary('gtkmm2ext', gtkmm2ext_files)
Default(libgtkmm2ext)

View file

@ -9,7 +9,7 @@ libglademm_files = glob.glob('libglademm/*.cc')
libglademm = env.Copy()
libglademm.Merge([libraries['gtk2'], libraries['glade2'], libraries['sigc2'], libraries['glibmm2'], libraries['pangomm'], libraries['atkmm'], libraries['gdkmm2'], libraries['gtkmm2']])
libglade = libglademm.StaticLibrary('libglademm', libglademm_files)
libglade = libglademm.SharedLibrary('libglademm', libglademm_files)
Default(libglade)

View file

@ -0,0 +1 @@
*.dylib

View file

@ -1,3 +1,5 @@
# -*- python -*-
import glob
gnomecanvasmm_files = glob.glob('libgnomecanvasmm/*.cc')
@ -6,7 +8,7 @@ Import('env libraries')
gnomecanvasmm = env.Copy()
gnomecanvasmm.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'], libraries['pangomm'], libraries['atkmm'], libraries['gdkmm2'], libraries['gtkmm2'], libraries['libgnomecanvas2'] ])
libgnomecanvasmm = gnomecanvasmm.StaticLibrary('libgnomecanvasmm', gnomecanvasmm_files)
libgnomecanvasmm = gnomecanvasmm.SharedLibrary('libgnomecanvasmm', gnomecanvasmm_files)
Default(libgnomecanvasmm)
env.Alias('tarball', env.Distribute (env['DISTTREE'],

View file

@ -0,0 +1 @@
*.os

View file

@ -1,3 +1,5 @@
libmidi++.pc
libmidi++.spec
version.cc
*.os
*.dylib

View file

@ -35,6 +35,8 @@ coremidi_midiport.cc
if env['SYSMIDI'] == 'CoreMIDI':
sysdep_src = [ 'coremidi_midiport.cc' ]
midi2.Append (CCFLAGS="-DWITH_COREMIDI")
midi2.Append (LINKFLAGS="-framework CoreMIDI")
midi2.Append (LINKFLAGS="-framework CoreFoundation")
else:
sysdep_src = [ 'alsa_sequencer_midiport.cc' ]
midi2.Append (CCFLAGS="-DWITH_ALSA")
@ -44,10 +46,7 @@ midi2.Append(CCFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
midi2.VersionBuild(['version.cc','midi++/version.h'], 'SConscript')
if env['DEVBUILD']:
libmidi2 = midi2.SharedLibrary('midi++', [ sources, sysdep_src ])
else:
libmidi2 = midi2.StaticLibrary('midi++', [ sources, sysdep_src ])
libmidi2 = midi2.SharedLibrary('midi++', [ sources, sysdep_src ])
Default(libmidi2)

View file

@ -1,3 +1,5 @@
libpbd.pc
libpbd.spec
version.cc
*.os
*.dylib

View file

@ -18,6 +18,7 @@ pbd3.Append(POTFILE=domain + '.pot')
pbd3_files = Split("""
basename.cc
base_ui.cc
convert.cc
dirname.cc
dmalloc.cc
mountpoint.cc
@ -45,13 +46,9 @@ pbd3 = conf.Finish()
pbd3.Merge ([ libraries['sigc2'], libraries['xml'] ])
pbd3.VersionBuild(['version.cc','pbd/version.h'], 'SConscript')
if env['DEVBUILD']:
libpbd3 = pbd3.SharedLibrary('pbd', pbd3_files)
else:
libpbd3 = pbd3.StaticLibrary('pbd', pbd3_files)
libpbd3 = pbd3.SharedLibrary('pbd', pbd3_files)
Default(libpbd3)

211
libs/pbd3/convert.cc Normal file
View file

@ -0,0 +1,211 @@
/*
Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <cmath>
#include "pbd/convert.h"
#include "i18n.h"
using std::string;
using std::vector;
namespace PBD {
string
short_version (string orig, string::size_type target_length)
{
/* this tries to create a recognizable abbreviation
of "orig" by removing characters until we meet
a certain target length.
note that we deliberately leave digits in the result
without modification.
*/
string::size_type pos;
/* remove white-space and punctuation, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("\"\n\t ,<.>/?:;'[{}]~`!@#$%^&*()_-+="))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove lower-case vowels, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("aeiou"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove upper-case vowels, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("AEIOU"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove lower-case consonants, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("bcdfghjklmnpqrtvwxyz"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* remove upper-case consonants, starting at end */
while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("BCDFGHJKLMNPQRTVWXYZ"))) == string::npos) {
break;
}
orig.replace (pos, 1, "");
}
/* whatever the length is now, use it */
return orig;
}
int
atoi (const string& s)
{
return atoi (s.c_str());
}
double
atof (const string& s)
{
return atof (s.c_str());
}
vector<string>
internationalize (const char **array)
{
vector<string> v;
for (uint32_t i = 0; array[i]; ++i) {
v.push_back (_(array[i]));
}
return v;
}
static int32_t
int_from_hex (char hic, char loc)
{
int hi; /* hi byte */
int lo; /* low byte */
hi = (int) hic;
if( ('0'<=hi) && (hi<='9') ) {
hi -= '0';
} else if( ('a'<= hi) && (hi<= 'f') ) {
hi -= ('a'-10);
} else if( ('A'<=hi) && (hi<='F') ) {
hi -= ('A'-10);
}
lo = (int) loc;
if( ('0'<=lo) && (lo<='9') ) {
lo -= '0';
} else if( ('a'<=lo) && (lo<='f') ) {
lo -= ('a'-10);
} else if( ('A'<=lo) && (lo<='F') ) {
lo -= ('A'-10);
}
return lo + (16 * hi);
}
void
url_decode (string& url)
{
string::iterator last;
string::iterator next;
for (string::iterator i = url.begin(); i != url.end(); ++i) {
if ((*i) == '+') {
*i = ' ';
}
}
if (url.length() <= 3) {
return;
}
last = url.end();
--last; /* points at last char */
--last; /* points at last char - 1 */
for (string::iterator i = url.begin(); i != last; ) {
if (*i == '%') {
next = i;
url.erase (i);
i = next;
++next;
if (isxdigit (*i) && isxdigit (*next)) {
/* replace first digit with char */
*i = int_from_hex (*i,*next);
++i; /* points at 2nd of 2 digits */
url.erase (i);
}
} else {
++i;
}
}
}
string
length2string (const int32_t frames, const float sample_rate)
{
int secs = (int) (frames / sample_rate);
int hrs = secs / 3600;
secs -= (hrs * 3600);
int mins = secs / 60;
secs -= (mins * 60);
int total_secs = (hrs * 3600) + (mins * 60) + secs;
int frames_remaining = (int) floor (frames - (total_secs * sample_rate));
float fractional_secs = (float) frames_remaining / sample_rate;
char duration_str[32];
sprintf (duration_str, "%02d:%02d:%05.2f", hrs, mins, (float) secs + fractional_secs);
return duration_str;
}
} // namespace PBD

40
libs/pbd3/pbd/convert.h Normal file
View file

@ -0,0 +1,40 @@
/*
Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __pbd_convert_h__
#define __pbd_convert_h__
#include <string>
#include <vector>
namespace PBD {
std::string short_version (std::string, std::string::size_type target_length);
int atoi (const std::string&);
double atof (const std::string&);
void url_decode (std::string&);
std::string length2string (const int32_t frames, const float sample_rate);
std::vector<std::string> internationalize (const char **);
} //namespace PBD
#endif /* __pbd_convert_h__ */

View file

@ -16,3 +16,4 @@ sigc++-2.0.pc
stamp-h1
configure
sigc++config.h
*.dylib

View file

@ -8,7 +8,7 @@ sigc2_files = glob.glob('sigc++/*.cc') + glob.glob('sigc++/functors/*.cc') + glo
Import('env')
sigc2 = env.Copy()
libsigc2 = sigc2.StaticLibrary('sigc++2', sigc2_files)
libsigc2 = sigc2.SharedLibrary('sigc++2', sigc2_files)
if os.path.exists ('CVS'):
sigc2_configure_script = sigc2.Command ('configure', 'configure.ac', 'cd libs/sigc++2; ./autogen.sh; cd -', ENV=os.environ)

View file

@ -1,3 +1,4 @@
Makefile
Makefile.in
.deps
*.os

View file

@ -0,0 +1 @@
*.os

View file

@ -0,0 +1 @@
*.os

View file

@ -0,0 +1,2 @@
*.os
*.dylib

View file

@ -17,10 +17,7 @@ Import('env')
st = env.Copy()
st.Append(CCFLAGS="-DHAVE_CONFIG_H -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
if env['DEVBUILD']:
libst = st.SharedLibrary('soundtouch', soundtouch_files)
else:
libst = st.StaticLibrary('soundtouch', soundtouch_files)
libst = st.SharedLibrary('soundtouch', soundtouch_files)
Default(libst)

View file

@ -29,12 +29,11 @@ genericmidi.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
genericmidi.Append(CXXFLAGS="-DCONFIG_DIR=\\\""+final_config_prefix+"\\\"")
genericmidi.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
genericmidi.Append(CPPPATH=libraries['ardour'].get ('CPPPATH', []))
genericmidi.Append(CPPPATH=libraries['sigc2'].get ('CPPPATH', []))
genericmidi.Append(CPPPATH=libraries['pbd3'].get ('CPPPATH', []))
genericmidi.Append(CPPPATH=libraries['midi++2'].get ('CPPPATH', []))
genericmidi.Merge ([
libraries['ardour'],
libraries['midi++2'],
libraries['pbd3'],
libraries['sigc2'],
libraries['usb'],
libraries['xml']
])

View file

@ -0,0 +1 @@
*.os