Warning: That file was not part of the compilation database. It may have many parsing errors.

1/*
2 Copyright (C) 2010 Jean-Baptiste Kempf <jb@videolan.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) version 3, or any
8 later version accepted by the membership of KDE e.V. (or its
9 successor approved by the membership of KDE e.V.), Nokia Corporation
10 (or its successors, if any) and the KDE Free Qt Foundation, which shall
11 act as a proxy defined in Section 6 of version 3 of the license.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include "mainwindow.h"
23#include "mediacontroller.h"
24#include "videoeffects.h"
25
26#include <phonon/MediaObject>
27#include <phonon/MediaSource>
28#include <phonon/VideoWidget>
29
30#include <QContextMenuEvent>
31#include <QFileDialog>
32#include <QMenu>
33
34MainWindow::MainWindow(QWidget *parent) :
35 QMainWindow(parent)
36{
37 m_videoWidget = new Phonon::VideoWidget();
38 setCentralWidget(m_videoWidget);
39 m_mediaControl = new MediaController(this);
40 Phonon::createPath(m_mediaControl->mediaObject(), m_videoWidget);
41 resize(600, 400);
42}
43
44void MainWindow::contextMenuEvent(QContextMenuEvent *e)
45{
46 QMenu menu(tr("Control Menu"), this);
47 menu.addAction(tr("Open a file"), m_mediaControl, SLOT(openFile()));
48 menu.addAction(tr("Open a URL"), m_mediaControl, SLOT(openURL()));
49 menu.addSeparator();
50 menu.addAction(tr("Video Effects"), this, SLOT(effectsDialog()));
51 menu.exec(e->globalPos());
52}
53
54void MainWindow::effectsDialog()
55{
56 VideoEffects *effect = new VideoEffects(m_videoWidget, this);
57 effect->show();
58}
59

Warning: That file was not part of the compilation database. It may have many parsing errors.