2020-12-18 Fred Gleason <fredg@paravelsystems.com>

* Fixed bugs in the 'Voice Tracker' dialog of rdlogedit that
	could leave voice track carts in indeterminate state when the
	dialog was closed by means of the 'X' button.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2020-12-18 09:34:11 -05:00
parent f149a73cdf
commit 8e8343c8cc
3 changed files with 30 additions and 12 deletions

View File

@ -20710,3 +20710,7 @@
2020-12-18 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdlogedit(1) that caused changing the
Start Time type to trigger a request for a save.
2020-12-18 Fred Gleason <fredg@paravelsystems.com>
* Fixed bugs in the 'Voice Tracker' dialog of rdlogedit that
could leave voice track carts in indeterminate state when the
dialog was closed by means of the 'X' button.

View File

@ -1003,6 +1003,7 @@ void VoiceTracker::resetData()
if(!edit_track_cart->remove(rda->station(),rda->user(),rda->config())) {
QMessageBox::warning(this,tr("RDLogEdit"),tr("Audio Deletion Error!"));
}
SendNotification(RDNotification::DeleteAction,edit_track_cart->number());
delete edit_track_cart;
edit_track_cart=NULL;
if(edit_track_cuts[1]!=NULL) {
@ -1890,6 +1891,7 @@ void VoiceTracker::recordUnloadedData(int card,int stream,unsigned msecs)
stateChangedData(2,RDPlayDeck::Finished);
}
UpdateControls();
SendNotification(RDNotification::ModifyAction,edit_logline[1]->cartNumber());
}
@ -2107,6 +2109,17 @@ void VoiceTracker::mouseMoveEvent(QMouseEvent *e)
}
void VoiceTracker::closeEvent(QCloseEvent *e)
{
if(track_close_button->isEnabled()) {
closeData();
}
else {
e->ignore();
}
}
void VoiceTracker::LoadTrack(int line)
{
edit_deck_state=DeckIdle;
@ -2343,12 +2356,6 @@ bool VoiceTracker::ImportTrack(int line)
edit_logline[1]->
startPoint());
}
/*
item->setPixmap(0,*edit_track_cart_map);
item->setText(3,QString().sprintf("%06u",edit_track_cart->number()));
item->setText(4,track_group->name());
item->setText(5,RDGetTimeLength(edit_track_cart->forcedLength()));
*/
postData();
SaveTrack(track_line);
LoadTrack(track_line);
@ -3780,6 +3787,7 @@ bool VoiceTracker::InitTrack()
setFadedownPoint(edit_logline[1]->endPoint(),RDLogLine::LogPointer);
edit_logline[1]->setFadeupGain(RD_FADE_DEPTH);
track_tracks--;
SendNotification(RDNotification::AddAction,next_cart);
return true;
}
@ -3939,3 +3947,13 @@ void VoiceTracker::SendNotification(RDNotification::Action action,
rda->ripc()->sendNotification(*notify);
delete notify;
}
void VoiceTracker::SendNotification(RDNotification::Action action,
unsigned cartnum)
{
RDNotification *notify=new RDNotification(RDNotification::CartType,
action,QVariant(cartnum));
rda->ripc()->sendNotification(*notify);
delete notify;
}

View File

@ -47,7 +47,6 @@
#define TRACKER_DONE_BUTTON_COLOR Qt::blue
#define TRACKER_START_WIDTH 19633
#define TRACKER_MSECS_PER_PIXEL 29
//#define TRACKER_MB_PER_PIXEL 141
#define TRACKER_MB_PER_PIXEL 42
#define TRACKER_GAIN_MARGIN 4
#define TRACKER_MAX_GAIN 0
@ -117,6 +116,7 @@ class VoiceTracker : public RDDialog
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e);
void closeEvent(QCloseEvent *e);
private:
enum DeckState {DeckIdle=0,DeckTrack1=1,DeckTrack2=2,DeckTrack3=3};
@ -159,6 +159,7 @@ class VoiceTracker : public RDDialog
void PopSegues();
int SingleSelectionLine(bool incl_end_handle=false);
void SendNotification(RDNotification::Action action,const QString &log_name);
void SendNotification(RDNotification::Action action,unsigned cartnum);
RDStereoMeter *track_meter;
QTimer *track_meter_timer;
RDTransportButton *track_play_button;
@ -175,7 +176,6 @@ class VoiceTracker : public RDDialog
QPushButton *track_delete_button;
QPushButton *track_close_button;
RDLog *track_log;
// RDLogEvent *track_log_event;
RDEventPlayer *track_event_player;
QString edit_log_name;
int track_line;
@ -185,7 +185,6 @@ class VoiceTracker : public RDDialog
int track_time_counter;
bool track_block_valid;
QTime track_start_time;
// LogListView *track_log_list;
QLabel *edit_length_label;
QLabel *edit_tracks_remaining_label;
QLabel *edit_time_remaining_label;
@ -255,7 +254,6 @@ class VoiceTracker : public RDDialog
QPalette track_record_palette;
QPalette track_done_palette;
QPalette track_abort_palette;
// Q3PopupMenu *track_menu;
int menu_clicked_point;
QString *edit_import_path;
RDSettings *edit_settings;
@ -266,12 +264,10 @@ class VoiceTracker : public RDDialog
VoiceTracker::Target track_current_target;
bool edit_shift_pressed;
RDLogLock *track_log_lock;
LogTableView *d_log_view;
LogModel *d_log_model;
RDLog *d_log;
RDSvc *d_svc;
QMenu *d_mouse_menu;
QAction *d_edit_cue_action;
QAction *d_undo_segue_action;