summaryrefslogtreecommitdiffstats
path: root/src/projects/k3baudiotracksplitdialog.h
blob: c122d52c57cee57b3a0b51871e9629269239e1a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* 
 *
 * $Id: k3baudiotracksplitdialog.h 620140 2007-01-05 12:02:29Z trueg $
 * Copyright (C) 2004-2007 Sebastian Trueg <trueg@k3b.org>
 *
 * This file is part of the K3b project.
 * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * See the file "COPYING" for the exact licensing terms.
 */

#ifndef _K3B_AUDIO_TRACK_SPLIT_DIALOG_H_
#define _K3B_AUDIO_TRACK_SPLIT_DIALOG_H_

#include <kdialogbase.h>

namespace K3b {
  class Msf;
}
class K3bAudioTrack;
class K3bAudioEditorWidget;
class K3bMsfEdit;
class KActionCollection;
class KPopupMenu;


/**
 * Internally used by K3bAudioTrackView to get an msf value from the user.
 */
class K3bAudioTrackSplitDialog : public KDialogBase
{
  Q_OBJECT
  

 public:
  K3bAudioTrackSplitDialog( K3bAudioTrack*, TQWidget* parent = 0, const char* name = 0 );
  ~K3bAudioTrackSplitDialog();

  bool eventFilter( TQObject* o, TQEvent* e );

  KActionCollection* actionCollection() const { return m_actionCollection; }

  /**
   * if this method returns true val is filled with the user selected value.
   */
  static void splitTrack( K3bAudioTrack* track, TQWidget* parent = 0, const char* name = 0 );

 private slots:
  void slotRangeModified( int, const K3b::Msf& start, const K3b::Msf& );
  void slotMsfEditChanged( const K3b::Msf& msf );
  void slotRangeSelectionChanged( int );
  void slotSplitHere();
  void slotRemoveRange();
  void splitAt( const TQPoint& p );

 private:
  void setupActions();

  K3bAudioEditorWidget* m_editorWidget;
  K3bMsfEdit* m_msfEditStart;
  K3bMsfEdit* m_msfEditEnd;
  K3bAudioTrack* m_track;
  KActionCollection* m_actionCollection;
  KPopupMenu* m_popupMenu;
  TQPoint m_lastClickPosition;
};

#endif