diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch) | |
tree | 9047cf9e6b5c43878d5bf82660adae77ceee097a /noatun/modules/simple | |
download | tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/simple')
-rw-r--r-- | noatun/modules/simple/Makefile.am | 16 | ||||
-rw-r--r-- | noatun/modules/simple/back.xpm | 21 | ||||
-rw-r--r-- | noatun/modules/simple/forward.xpm | 21 | ||||
-rw-r--r-- | noatun/modules/simple/noatunui.cpp | 17 | ||||
-rw-r--r-- | noatun/modules/simple/pause.xpm | 21 | ||||
-rw-r--r-- | noatun/modules/simple/play.xpm | 21 | ||||
-rw-r--r-- | noatun/modules/simple/playlist.xpm | 21 | ||||
-rw-r--r-- | noatun/modules/simple/propertiesdialog.ui | 348 | ||||
-rw-r--r-- | noatun/modules/simple/propertiesdialog.ui.h | 58 | ||||
-rw-r--r-- | noatun/modules/simple/simple.plugin | 126 | ||||
-rw-r--r-- | noatun/modules/simple/simpleui.rc | 37 | ||||
-rw-r--r-- | noatun/modules/simple/stop.xpm | 21 | ||||
-rw-r--r-- | noatun/modules/simple/userinterface.cpp | 379 | ||||
-rw-r--r-- | noatun/modules/simple/userinterface.h | 80 | ||||
-rw-r--r-- | noatun/modules/simple/volume.xpm | 21 |
15 files changed, 1208 insertions, 0 deletions
diff --git a/noatun/modules/simple/Makefile.am b/noatun/modules/simple/Makefile.am new file mode 100644 index 00000000..de5a7aa8 --- /dev/null +++ b/noatun/modules/simple/Makefile.am @@ -0,0 +1,16 @@ +INCLUDES= -I$(top_srcdir)/noatun/library -I$(kde_includes)/arts $(all_includes) + +kde_module_LTLIBRARIES = noatunsimple.la + +noatunsimple_la_SOURCES = propertiesdialog.ui noatunui.cpp userinterface.cpp +noatunsimple_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +noatunsimple_la_LIBADD = $(top_builddir)/noatun/library/libnoatun.la \ + $(top_builddir)/noatun/library/libnoatuncontrols.la \ + -lkmedia2_idl -lsoundserver_idl -lartskde + +noatunsimple_la_METASOURCES = AUTO + +noinst_HEADERS = propertiesdialog.h userinterface.h + +noatun_modules_simple_DATA = simple.plugin simpleui.rc +noatun_modules_simpledir = $(kde_datadir)/noatun diff --git a/noatun/modules/simple/back.xpm b/noatun/modules/simple/back.xpm new file mode 100644 index 00000000..bd433e5e --- /dev/null +++ b/noatun/modules/simple/back.xpm @@ -0,0 +1,21 @@ +/* XPM */ +const char * back_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" .... .. ", +" .... ... ", +" .... .... ", +" .... ..... ", +" .... ...... ", +" .... ...... ", +" .... ..... ", +" .... .... ", +" .... ... ", +" .... .. ", +" ", +" ", +" "}; diff --git a/noatun/modules/simple/forward.xpm b/noatun/modules/simple/forward.xpm new file mode 100644 index 00000000..c4e95ccc --- /dev/null +++ b/noatun/modules/simple/forward.xpm @@ -0,0 +1,21 @@ +/* XPM */ +const char * forward_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" .. .... ", +" ... .... ", +" .... .... ", +" ..... .... ", +" ...... .... ", +" ...... .... ", +" ..... .... ", +" .... .... ", +" ... .... ", +" .. .... ", +" ", +" ", +" "}; diff --git a/noatun/modules/simple/noatunui.cpp b/noatun/modules/simple/noatunui.cpp new file mode 100644 index 00000000..3b647e42 --- /dev/null +++ b/noatun/modules/simple/noatunui.cpp @@ -0,0 +1,17 @@ +/* + This file is part of KDE/aRts (Noatun) - xine integration + Copyright (C) 2002 Ewald Snel <ewald@rambo.its.tudelft.nl> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. +*/ + +#include "userinterface.h" + + +extern "C" +{ + KDE_EXPORT Plugin *create_plugin() { return new SimpleUI(); } +} diff --git a/noatun/modules/simple/pause.xpm b/noatun/modules/simple/pause.xpm new file mode 100644 index 00000000..48d37568 --- /dev/null +++ b/noatun/modules/simple/pause.xpm @@ -0,0 +1,21 @@ +/* XPM */ +const char * pause_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" ", +" ", +" "}; diff --git a/noatun/modules/simple/play.xpm b/noatun/modules/simple/play.xpm new file mode 100644 index 00000000..7cb55a88 --- /dev/null +++ b/noatun/modules/simple/play.xpm @@ -0,0 +1,21 @@ +/* XPM */ +const char * play_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" .. ", +" ... ", +" .... ", +" ..... ", +" ...... ", +" ...... ", +" ..... ", +" .... ", +" ... ", +" .. ", +" ", +" ", +" "}; diff --git a/noatun/modules/simple/playlist.xpm b/noatun/modules/simple/playlist.xpm new file mode 100644 index 00000000..80b622ac --- /dev/null +++ b/noatun/modules/simple/playlist.xpm @@ -0,0 +1,21 @@ +/* XPM */ +const char * playlist_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" .. ", +" .... ", +" ...... ", +" ........ ", +" .......... ", +" .......... ", +" ", +" ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" ", +" "}; diff --git a/noatun/modules/simple/propertiesdialog.ui b/noatun/modules/simple/propertiesdialog.ui new file mode 100644 index 00000000..08f4f71c --- /dev/null +++ b/noatun/modules/simple/propertiesdialog.ui @@ -0,0 +1,348 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>PropertiesDialog</class> +<author>Ewald Snel</author> +<widget class="QDialog"> + <property name="name"> + <cstring>PropertiesDialog</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>320</width> + <height>261</height> + </rect> + </property> + <property name="caption"> + <string>Properties</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QTabWidget"> + <property name="name"> + <cstring>TabWidget2</cstring> + </property> + <widget class="QWidget"> + <property name="name"> + <cstring>details</cstring> + </property> + <attribute name="title"> + <string>&Details</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>16</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLineEdit" row="0" column="2"> + <property name="name"> + <cstring>nameField</cstring> + </property> + <property name="minimumSize"> + <size> + <width>180</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string></string> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + </widget> + <widget class="Line" row="1" column="0" rowspan="1" colspan="3"> + <property name="name"> + <cstring>Line1</cstring> + </property> + <property name="frameShape" stdset="0"> + <enum>HLine</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>iconLabel</cstring> + </property> + <property name="alignment"> + <set>AlignVCenter|AlignLeft</set> + </property> + </widget> + <widget class="QLabel" row="2" column="2"> + <property name="name"> + <cstring>typeLabel</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + <spacer row="7" column="2"> + <property name="name" stdset="0"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="Line" row="6" column="0" rowspan="1" colspan="3"> + <property name="name"> + <cstring>Line1_2</cstring> + </property> + <property name="frameShape" stdset="0"> + <enum>HLine</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>TextLabel7_2</cstring> + </property> + <property name="text"> + <string>Type:</string> + </property> + </widget> + <widget class="QLabel" row="2" column="1" rowspan="4" colspan="1"> + <property name="name"> + <cstring>TextLabel2_2</cstring> + </property> + <property name="minimumSize"> + <size> + <width>25</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>25</width> + <height>32767</height> + </size> + </property> + </widget> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>TextLabel5</cstring> + </property> + <property name="text"> + <string>Length:</string> + </property> + </widget> + <widget class="QLabel" row="3" column="2"> + <property name="name"> + <cstring>lengthLabel</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + <widget class="QLabel" row="4" column="0"> + <property name="name"> + <cstring>TextLabel6</cstring> + </property> + <property name="text"> + <string>Audio:</string> + </property> + </widget> + <widget class="QLabel" row="4" column="2"> + <property name="name"> + <cstring>audioLabel</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + <widget class="QLabel" row="5" column="0"> + <property name="name"> + <cstring>TextLabel7</cstring> + </property> + <property name="text"> + <string>Video:</string> + </property> + </widget> + <widget class="QLabel" row="5" column="2"> + <property name="name"> + <cstring>videoLabel</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </grid> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>playobject</cstring> + </property> + <attribute name="title"> + <string>&PlayObject</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>16</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>80</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>Description:</string> + </property> + </widget> + <widget class="QLabel" row="0" column="1"> + <property name="name"> + <cstring>descriptionLabel</cstring> + </property> + </widget> + <widget class="QListView" row="1" column="0" rowspan="1" colspan="2"> + <column> + <property name="text"> + <string>Capabilities</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>capsList</cstring> + </property> + </widget> + </grid> + </widget> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>buttonLayout</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name" stdset="0"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>okButton</cstring> + </property> + <property name="text"> + <string>&OK</string> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + </hbox> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>okButton</sender> + <signal>clicked()</signal> + <receiver>PropertiesDialog</receiver> + <slot>accept()</slot> + </connection> +</connections> +<includes> + <include location="global" impldecl="in declaration">noatun/playlist.h</include> + <include location="global" impldecl="in declaration">kmedia2.h</include> + <include location="global" impldecl="in declaration">kmimetype.h</include> + <include location="local" impldecl="in implementation">propertiesdialog.ui.h</include> +</includes> +<slots> + <slot specifier="non virtual">setPlayObject( PlaylistItem pi, Arts::PlayObject po )</slot> +</slots> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/noatun/modules/simple/propertiesdialog.ui.h b/noatun/modules/simple/propertiesdialog.ui.h new file mode 100644 index 00000000..a712d776 --- /dev/null +++ b/noatun/modules/simple/propertiesdialog.ui.h @@ -0,0 +1,58 @@ +/* + This file is part of KDE/aRts (Noatun) - xine integration + Copyright (C) 2002 Ewald Snel <ewald@rambo.its.tudelft.nl> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. +*/ + +#include <klocale.h> + +void PropertiesDialog::setPlayObject( PlaylistItem pi, Arts::PlayObject po ) +{ + // Arts::PlayObject properties + if (!po.isNull()) + { + Arts::poCapabilities ncaps = po.capabilities(); + QCheckListItem *item; + + descriptionLabel->setText( po.description().c_str() ); + + // Determine capabilities + if (!(item = (QCheckListItem *)capsList->findItem( "capSeek", 0 ))) + { + item = new QCheckListItem( capsList, "capSeek", + QCheckListItem::CheckBox ); + } + item->setOn( (ncaps & Arts::capSeek) ); + + if (!(item = (QCheckListItem *)capsList->findItem( "capPause", 0 ))) + { + item = new QCheckListItem( capsList, "capPause", + QCheckListItem::CheckBox ); + } + item->setOn( (ncaps & Arts::capPause) ); + + // Defaults + nameField->setText( i18n("unknown") ); + typeLabel->setText( i18n("unknown") ); + lengthLabel->setText( i18n("unknown") ); + audioLabel->setText( i18n("unknown") ); + videoLabel->setText( i18n("unknown") ); + } + + // PlaylistItem properties (name and mimetype) + if (!pi.isNull()) + { + setCaption( i18n("Properties for %1").arg(pi.url().fileName()) ); + + KSharedPtr<KMimeType> mime = KMimeType::mimeType( pi.mimetype() ); + iconLabel->setPixmap( mime->pixmap( KIcon::Desktop, KIcon::SizeMedium ) ); + + nameField->setText( pi.url().fileName() ); + typeLabel->setText( pi.mimetype() ); + lengthLabel->setText( pi.lengthString() ); + } +} diff --git a/noatun/modules/simple/simple.plugin b/noatun/modules/simple/simple.plugin new file mode 100644 index 00000000..9d7e4beb --- /dev/null +++ b/noatun/modules/simple/simple.plugin @@ -0,0 +1,126 @@ +Filename=noatunsimple.la +Author=Ewald Snel +Site=http://rambo.its.tudelft.nl/xine/ +Email=ewald@rambo.its.tudelft.nl +Type=userinterface +License=LGPL +Name=Simple +Name[af]=Eenvoudige +Name[ar]=بسيط +Name[az]=Bəsit +Name[bn]=সরল +Name[br]=Eeun +Name[bs]=Jednostavno +Name[ca]=Senzill +Name[cs]=Jednoduchý +Name[cy]=Syml +Name[da]=Simpel +Name[de]=Einfach +Name[el]=Απλό +Name[eo]=Simpla +Name[et]=Lihtne +Name[eu]=Sinplea +Name[fa]=ساده +Name[fi]=Yksinkertainen +Name[ga]=Simplí +Name[he]=פשוט +Name[hi]=साधारण +Name[hr]=Jednostavno +Name[hu]=Egyszerű +Name[id]=Sederhana +Name[is]=Einfalt +Name[it]=Semplice +Name[km]=សាមញ្ញ +Name[ko]=간단 +Name[lt]=Paprastas +Name[lv]=Vienkāršs +Name[mk]=Едноставен +Name[mt]=Sempliċi +Name[nb]=Enkel +Name[nds]=Eenfach +Name[ne]=साधारण +Name[nl]=Eenvoudig +Name[nn]=Enkel +Name[pa]=ਸਧਾਰਨ +Name[pl]=Prosty +Name[pt]=Simples +Name[pt_BR]=Simples +Name[ro]=Simplu +Name[ru]=Простой +Name[se]=Oktageardanis +Name[sk]=Jednoduchý +Name[sl]=Preprosto +Name[sr]=Једноставан +Name[sr@Latn]=Jednostavan +Name[sv]=Enkel +Name[ta]=எளிய +Name[tg]=Содда +Name[th]=เรียบง่าย +Name[tr]=Basit +Name[uk]=Простий +Name[uz]=Oddiy +Name[uz@cyrillic]=Оддий +Name[ven]=Zwoleluwa +Name[wa]=Simpe +Name[xh]=Lula +Name[zh_CN]=简单 +Name[zh_HK]=簡單 +Name[zh_TW]=簡單 +Name[zu]=Okulula +Comment=Simple GUI (embedded video) +Comment[af]=Eenvoudige Gui (ingebedde video) +Comment[bg]=Семпъл графичен интерфейс за Noatun +Comment[bs]=Jednostavan GUI (uključen video) +Comment[ca]=IGU senzill (vídeo incrustat) +Comment[cs]=Jednoduché GUI (vnořené video) +Comment[cy]=GUI Syml (fideo mewnol) +Comment[da]=Simpel GUI (indlejret video) +Comment[de]=Einfache Oberfläche (eingebettetes Video) +Comment[el]=Απλό περιβάλλον χρήσης (ενσωματωμένο βίντεο) +Comment[es]=Interfaz gráfica simple (vídeo empotrado) +Comment[et]=Lihtne kasutajaliides (põimitud video) +Comment[eu]=GUI sinplea (bideo kapsulatua) +Comment[fa]=ونک ساده )ویدیوی نهفته( +Comment[fi]=Yksinkertainen käyttöliittymä (upotettu video) +Comment[fr]=Interface graphique simple (video incorporée) +Comment[ga]=Comhéadan simplí (fís leabaithe) +Comment[gl]=GUI Sinxela (video incrustado) +Comment[he]=ממשק משתמש גרפי פשוט (וידאו מוטבע) +Comment[hi]=साधारण जीयूआई (एम्बेडेड वीडियो) +Comment[hu]=Egyszerű kezelőfelület (beágyazott videó) +Comment[is]=Einföld myndræn skil (innbyggt) +Comment[it]=Semplice GUI (video integrato) +Comment[ja]=シンプルな GUI (埋め込みビデオ) +Comment[kk]=Қарапайым инерфейсі (ендірілген бейне) +Comment[km]=ចំណុចប្រទាក់ក្រាហ្វិកសាមញ្ញ (វីដេអូបង្កប់) +Comment[ko]=간단한 GUI (내장된 비디오) +Comment[lt]=Paprastas GUI (įdedamas video) +Comment[mk]=Едноставен графички интерфејс (вградено видео) +Comment[ms]=GUI Ringkas (video diselitkan) +Comment[nb]=Enkel GUI (innebygget video) +Comment[nds]=Eenfach Böversiet (inbett Video) +Comment[ne]=साधारण GUI (सम्मिलित भिडियो) +Comment[nl]=Eenvoudige GUI (inbedbare video) +Comment[nn]=Enkelt grensesnitt (innebygd video) +Comment[pa]=ਸਧਾਰਨ GUI (ਸ਼ਾਮਲ ਵੀਡਿਓ) +Comment[pl]=Zwykły motyw (osadzone wideo) +Comment[pt]=Interface Simples (vídeo embebido) +Comment[pt_BR]=Interface Simples (vídeo integrado) +Comment[ro]=Interfaţă grafică simplă (video integrat) +Comment[ru]=Простой интерфейс (встроенное видео) +Comment[se]=Oktageardánis lakta (vuojuhuvvon video) +Comment[sk]=Jednoduché rozhranie (vložené video) +Comment[sl]=Preprost uporabniški vmesnik (vključen video) +Comment[sr]=Једноставан GUI (уграђен видео) +Comment[sr@Latn]=Jednostavan GUI (ugrađen video) +Comment[sv]=Enkelt grafiskt gränssnitt (inbäddad video) +Comment[ta]=எளிய GUI (உட்பொதிந்த தாரை) +Comment[tg]=Интерфейси Графикии содда (видеои дарунгузошта) +Comment[th]=ส่วนติดต่อผู้ใช้แบบกราฟิกแบบเรียบง่าย (วิดีโอแบบฝัง) +Comment[tr]=Basit arayüz (gömülü video) +Comment[uk]=Простий інтерфейс (вмонтоване відео) +Comment[xh]=GUI Elula (video ebekiweyo) +Comment[zh_CN]=简单图形用户界面 (嵌入式视频) +Comment[zh_HK]=簡單圖形用戶(嵌入式視訊) +Comment[zh_TW]=簡單圖形使用者界面(嵌入式視訊) +Comment[zu]=I-GUI Elula (ividiyo ehlanganiselwe) diff --git a/noatun/modules/simple/simpleui.rc b/noatun/modules/simple/simpleui.rc new file mode 100644 index 00000000..6e5fb86a --- /dev/null +++ b/noatun/modules/simple/simpleui.rc @@ -0,0 +1,37 @@ +<!DOCTYPE kpartgui> +<!-- +vim: syntax=xml +--> +<kpartgui name="simpleui" version="1"> +<MenuBar> + <Menu name="file"><text>&File</text> + <Action name="_file_open"/> + <Separator lineSeparator="true"/> + <Action name="_file_properties"/> + <Separator lineSeparator="true"/> + <Action name="_file_quit"/> + </Menu> + <Menu name="view"> + <Action name="view_playlist"/> + <Separator lineSeparator="true"/> + <Action name="half_size" /> + <Action name="normal_size" /> + <Action name="double_size" /> + <Separator lineSeparator="true"/> + <Action name="fullscreen_mode" /> + </Menu> + <Menu name="settings" noMerge="1"><text>&Settings</text> + <Action name="options_show_menubar"/> + <Action name="options_show_statusbar"/> + <Separator lineSeparator="true"/> + <Action name="effects"/> + <Action name="equalizer"/> + <Action name="loop_style"/> + <Separator lineSeparator="true"/> + <Action name="options_configure"/> + </Menu> + + <Action name="menu_actions" /> +</MenuBar> + +</kpartgui> diff --git a/noatun/modules/simple/stop.xpm b/noatun/modules/simple/stop.xpm new file mode 100644 index 00000000..6b080e94 --- /dev/null +++ b/noatun/modules/simple/stop.xpm @@ -0,0 +1,21 @@ +/* XPM */ +const char * stop_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" .......... ", +" ", +" ", +" "}; diff --git a/noatun/modules/simple/userinterface.cpp b/noatun/modules/simple/userinterface.cpp new file mode 100644 index 00000000..6e7b486f --- /dev/null +++ b/noatun/modules/simple/userinterface.cpp @@ -0,0 +1,379 @@ +/* + This file is part of KDE/aRts (Noatun) - xine integration + Copyright (C) 2002 Ewald Snel <ewald@rambo.its.tudelft.nl> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. +*/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <noatun/app.h> +#include <noatun/engine.h> +#include <noatun/player.h> +#include <noatun/stdaction.h> + +#include <kconfig.h> +#include <kglobal.h> +#include <kglobalsettings.h> +#include <kiconloader.h> +#include <klocale.h> +#include <kurldrag.h> +#include <kmenubar.h> +#include <kpopupmenu.h> +#include <kstatusbar.h> +#include <kstdaction.h> +#include <kstdguiitem.h> +#include <kurl.h> + +#include <qaccel.h> +#include <qdragobject.h> +#include <qhbox.h> +#include <qimage.h> +#include <qpixmap.h> +#include <qstrlist.h> +#include <qtooltip.h> +#include <qvbox.h> + +#include "userinterface.h" + +#include "back.xpm" +#include "forward.xpm" +#include "pause.xpm" +#include "play.xpm" +#include "playlist.xpm" +#include "stop.xpm" +#include "volume.xpm" + +SimpleUI::SimpleUI() + : KMainWindow(0, "NoatunSimpleUI"), UserInterface() +{ + setAcceptDrops( true ); + setCaption( i18n("Noatun") ); + setIcon( SmallIcon( "noatun" ) ); + + setupCentralWidget(); + setupActions(); + + contextMenu = video->popupMenu( this ); + + setupGUI( StatusBar|Create, "simpleui.rc" ); + + connect( napp->player(), SIGNAL(playing()), SLOT(slotPlaying()) ); + connect( napp->player(), SIGNAL(stopped()), SLOT(slotStopped()) ); + connect( napp->player(), SIGNAL(paused()), SLOT(slotPaused()) ); + connect( napp->player(), SIGNAL(timeout()), SLOT(slotTimeout()) ); + connect( napp->player(), SIGNAL(newSong()), SLOT(slotChanged()) ); + connect( napp->player(), SIGNAL(volumeChanged(int)), SLOT(slotVolumeChanged(int)) ); + connect( napp, SIGNAL(hideYourself()), SLOT(hide()) ); + connect( napp, SIGNAL(showYourself()), SLOT(show()) ); + + napp->player()->handleButtons(); + + resize( minimumSize() ); + + // Show UI and calculate video widget frame + show(); + + extra_width = (width() - video->width()); + extra_height = (height() - video->height()); + + // Load configuration + KConfig &config = *KGlobal::config(); + config.setGroup( "Simple" ); + QString str = config.readEntry( "View", "NormalSize" ); + + if (str == "HalfSize") + video->setHalfSize(); + else if (str == "NormalSize") + video->setNormalSize(); + else if (str == "DoubleSize") + video->setDoubleSize(); + else + applyMainWindowSettings( &config, "Simple" ); + + // PlayObject could be running, update video widget + slotChanged(); + + video->give(); +} + +SimpleUI::~SimpleUI() +{ + KConfig &config = *KGlobal::config(); + saveMainWindowSettings( &config, "Simple" ); + config.setGroup( "Simple" ); + QString str; + + if (video->isHalfSize()) + str = "HalfSize"; + else if (video->isNormalSize()) + str = "NormalSize"; + else if (video->isDoubleSize()) + str = "DoubleSize"; + else + str = "CustomSize"; + + config.writeEntry( "View", str ); + config.sync(); +} + + + +void SimpleUI::setupActions() +{ + KStdAction::open( napp, SLOT(fileOpen()), actionCollection(), "_file_open" ); + new KAction( i18n("&Properties"), 0, propertiesDialog, SLOT(show()), + actionCollection(), "_file_properties" ); + KStdAction::quit( napp, SLOT(quit()), actionCollection(), "_file_quit"); + + NoatunStdAction::playlist( actionCollection(), "view_playlist" ); + actionCollection()->insert(video->action( "half_size" )); + actionCollection()->insert(video->action( "normal_size" )); + actionCollection()->insert(video->action( "double_size" )); + actionCollection()->insert(video->action( "fullscreen_mode" )); + + actionCollection()->insert(napp->pluginActionMenu()); + + menubarAction = KStdAction::showMenubar(this, SLOT(showMenubar()), + actionCollection()); + statusbarAction = KStdAction::showStatusbar(this, SLOT(showStatusbar()), + actionCollection()); + NoatunStdAction::effects( actionCollection(), "effects" ); + NoatunStdAction::equalizer( actionCollection(), "equalizer" ); + NoatunStdAction::loop( actionCollection(), "loop_style" ); + KStdAction::preferences( napp, SLOT(preferences()), actionCollection() ); +} + +void SimpleUI::showMenubar() +{ + if(menubarAction->isChecked()) + menuBar()->show(); + else + menuBar()->hide(); +} + +void SimpleUI::showStatusbar() +{ + if(statusbarAction->isChecked()) + statusBar()->show(); + else + statusBar()->hide(); +} + + +void SimpleUI::setupCentralWidget() +{ + QVBox *npWidget = new QVBox( this ); + npWidget->setMargin( 0 ); + npWidget->setSpacing( 0 ); + + positionLabel = new QLabel( statusBar() ); + positionLabel->setAlignment( AlignVCenter | AlignCenter ); + positionLabel->setFixedSize( fontMetrics().size( 0, " 00:00/00:00 " ) ); + statusBar()->addWidget( positionLabel, 0, true ); + + video = new VideoFrame( npWidget ); + connect( video, SIGNAL(adaptSize(int,int)), + SLOT(slotAdaptSize(int,int)) ); + connect( video, SIGNAL(rightButtonPressed(const QPoint &)), + SLOT(slotContextMenu(const QPoint &)) ); + + QHBox *ctlFrame = new QHBox( npWidget ); + ctlFrame->setFixedHeight( 38 ); + ctlFrame->setFrameShape( QFrame::StyledPanel ); + ctlFrame->setFrameShadow( QFrame::Raised ); + ctlFrame->setMargin( 6 ); + ctlFrame->setSpacing( 6 ); + + QPushButton *backButton = new QPushButton( ctlFrame ); + backButton->setFixedSize( 24, 24 ); + backButton->setPixmap( QPixmap( back_xpm ) ); + QToolTip::add( backButton, i18n("Back") ); + connect( backButton, SIGNAL(clicked()), napp->player(), SLOT(back()) ); + + stopButton = new QPushButton( ctlFrame ); + stopButton->setFixedSize( 24, 24 ); + stopButton->setPixmap( QPixmap( stop_xpm ) ); + QToolTip::add( stopButton, i18n("Stop") ); + connect( stopButton, SIGNAL(clicked()), napp->player(), SLOT(stop()) ); + + playButton = new QPushButton( ctlFrame ); + playButton->setFixedSize( 24, 24 ); + playButton->setPixmap( QPixmap( play_xpm ) ); + QToolTip::add( playButton, i18n("Play / Pause") ); + connect( playButton, SIGNAL(clicked()), napp->player(), SLOT(playpause()) ); + + QPushButton *forwButton = new QPushButton( ctlFrame ); + forwButton->setFixedSize( 24, 24 ); + forwButton->setPixmap( QPixmap( forward_xpm ) ); + QToolTip::add( forwButton, i18n("Forward") ); + connect( forwButton, SIGNAL(clicked()), napp->player(), SLOT(forward()) ); + + slider = new L33tSlider( 0, 1000, 10, 0, L33tSlider::Horizontal, ctlFrame ); + slider->setFixedHeight( 24 ); + slider->setMinimumWidth( 100 ); + slider->setTickmarks( QSlider::NoMarks ); + connect( slider, SIGNAL(userChanged(int)), SLOT(slotSkipTo(int)) ); + connect( slider, SIGNAL(sliderMoved(int)), SLOT(slotSliderMoved(int)) ); + + QPushButton *playlistButton = new QPushButton( ctlFrame ); + playlistButton->setFixedSize( 24, 24 ); + playlistButton->setPixmap( QPixmap( playlist_xpm ) ); + QToolTip::add( playlistButton, i18n("Playlist") ); + connect( playlistButton, SIGNAL(clicked()), napp->player(), SLOT(toggleListView()) ); + + volumeButton = new QPushButton( ctlFrame ); + volumeButton->setFixedSize( 24, 24 ); + volumeButton->setPixmap( QPixmap( volume_xpm ) ); + QToolTip::add( volumeButton, i18n("Volume") ); + + volumeFrame = new QVBox( this, "Volume", WStyle_Customize | WType_Popup ); + volumeFrame->setFrameStyle( QFrame::PopupPanel ); + volumeFrame->setMargin( 4 ); + + volumeLabel = new QLabel( volumeFrame ); + volumeLabel->setText( "100%" ); + volumeLabel->setAlignment( AlignCenter ); + volumeLabel->setFixedSize( volumeLabel->sizeHint() ); + + QHBox *volumeSubFrame = new QHBox( volumeFrame ); + volumeSlider = new L33tSlider( 0, 100, 10, 0, Vertical, volumeSubFrame ); + volumeSlider->setValue( 100 - napp->player()->volume() ); + volumeSlider->setFixedSize( volumeSlider->sizeHint() ); + + volumeFrame->resize( volumeFrame->sizeHint() ); + + connect( volumeSlider, SIGNAL(sliderMoved(int)), SLOT(slotVolumeSliderMoved(int)) ); + connect( volumeSlider, SIGNAL(userChanged(int)), SLOT(slotVolumeSliderMoved(int)) ); + connect( volumeButton, SIGNAL(clicked()), SLOT(slotVolumeFrame()) ); + + setCentralWidget( npWidget ); + + video->setMinimumSize( minimumSizeHint().width(), 1 ); + + // Create properties dialog + propertiesDialog = new PropertiesDialog( this ); + propertiesDialog->resize( 375, 285 ); +} + +void SimpleUI::closeEvent( QCloseEvent * ) +{ + unload(); +} + +void SimpleUI::dragEnterEvent( QDragEnterEvent *event ) +{ + event->accept( KURLDrag::canDecode( event ) ); +} + +void SimpleUI::dropEvent( QDropEvent *event ) +{ + KURL::List uri; + if (KURLDrag::decode( event, uri )) + napp->player()->openFile( uri, false ); +} + +void SimpleUI::slotAdaptSize( int width, int height ) +{ + resize( width + extra_width, height + extra_height ); +} + +void SimpleUI::slotPlaying() +{ + playButton->setPixmap( QPixmap( pause_xpm ) ); + stopButton->setEnabled( true ); + slider->setEnabled( true ); + + if (napp->player()->current()) + statusBar()->message( napp->player()->current().title() ); +} + +void SimpleUI::slotStopped() +{ + playButton->setPixmap( QPixmap( play_xpm ) ); + stopButton->setEnabled( false ); + slider->setEnabled( false ); + slider->setValue( 0 ); + positionLabel->setText( "" ); + statusBar()->message( "" ); +} + +void SimpleUI::slotPaused() +{ + playButton->setPixmap( QPixmap( play_xpm ) ); + slider->setEnabled( true ); +} + +void SimpleUI::slotTimeout() +{ + if (napp->player()->current() && !slider->currentlyPressed()) + { + positionLabel->setText( napp->player()->lengthString() ); + slider->setRange( 0, (int)napp->player()->getLength() / 1000 ); + slider->setValue( (int)napp->player()->getTime() / 1000 ); + } +} + +void SimpleUI::slotSkipTo( int sec ) +{ + napp->player()->skipTo( sec * 1000 ); +} + +void SimpleUI::slotChanged() +{ + propertiesDialog->setPlayObject( napp->player()->current(), + napp->player()->engine()->playObject() ); +} + +void SimpleUI::slotContextMenu( const QPoint &pos ) +{ + contextMenu->exec( pos ); +} + +void SimpleUI::slotSliderMoved( int sec ) +{ + if (napp->player()->current()) + positionLabel->setText( napp->player()->lengthString( sec * 1000 ) ); +} + +void SimpleUI::slotVolumeChanged( int volume ) +{ + volumeLabel->setText( QString::number( volume ) + "%" ); + volumeSlider->setValue( 100 - volume ); +} + +void SimpleUI::slotVolumeFrame() +{ + if (volumeFrame->isVisible()) + { + volumeFrame->hide(); + } + else + { + int x = (volumeButton->width() - volumeFrame->width()) / 2; + int y = -(volumeFrame->height() + 5); + + QPoint point( volumeButton->mapToGlobal( QPoint( x, y ) ) ); + QRect deskRect = KGlobalSettings::desktopGeometry( point ); + + bool bottom = (point.y() + volumeFrame->height()) > (deskRect.y() + deskRect.height()); + bool right = (point.x() + volumeFrame->width()) > (deskRect.x() + deskRect.width()); + + volumeFrame->move( + right ? (deskRect.x() + deskRect.width()) - volumeFrame->width() : ( point.x() < 0 ? 0 : point.x() ), + bottom ? (deskRect.y() + deskRect.height()) - volumeFrame->height() : ( point.y() < 0 ? 0 : point.y() ) ); + volumeFrame->show(); + } +} + +void SimpleUI::slotVolumeSliderMoved( int slider ) +{ + napp->player()->setVolume( 100 - slider ); +} + +#include "userinterface.moc" diff --git a/noatun/modules/simple/userinterface.h b/noatun/modules/simple/userinterface.h new file mode 100644 index 00000000..c545fd2c --- /dev/null +++ b/noatun/modules/simple/userinterface.h @@ -0,0 +1,80 @@ +/* + This file is part of KDE/aRts (Noatun) - xine integration + Copyright (C) 2002 Ewald Snel <ewald@rambo.its.tudelft.nl> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. +*/ + +#ifndef __USERINTERFACE_H +#define __USERINTERFACE_H + +#include <noatun/controls.h> +#include <noatun/plugin.h> +#include <noatun/video.h> +#include <kaction.h> +#include <kmainwindow.h> +#include <kmedia2.h> +#include <qevent.h> +#include <qlabel.h> +#include <qpopupmenu.h> +#include <qpushbutton.h> +#include <qvbox.h> +#include "propertiesdialog.h" + + +class SimpleUI : public KMainWindow, public UserInterface +{ + Q_OBJECT + +public: + SimpleUI(); + ~SimpleUI(); + +protected: + void setupActions(); + void setupCentralWidget(); + + virtual void closeEvent( QCloseEvent * ); + virtual void dragEnterEvent( QDragEnterEvent *event ); + virtual void dropEvent( QDropEvent *event ); + +public slots: + void slotAdaptSize( int width, int height ); + void slotPlaying(); + void slotStopped(); + void slotPaused(); + void slotTimeout(); + void slotSkipTo( int sec ); + void slotChanged(); + void slotContextMenu( const QPoint &pos ); + +private slots: + void slotSliderMoved( int sec ); + void slotVolumeSliderMoved( int volume ); + void slotVolumeFrame(); + void slotVolumeChanged( int volume ); + void showMenubar(); + void showStatusbar(); + +private: + PropertiesDialog *propertiesDialog; + QPopupMenu *contextMenu; + QPushButton *stopButton; + QPushButton *playButton; + QPushButton *volumeButton; + QVBox *volumeFrame; + QLabel *volumeLabel; + QLabel *positionLabel; + VideoFrame *video; + L33tSlider *volumeSlider; + L33tSlider *slider; + int extra_width; + int extra_height; + KToggleAction *menubarAction; + KToggleAction *statusbarAction; +}; + +#endif diff --git a/noatun/modules/simple/volume.xpm b/noatun/modules/simple/volume.xpm new file mode 100644 index 00000000..fa240d42 --- /dev/null +++ b/noatun/modules/simple/volume.xpm @@ -0,0 +1,21 @@ +/* XPM */ +const char * volume_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" . .. ", +" .. . . ", +" .... . . ", +" .... . . ", +" .. .. . ", +" . ... . ", +" .... . ", +" ..... . ", +" ...... . ", +" ....... . ", +" ........ . ", +" ............ ", +" ", +" "}; |