along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <cstdlib>
#include <pbd/pthread_utils.h>
#include <pbd/memento_command.h>
+#include <gtkmm2ext/window_title.h>
+
#include "editor.h"
#include "audio_time_axis.h"
#include "audio_region_view.h"
using namespace PBD;
using namespace sigc;
using namespace Gtk;
+using namespace Gtkmm2ext;
Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
: ArdourDialog ("time stretch dialog"),
{
set_modal (true);
set_position (Gtk::WIN_POS_MOUSE);
- set_title (_("ardour: timestretch"));
set_name (N_("TimeStretchDialog"));
+ WindowTitle title(Glib::get_application_name());
+ title += _("Timestretch");
+ set_title(title.get_string());
+
get_vbox()->set_spacing (5);
get_vbox()->set_border_width (5);
get_vbox()->pack_start (upper_button_box);
Editor::do_timestretch (TimeStretchDialog& dialog)
{
Track* t;
- Playlist* playlist;
- Region* new_region;
-
+ boost::shared_ptr<Playlist> playlist;
+ boost::shared_ptr<Region> new_region;
for (RegionSelection::iterator i = dialog.regions.begin(); i != dialog.regions.end(); ) {
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*i);
if (!arv)
continue;
- AudioRegion& region (arv->audio_region());
+ boost::shared_ptr<AudioRegion> region (arv->audio_region());
TimeAxisView* tv = &(arv->get_time_axis_view());
RouteTimeAxisView* rtv;
RegionSelection::iterator tmp;
- cerr << "stretch " << region.name() << endl;
-
tmp = i;
++tmp;
continue;
}
- if ((playlist = t->diskstream().playlist()) == 0) {
+ if ((playlist = t->diskstream()->playlist()) == 0) {
i = tmp;
continue;
}
- dialog.request.region = ®ion;
+ dialog.request.region = region;
if (!dialog.request.running) {
/* we were cancelled */
}
XMLNode &before = playlist->get_state();
- playlist->replace_region (region, *new_region, region.position());
+ playlist->replace_region (region, new_region, region->position());
XMLNode &after = playlist->get_state();
- session->add_command (new MementoCommand<Playlist>(*playlist, before, after));
+ session->add_command (new MementoCommand<Playlist>(*playlist, &before, &after));
i = tmp;
}
dialog.status = 0;
dialog.request.running = false;
+ dialog.request.region.reset ();
}
void*