File indexing completed on 2024-05-05 04:51:42

0001 /* 
0002     SPDX-FileCopyrightText: 1998-2007 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef _K3B_AUDIO_TRACK_SPLIT_DIALOG_H_
0007 #define _K3B_AUDIO_TRACK_SPLIT_DIALOG_H_
0008 
0009 #include <QDialog>
0010 #include <QEvent>
0011 
0012 class QMenu;
0013 
0014 
0015 /**
0016  * Internally used by AudioTrackView to get an msf value from the user.
0017  */
0018 namespace K3b {
0019 
0020 class AudioTrack;
0021 class AudioEditorWidget;
0022 class Msf;
0023 class MsfEdit;
0024     
0025 class AudioTrackSplitDialog : public QDialog
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     explicit AudioTrackSplitDialog( AudioTrack*, QWidget* parent = 0 );
0031     ~AudioTrackSplitDialog() override;
0032 
0033     bool eventFilter( QObject* o, QEvent* e ) override;
0034 
0035     /**
0036      * if this method returns true val is filled with the user selected value.
0037      */
0038     static void splitTrack( AudioTrack* track, QWidget* parent = 0 );
0039 
0040 private Q_SLOTS:
0041     void slotRangeModified( int, const K3b::Msf& start, const K3b::Msf& );
0042     void slotMsfEditChanged( const K3b::Msf& msf );
0043     void slotRangeSelectionChanged( int );
0044     void slotSplitHere();
0045     void slotRemoveRange();
0046     void splitAt( const QPoint& p );
0047 
0048 private:
0049     void setupActions();
0050 
0051     AudioEditorWidget* m_editorWidget;
0052     MsfEdit* m_msfEditStart;
0053     MsfEdit* m_msfEditEnd;
0054     AudioTrack* m_track;
0055     QMenu* m_popupMenu;
0056     QPoint m_lastClickPosition;
0057 };
0058 }
0059 
0060 #endif