projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
probably fix cleanup issues, but testing required
[ardour.git]
/
gtk2_ardour
/
editor_timefx.cc
diff --git
a/gtk2_ardour/editor_timefx.cc
b/gtk2_ardour/editor_timefx.cc
index 817a770fe566cc41d1e77ff9c6a4c8fe6c2457f6..2efdc03f8fdca0c723997ea380732ed01ef2b7e8 100644
(file)
--- a/
gtk2_ardour/editor_timefx.cc
+++ b/
gtk2_ardour/editor_timefx.cc
@@
-15,7
+15,6
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <cstdlib>
*/
#include <cstdlib>
@@
-25,10
+24,13
@@
#include <pbd/error.h>
#include <pbd/pthread_utils.h>
#include <pbd/error.h>
#include <pbd/pthread_utils.h>
+#include <pbd/memento_command.h>
+
+#include <gtkmm2ext/window_title.h>
#include "editor.h"
#include "audio_time_axis.h"
#include "editor.h"
#include "audio_time_axis.h"
-#include "
region
view.h"
+#include "
audio_region_
view.h"
#include "region_selection.h"
#include <ardour/session.h>
#include "region_selection.h"
#include <ardour/session.h>
@@
-44,6
+46,7
@@
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;
using namespace PBD;
using namespace sigc;
using namespace Gtk;
+using namespace Gtkmm2ext;
Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
: ArdourDialog ("time stretch dialog"),
Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
: ArdourDialog ("time stretch dialog"),
@@
-53,9
+56,12
@@
Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
{
set_modal (true);
set_position (Gtk::WIN_POS_MOUSE);
{
set_modal (true);
set_position (Gtk::WIN_POS_MOUSE);
- set_title (_("ardour: timestretch"));
set_name (N_("TimeStretchDialog"));
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);
get_vbox()->set_spacing (5);
get_vbox()->set_border_width (5);
get_vbox()->pack_start (upper_button_box);
@@
-100,7
+106,7
@@
Editor::TimeStretchDialog::delete_timestretch_in_progress (GdkEventAny* ev)
}
int
}
int
-Editor::run_timestretch (
Audio
RegionSelection& regions, float fraction)
+Editor::run_timestretch (RegionSelection& regions, float fraction)
{
pthread_t thread;
{
pthread_t thread;
@@
-157,39
+163,39
@@
Editor::run_timestretch (AudioRegionSelection& regions, float fraction)
void
Editor::do_timestretch (TimeStretchDialog& dialog)
{
void
Editor::do_timestretch (TimeStretchDialog& dialog)
{
- AudioTrack* at;
- Playlist* playlist;
- AudioRegion* new_region;
-
+ Track* t;
+ boost::shared_ptr<Playlist> playlist;
+ boost::shared_ptr<Region> new_region;
- for (AudioRegionSelection::iterator i = dialog.regions.begin(); i != dialog.regions.end(); ) {
+ for (RegionSelection::iterator i = dialog.regions.begin(); i != dialog.regions.end(); ) {
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*i);
+ if (!arv)
+ continue;
-
AudioRegion& aregion ((*i)->region
);
- TimeAxisView* tv = &(
*i)->get_time_axis_view(
);
-
AudioTimeAxisView* a
tv;
-
Audio
RegionSelection::iterator tmp;
+
boost::shared_ptr<AudioRegion> region (arv->audio_region()
);
+ TimeAxisView* tv = &(
arv->get_time_axis_view()
);
+
RouteTimeAxisView* r
tv;
+ RegionSelection::iterator tmp;
- cerr << "stretch " << aregion.name() << endl;
-
tmp = i;
++tmp;
tmp = i;
++tmp;
- if ((
atv = dynamic_cast<Audio
TimeAxisView*> (tv)) == 0) {
+ if ((
rtv = dynamic_cast<Route
TimeAxisView*> (tv)) == 0) {
i = tmp;
continue;
}
i = tmp;
continue;
}
- if ((
at = dynamic_cast<AudioTrack*> (&atv->route
())) == 0) {
+ if ((
t = dynamic_cast<Track*> (rtv->route().get
())) == 0) {
i = tmp;
continue;
}
i = tmp;
continue;
}
- if ((playlist =
at->disk_stream().
playlist()) == 0) {
+ if ((playlist =
t->diskstream()->
playlist()) == 0) {
i = tmp;
continue;
}
i = tmp;
continue;
}
- dialog.request.region =
&a
region;
+ dialog.request.region = region;
if (!dialog.request.running) {
/* we were cancelled */
if (!dialog.request.running) {
/* we were cancelled */
@@
-204,15
+210,16
@@
Editor::do_timestretch (TimeStretchDialog& dialog)
}
XMLNode &before = playlist->get_state();
}
XMLNode &before = playlist->get_state();
- playlist->replace_region (
aregion, *new_region, aregion.
position());
+ playlist->replace_region (
region, new_region, region->
position());
XMLNode &after = playlist->get_state();
XMLNode &after = playlist->get_state();
- session->add_command (
MementoCommand<Playlist>(*playlist, before,
after));
+ session->add_command (
new MementoCommand<Playlist>(*playlist, &before, &
after));
i = tmp;
}
dialog.status = 0;
dialog.request.running = false;
i = tmp;
}
dialog.status = 0;
dialog.request.running = false;
+ dialog.request.region.reset ();
}
void*
}
void*