juk.h 2.74 KB
Newer Older
1 2 3 4 5
/***************************************************************************
                          juk.h  -  description
                             -------------------
    begin                : Mon Feb  4 23:40:41 EST 2002
    copyright            : (C) 2002 by Scott Wheeler
6
    email                : wheeler@kde.org
7
***************************************************************************/
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef JUK_H
#define JUK_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <kapp.h>
#include <kaction.h>
#include <kstdaction.h>
#include <kmainwindow.h>

#include <qtimer.h>
31
#include <qlistview.h>
32 33

#include "player.h"
34 35 36 37

class Playlist;
class PlaylistSplitter;
class PlaylistItem;
38
class SliderAction;
39 40 41

class JuK : public KMainWindow
{
42
    Q_OBJECT
43
public:
44
    JuK(QWidget* parent = 0, const char *name = 0);
45
    virtual ~JuK();
46

47 48 49
private:
    // private methods
    void setupLayout();
50
    void setupActions();
51
    void setupPlayer();
52
    void processArgs();
53 54
    void readConfig();
    void saveConfig();
55

56 57
    virtual bool queryClose();

58
    // layout objects
59
    PlaylistSplitter *splitter;
60

61
    // actions
62
    KToggleAction *showEditorAction;
63
    SliderAction *sliderAction;
64
    KToggleAction *randomPlayAction;
65 66 67
    KAction *playAction;
    KAction *pauseAction;
    KAction *stopAction;
68

69 70 71 72 73
    KAction *savePlaylistAction;
    KAction *saveAsPlaylistAction;
    KAction *renamePlaylistAction;
    KAction *deleteItemPlaylistAction;

74 75
    QTimer *playTimer;
    Player player;
76
    PlaylistItem *playingItem;
77 78
    bool trackPositionDragging;
    bool noSeek;
79

80
    static const int pollInterval = 800;
81

82
private slots:
83 84
    void playlistChanged(Playlist *list);

85
    // file menu
86
    void remove();
87 88
    void quit();

89 90 91 92
    // edit menu
    void cut();
    void copy() {};
    void paste() {};
93

94
    // player menu
95 96 97 98 99 100 101 102 103 104 105
    void playFile();
    void pauseFile();
    void stopFile();

    // additional player slots
    void trackPositionSliderClick();
    void trackPositionSliderRelease();
    void trackPositionSliderUpdate(int position);
    void pollPlay();
    void setVolume(int volume);
    void playItem(QListViewItem *item);
106
    void playItem(PlaylistItem *item);
107 108 109
};

#endif