Skip to content

Commit

Permalink
[filters] Make the preview modal and clean it up, to avoid using stal…
Browse files Browse the repository at this point in the history
…e handles later on
  • Loading branch information
mean committed Jan 4, 2017
1 parent 0f86c7b commit d49cac3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
9 changes: 5 additions & 4 deletions avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,13 @@ void filtermainWindow::preview(bool b)
ADM_coreVideoFilter *filter=ADM_vf_getInstance(itag);
ADM_assert(filter);
if (previewDialog)
previewDialog->resetVideoStream(filter);
else
{
previewDialog = new Ui_seekablePreviewWindow(this, filter, 0);
connect(previewDialog, SIGNAL(accepted()), this, SLOT(closePreview()));
delete previewDialog;
previewDialog=NULL;
}
previewDialog = new Ui_seekablePreviewWindow(this, filter, 0);
previewDialog->setModal(true);
connect(previewDialog, SIGNAL(accepted()), this, SLOT(closePreview()));
previewDialog->show();
}
/**
Expand Down
19 changes: 2 additions & 17 deletions avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_seekablePreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ Ui_seekablePreviewWindow::~Ui_seekablePreviewWindow()
delete canvas;
}

/**
*
* @return
*/
bool Ui_seekablePreviewWindow::nextImage(void)
{
return seekablePreview->nextImage();
}
/**
*
* @param videoStream
Expand All @@ -61,9 +53,10 @@ void Ui_seekablePreviewWindow::resetVideoStream(ADM_coreVideoFilter *videoStream
{
if (seekablePreview)
delete seekablePreview;

seekablePreview=NULL;
if (canvas)
delete canvas;
canvas=NULL;

uint32_t canvasWidth = videoStream->getInfo()->width;
uint32_t canvasHeight = videoStream->getInfo()->height;
Expand All @@ -74,14 +67,6 @@ void Ui_seekablePreviewWindow::resetVideoStream(ADM_coreVideoFilter *videoStream
seekablePreview->setCookieFunc(setCurrentPtsCallback,this);
seekablePreview->sliderChanged();
}
/**
*
* @param value
*/
void Ui_seekablePreviewWindow::sliderChanged(int value)
{
seekablePreview->sliderChanged();
}
/**
*
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,4 @@ class Ui_seekablePreviewWindow : public QDialog
uint32_t frameIndex();
bool setTime(uint64_t timestamp);

public slots:
void sliderChanged(int value);
bool nextImage(void);
};

0 comments on commit d49cac3

Please sign in to comment.