diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-11-13 10:00:09 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-11-13 10:00:09 +0000 |
commit | 45b4721be3d310c157d8e7f7a656f39eae69510f (patch) | |
tree | 3d697dcda1947918d00809639cde737d950f8367 /libs | |
parent | 02c49688c72cf88d2e2f8eb6908355c8b37e6c95 (diff) |
speed up track resizing; fixup file DnD; stop use CAAudioFile for imported files
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4148 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/appleutility/CAAudioFile.h | 8 | ||||
-rw-r--r-- | libs/appleutility/SConscript | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/import.cc | 26 | ||||
-rw-r--r-- | libs/ardour/sndfileimportable.cc | 1 | ||||
-rw-r--r-- | libs/gtkmm2ext/dndtreeview.cc | 1 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/dndtreeview.h | 5 | ||||
-rw-r--r-- | libs/pbd/undo.cc | 1 |
8 files changed, 19 insertions, 27 deletions
diff --git a/libs/appleutility/CAAudioFile.h b/libs/appleutility/CAAudioFile.h index 2cfb4f3031..ce22bfe466 100644 --- a/libs/appleutility/CAAudioFile.h +++ b/libs/appleutility/CAAudioFile.h @@ -43,6 +43,7 @@ #ifndef __CAAudioFile_h__ #define __CAAudioFile_h__ +#include <iostream> #include <AvailabilityMacros.h> #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) @@ -98,6 +99,7 @@ public: // implementation-independent helpers void Open(const char *filePath) { FSRef fsref; + std::cerr << "Opening " << filePath << std::endl; XThrowIfError(FSPathMakeRef((UInt8 *)filePath, &fsref, NULL), "locate audio file"); Open(fsref); } @@ -112,9 +114,10 @@ public: // or the file's sample rate is 0 (unknown) #if CAAF_USE_EXTAUDIOFILE +#warning HERE WE ARE public: - CAAudioFile() : mExtAF(NULL) { } - virtual ~CAAudioFile() { if (mExtAF) Close(); } + CAAudioFile() : mExtAF(NULL) { std::cerr << "Constructing CAAudioFile\n"; } + virtual ~CAAudioFile() { std::cerr << "Destroying CAAudiofile @ " << this << std::endl; if (mExtAF) Close(); } void Open(const FSRef &fsref) { // open an existing file @@ -131,6 +134,7 @@ public: } void Close() { + std::cerr << "\tdisposeo of ext audio file @ " << mExtAF << std::endl; XThrowIfError(ExtAudioFileDispose(mExtAF), "ExtAudioFileClose failed"); mExtAF = NULL; } diff --git a/libs/appleutility/SConscript b/libs/appleutility/SConscript index 5b6f3b6d84..bfe87af9e5 100644 --- a/libs/appleutility/SConscript +++ b/libs/appleutility/SConscript @@ -4,7 +4,7 @@ import os import os.path import glob -appleutility_files = glob.glob('*.cpp') +appleutility_files = [ glob.glob('*.cpp') + glob.glob('*.c') + glob.glob('*.C') ] Import('env install_prefix') appleutility = env.Clone() diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index c967310dc7..0b845f6eeb 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -585,6 +585,7 @@ class Session : public PBD::StatefulDestructible string doing_what; /* control info */ + uint32_t total; SrcQuality quality; volatile bool freeze; std::vector<Glib::ustring> paths; @@ -592,7 +593,6 @@ class Session : public PBD::StatefulDestructible /* result */ SourceList sources; - }; void import_audiofiles (import_status&); diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 9f103346fd..b211321026 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -50,8 +50,10 @@ #include <ardour/analyser.h> #ifdef HAVE_COREAUDIO +#ifdef USE_COREAUDIO_FOR_FILE_IO #include <ardour/caimportable.h> #endif +#endif #include "i18n.h" @@ -63,11 +65,13 @@ static boost::shared_ptr<ImportableSource> open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQuality quality) { #ifdef HAVE_COREAUDIO +#ifdef USE_COREAUDIO_FOR_FILE_IO /* see if we can use CoreAudio to handle the IO */ try { - boost::shared_ptr<CAImportableSource> source(new CAImportableSource(path)); + CAImportableSource* src = new CAImportableSource(path); + boost::shared_ptr<CAImportableSource> source (src); if (source->samplerate() == samplerate) { return source; @@ -81,14 +85,12 @@ open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQua catch (...) { /* fall back to SndFile */ - #endif +#endif try { boost::shared_ptr<SndFileImportableSource> source(new SndFileImportableSource(path)); - cerr << "Got a new sndfile source from " << path << " as " << source->length() << endl; - if (source->samplerate() == samplerate) { return source; } @@ -103,8 +105,10 @@ open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQua } #ifdef HAVE_COREAUDIO +#ifdef USE_COREAUDIO_FOR_FILE_IO } #endif +#endif } static std::string @@ -246,8 +250,6 @@ write_audio_data_to_new_files (ImportableSource* source, Session::import_status& boost::scoped_array<float> data(new float[nframes * channels]); vector<boost::shared_array<Sample> > channel_data; - cerr << "writing " << channels << " to new file, length = " << source->length() << endl; - for (uint n = 0; n < channels; ++n) { channel_data.push_back(boost::shared_array<Sample>(new Sample[nframes])); } @@ -284,8 +286,6 @@ write_audio_data_to_new_files (ImportableSource* source, Session::import_status& read_count += nread; status.progress = read_count / (source->ratio () * source->length() * channels); - - cerr << "status.progress = " << status.progress << endl; } } @@ -306,9 +306,6 @@ Session::import_audiofiles (import_status& status) typedef vector<boost::shared_ptr<AudioFileSource> > AudioSources; AudioSources all_new_sources; - - cerr << "start import of AF\n"; - status.sources.clear (); for (vector<Glib::ustring>::iterator p = status.paths.begin(); @@ -320,13 +317,11 @@ Session::import_audiofiles (import_status& status) try { source = open_importable_source (*p, frame_rate(), status.quality); - cerr << "New source from " << *p << " length = " << source->length() << endl; } catch (const failed_constructor& err) { error << string_compose(_("Import: cannot open input sound file \"%1\""), (*p)) << endmsg; - cerr << string_compose(_("Import: cannot open input sound file \"%1\""), (*p)) << endl; status.done = status.cancel = true; return; } @@ -355,10 +350,8 @@ Session::import_audiofiles (import_status& status) } status.doing_what = compose_status_message (*p, source->samplerate(), - frame_rate(), cnt, status.paths.size()); + frame_rate(), cnt, status.total); - cerr << "about to write audio data\n"; - write_audio_data_to_new_files (source.get(), status, newfiles); } @@ -393,7 +386,6 @@ Session::import_audiofiles (import_status& status) std::for_each (all_new_sources.begin(), all_new_sources.end(), remove_file_source); } - cerr << "end of import, setting done = true\n"; status.done = true; } diff --git a/libs/ardour/sndfileimportable.cc b/libs/ardour/sndfileimportable.cc index 542999f6f1..5cd00a8e96 100644 --- a/libs/ardour/sndfileimportable.cc +++ b/libs/ardour/sndfileimportable.cc @@ -9,7 +9,6 @@ SndFileImportableSource::SndFileImportableSource (const string& path) : in (sf_open (path.c_str(), SFM_READ, &sf_info), sf_close) { if (!in) throw failed_constructor(); - std::cerr << "new SFIS @ " << path << " frames = " << sf_info.frames << std::endl; } SndFileImportableSource::~SndFileImportableSource () diff --git a/libs/gtkmm2ext/dndtreeview.cc b/libs/gtkmm2ext/dndtreeview.cc index 2c2e69f6b6..a840114def 100644 --- a/libs/gtkmm2ext/dndtreeview.cc +++ b/libs/gtkmm2ext/dndtreeview.cc @@ -47,6 +47,7 @@ DnDTreeViewBase::add_drop_targets (list<TargetEntry>& targets) for (list<TargetEntry>::iterator i = targets.begin(); i != targets.end(); ++i) { draggable.push_back (*i); } + enable_model_drag_source (draggable); enable_model_drag_dest (draggable); } diff --git a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h index 92872ee60f..412eb69750 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h @@ -74,13 +74,11 @@ class DnDTreeView : public DnDTreeViewBase sigc::signal<void,std::string,uint32_t,const DataType*> signal_object_drop; void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time) { - std::cerr << "DRAG DATA Get, context = " << context->gobj() << " src = " << context->gobj()->is_source << std::endl; if (selection_data.get_target() == "GTK_TREE_MODEL_ROW") { - + TreeView::on_drag_data_get (context, selection_data, info, time); } else if (data_column >= 0) { - Gtk::TreeSelection::ListHandle_Path selection = get_selection()->get_selected_rows (); SerializedObjectPointers<DataType>* sr = serialize_pointers (get_model(), &selection, selection_data.get_target()); selection_data.set (8, (guchar*)sr, sr->size); @@ -88,7 +86,6 @@ class DnDTreeView : public DnDTreeViewBase } void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time) { - std::cerr << "DRAG DATA Receive, context = " << context->gobj() << " src = " << context->gobj()->is_source << std::endl; if (suggested_action) { /* this is a drag motion callback. just update the status to say that we are still dragging, and that's it. diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index 4ed1e70ebc..8823b2da64 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -18,7 +18,6 @@ $Id$ */ -#include <iostream> #include <string> #include <sstream> #include <time.h> |