ythickness = 1
}
+style "padded_button" = "default_button"
+{
+ xthickness = 8
+}
+
style "odd_port_groups"
{
fg[NORMAL] = { 0.6, 0.6, 0.6 }
class "GtkArrow" style:highest "tearoff_arrow"
class "GtkProgressBar" style:highest "ardour_progressbars"
+widget "PaddedButton" style:highest "padded_button"
widget "*FirstActionMessage" style:highest "first_action_message"
widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor"
widget "*MarkerText" style:highest "marker_text"
widget "*TimeAxisViewItemName*" style:highest "time_axis_view_item_name"
-#widget "*ExportProgress" style:highest "default_generic"
-widget "*ExportFileLabel" style:highest "small_bold_text"
-widget "*ExportFormatLabel" style:highest "medium_bold_text"
-widget "*ExportHeader" style:highest "small_bold_text"
-widget "*ExportFileDisplay" style:highest "medium_entry"
-widget "*ExportFormatDisplay" style:highest "medium_entry"
-widget "*ExportCheckbox" style:highest "small_entry"
-widget "*ExportTrackSelector*" style:highest "medium_entry_noselection_bg"
widget "*EditModeSelector" style:highest "medium_bold_entry"
widget "*SnapTypeSelector" style:highest "medium_bold_entry"
widget "*SnapModeSelector" style:highest "medium_bold_entry"
ythickness = 1
}
+style "padded_button" = "default_button"
+{
+ xthickness = 8
+}
+
style "odd_port_groups"
{
fg[NORMAL] = { 0.6, 0.6, 0.6 }
class "GtkArrow" style:highest "tearoff_arrow"
class "GtkProgressBar" style:highest "ardour_progressbars"
+widget "PaddedButton" style:highest "padded_button"
widget "*FirstActionMessage" style:highest "first_action_message"
widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor"
widget "*MarkerText" style:highest "marker_text"
track_chans (track.n_outputs().n_audio()),
raw_button (type_group),
+ fades_button (type_group),
processed_button (type_group)
{
pack_start (vbox);
- raw_button.set_label (string_compose (_("Raw region export, no fades or plugins (%1 channels)"), region_chans));
+ raw_button.set_label (string_compose (_("Region contents without fades (channels: %1)"), region_chans));
raw_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
vbox.pack_start (raw_button);
- processed_button.set_label (string_compose (_("Processed region export with fades and plugins applied (%1 channels)"), track_chans));
+ fades_button.set_label (string_compose (_("Region contents with fades (channels: %1)"), region_chans));
+ fades_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
+ vbox.pack_start (fades_button);
+
+ processed_button.set_label (string_compose (_("Track output (channels: %1)"), track_chans));
processed_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
vbox.pack_start (processed_button);
state->config->clear_channels ();
if (raw_button.get_active ()) {
-
factory.reset (new RegionExportChannelFactory (session, region, track, RegionExportChannelFactory::Raw));
-
- for (size_t chan = 0; chan < region_chans; ++chan) {
- state->config->register_channel (factory->create (chan));
- }
-
+ } else if (fades_button.get_active ()) {
+ factory.reset (new RegionExportChannelFactory (session, region, track, RegionExportChannelFactory::Fades));
} else if (processed_button.get_active ()) {
-
factory.reset (new RegionExportChannelFactory(session, region, track, RegionExportChannelFactory::Processed));
-
- for (size_t chan = 0; chan < region_chans; ++chan) {
- state->config->register_channel (factory->create (chan));
- }
-
+ } else {
+ CriticalSelectionChanged ();
+ return;
+ }
+
+ for (size_t chan = 0; chan < region_chans; ++chan) {
+ state->config->register_channel (factory->create (chan));
}
CriticalSelectionChanged ();
Gtk::RadioButtonGroup type_group;
Gtk::RadioButton raw_button;
+ Gtk::RadioButton fades_button;
Gtk::RadioButton processed_button;
};
/* Buttons */
cancel_button = add_button (Gtk::Stock::CANCEL, RESPONSE_CANCEL);
- rt_export_button = add_button (_("Realtime export"), RESPONSE_RT);
+ rt_export_button = add_button (_("Realtime Export"), RESPONSE_RT);
fast_export_button = add_button (_("Fast Export"), RESPONSE_FAST);
+ list_files_button.set_name ("PaddedButton");
+
cancel_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::close_dialog));
rt_export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::export_rt));
fast_export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::export_fw));
void
ExportFileNotebook::FilePage::update_tab_label ()
{
- tab_label.set_text (string_compose ("%1 %2", tab_number, get_format_name()));
+ tab_label.set_text (string_compose ("Format %1: %2", tab_number, get_format_name()));
CriticalSelectionChanged();
}
path_hbox.pack_start (path_entry, true, true, 3);
path_hbox.pack_start (browse_button, false, false, 3);
+ browse_button.set_name ("PaddedButton");
+
label_sizegroup = Gtk::SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
label_sizegroup->add_widget (label_label);
label_sizegroup->add_widget (path_label);
pack_start (remove_button, false, false, 3);
pack_start (new_button, false, false, 3);
+ edit_button.set_name ("PaddedButton");
+ remove_button.set_name ("PaddedButton");
+ new_button.set_name ("PaddedButton");
+
edit_button.signal_clicked().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &ExportFormatSelector::open_edit_dialog), false)));
remove_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::remove_format));
new_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::add_new_format));
pack_start (remove_button, false, false, 6);
pack_start (new_button, false, false, 0);
+ save_button.set_name ("PaddedButton");
+ remove_button.set_name ("PaddedButton");
+ new_button.set_name ("PaddedButton");
+
save_button.set_sensitive (false);
remove_button.set_sensitive (false);
new_button.set_sensitive (false);
public:
enum Type {
Raw,
+ Fades,
Processed
};
RegionExportChannelFactory (Session * session, AudioRegion const & region, AudioTrack & track, Type type);
+ ~RegionExportChannelFactory ();
ExportChannelPtr create (uint32_t channel);
void read (uint32_t channel, Sample * data, nframes_t frames_to_read);
bool buffers_up_to_date;
nframes_t region_start;
nframes_t position;
+
+ Sample * mixdown_buffer;
+ Sample * gain_buffer;
};
/// Export channel that reads from region channel
frames_per_cycle (session->engine().frames_per_cycle ()),
buffers_up_to_date (false),
region_start (region.position()),
- position (region_start)
+ position (region_start),
+
+ mixdown_buffer (0),
+ gain_buffer (0)
{
switch (type) {
case Raw:
n_channels = region.n_channels();
+ break;
+ case Fades:
+ n_channels = region.n_channels();
+
+ mixdown_buffer = new Sample [frames_per_cycle];
+ gain_buffer = new Sample [frames_per_cycle];
+ memset (gain_buffer, 1.0, sizeof (Sample) * frames_per_cycle);
+
break;
case Processed:
n_channels = track.n_outputs().n_audio();
buffers.ensure_buffers (DataType::AUDIO, n_channels, frames_per_cycle);
}
+RegionExportChannelFactory::~RegionExportChannelFactory ()
+{
+ if (mixdown_buffer) {
+ delete[] mixdown_buffer;
+ }
+
+ if (gain_buffer) {
+ delete[] gain_buffer;
+ }
+}
+
ExportChannelPtr
RegionExportChannelFactory::create (uint32_t channel)
{
void
RegionExportChannelFactory::update_buffers (nframes_t frames)
{
+ assert (frames <= frames_per_cycle);
+
switch (type) {
case Raw:
for (size_t channel = 0; channel < n_channels; ++channel) {
region.read (buffers.get_audio (channel).data(), position - region_start, frames, channel);
}
break;
+ case Fades:
+ assert (mixdown_buffer && gain_buffer);
+ for (size_t channel = 0; channel < n_channels; ++channel) {
+ memset (mixdown_buffer, 0, sizeof (Sample) * frames);
+ region.read_at (buffers.get_audio (channel).data(), mixdown_buffer, gain_buffer, position, frames, channel);
+ }
+ break;
case Processed:
- std::cout << "exporting " << frames << " frames from position " << position << std::endl;
track.export_stuff (buffers, position, frames);
break;
default: