GUI part: cleanup peak-files
This commit is contained in:
parent
04e7cfabbe
commit
b05912b0cb
|
@ -36,7 +36,8 @@
|
||||||
<menuitem action='ExportVideo'/>
|
<menuitem action='ExportVideo'/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu name='Cleanup' action='Cleanup'>
|
<menu name='Cleanup' action='Cleanup'>
|
||||||
<menuitem action='bring-into-session'/>
|
<menuitem action='bring-into-session'/>
|
||||||
|
<menuitem action='CleanupPeakFiles'/>
|
||||||
<menuitem action='CleanupUnused'/>
|
<menuitem action='CleanupUnused'/>
|
||||||
<menuitem action='FlushWastebasket'/>
|
<menuitem action='FlushWastebasket'/>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -107,6 +107,7 @@ typedef uint64_t microseconds_t;
|
||||||
#include "ambiguous_file_dialog.h"
|
#include "ambiguous_file_dialog.h"
|
||||||
#include "ardour_ui.h"
|
#include "ardour_ui.h"
|
||||||
#include "audio_clock.h"
|
#include "audio_clock.h"
|
||||||
|
#include "audio_region_view.h"
|
||||||
#include "big_clock_window.h"
|
#include "big_clock_window.h"
|
||||||
#include "bundle_manager.h"
|
#include "bundle_manager.h"
|
||||||
#include "engine_dialog.h"
|
#include "engine_dialog.h"
|
||||||
|
@ -3712,6 +3713,47 @@ ARDOUR_UI::flush_trash ()
|
||||||
display_cleanup_results (rep, _("deleted file"), true);
|
display_cleanup_results (rep, _("deleted file"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::cleanup_peakfiles ()
|
||||||
|
{
|
||||||
|
if (_session == 0) {
|
||||||
|
/* shouldn't happen: menu item is insensitive */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! _session->can_cleanup_peakfiles ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get all region-views in this session
|
||||||
|
RegionSelection rs;
|
||||||
|
TrackViewList empty;
|
||||||
|
empty.clear();
|
||||||
|
editor->get_regions_after(rs, (framepos_t) 0, empty);
|
||||||
|
std::list<RegionView*> views = rs.by_layer();
|
||||||
|
|
||||||
|
// remove displayed audio-region-views waveforms
|
||||||
|
for (list<RegionView*>::iterator i = views.begin(); i != views.end(); ++i) {
|
||||||
|
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (*i);
|
||||||
|
if (!arv) { continue ; }
|
||||||
|
arv->delete_waves();
|
||||||
|
}
|
||||||
|
|
||||||
|
// cleanup peak files:
|
||||||
|
// - stop pending peakfile threads
|
||||||
|
// - close peakfiles if any
|
||||||
|
// - remove peak dir in session
|
||||||
|
// - setup peakfiles (background thread)
|
||||||
|
_session->cleanup_peakfiles ();
|
||||||
|
|
||||||
|
// re-add waves to ARV
|
||||||
|
for (list<RegionView*>::iterator i = views.begin(); i != views.end(); ++i) {
|
||||||
|
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (*i);
|
||||||
|
if (!arv) { continue ; }
|
||||||
|
arv->create_waves();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ARDOUR_UI::setup_order_hint (AddRouteDialog::InsertAt place)
|
ARDOUR_UI::setup_order_hint (AddRouteDialog::InsertAt place)
|
||||||
{
|
{
|
||||||
|
|
|
@ -688,6 +688,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
void display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* list_title, const bool msg_delete);
|
void display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* list_title, const bool msg_delete);
|
||||||
void cleanup ();
|
void cleanup ();
|
||||||
|
void cleanup_peakfiles ();
|
||||||
void flush_trash ();
|
void flush_trash ();
|
||||||
|
|
||||||
bool have_configure_timeout;
|
bool have_configure_timeout;
|
||||||
|
|
|
@ -182,6 +182,10 @@ ARDOUR_UI::install_actions ()
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
ActionManager::write_sensitive_actions.push_back (act);
|
ActionManager::write_sensitive_actions.push_back (act);
|
||||||
|
|
||||||
|
act = ActionManager::register_action (main_actions, X_("CleanupPeakFiles"), _("Clean-up Peak Files..."), sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::cleanup_peakfiles));
|
||||||
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
|
ActionManager::write_sensitive_actions.push_back (act);
|
||||||
|
|
||||||
act = ActionManager::register_action (main_actions, X_("FlushWastebasket"), _("Flush Wastebasket"), sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::flush_trash));
|
act = ActionManager::register_action (main_actions, X_("FlushWastebasket"), _("Flush Wastebasket"), sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::flush_trash));
|
||||||
ActionManager::write_sensitive_actions.push_back (act);
|
ActionManager::write_sensitive_actions.push_back (act);
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
|
|
|
@ -1115,6 +1115,22 @@ AudioRegionView::update_envelope_visibility ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AudioRegionView::delete_waves ()
|
||||||
|
{
|
||||||
|
for (vector<ScopedConnection*>::iterator i = _data_ready_connections.begin(); i != _data_ready_connections.end(); ++i) {
|
||||||
|
delete *i;
|
||||||
|
}
|
||||||
|
_data_ready_connections.clear ();
|
||||||
|
|
||||||
|
for (vector<WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
|
||||||
|
group->remove(*w);
|
||||||
|
}
|
||||||
|
waves.clear();
|
||||||
|
tmp_waves.clear();
|
||||||
|
pending_peak_data->show ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioRegionView::create_waves ()
|
AudioRegionView::create_waves ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,6 +74,7 @@ class AudioRegionView : public RegionView
|
||||||
boost::shared_ptr<ARDOUR::AudioRegion> audio_region() const;
|
boost::shared_ptr<ARDOUR::AudioRegion> audio_region() const;
|
||||||
|
|
||||||
void create_waves ();
|
void create_waves ();
|
||||||
|
void delete_waves ();
|
||||||
|
|
||||||
void set_height (double);
|
void set_height (double);
|
||||||
void set_samples_per_pixel (double);
|
void set_samples_per_pixel (double);
|
||||||
|
|
|
@ -421,6 +421,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
||||||
bool for_mark = false) = 0;
|
bool for_mark = false) = 0;
|
||||||
|
|
||||||
virtual void get_regions_at (RegionSelection &, framepos_t where, TrackViewList const &) const = 0;
|
virtual void get_regions_at (RegionSelection &, framepos_t where, TrackViewList const &) const = 0;
|
||||||
|
virtual void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const = 0;
|
||||||
virtual RegionSelection get_regions_from_selection_and_mouse (framepos_t) = 0;
|
virtual RegionSelection get_regions_from_selection_and_mouse (framepos_t) = 0;
|
||||||
virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
|
virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
|
||||||
virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&) const = 0;
|
virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&) const = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user