From cb68a7857c80661d242ee5527ec6f99dc3f79fa7 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:43 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- README | 4 +- arts/builder/Makefile.am | 2 +- arts/gui/kde/Makefile.am | 4 +- arts/midi/artsmidi.idl | 2 +- doc/artsbuilder/apis.docbook | 4 +- doc/artsbuilder/faq.docbook | 6 +- doc/kmid/Makefile.am | 4 - doc/kmid/index.docbook | 1338 -------------------------- doc/tdemid/Makefile.am | 4 + doc/tdemid/index.docbook | 1338 ++++++++++++++++++++++++++ juk/Makefile.am | 4 +- kaboodle/Makefile.am | 10 +- kaboodle/engine.h | 2 +- kaboodle/kaboodle_factory.h | 2 +- kaboodle/player.h | 4 +- kaboodle/userinterface.h | 2 +- kaboodle/view.h | 4 +- kaudiocreator/Makefile.am | 4 +- kfile-plugins/au/Makefile.am | 2 +- kfile-plugins/avi/Makefile.am | 2 +- kfile-plugins/flac/Makefile.am | 2 +- kfile-plugins/m3u/Makefile.am | 2 +- kfile-plugins/mp3/Makefile.am | 2 +- kfile-plugins/mpc/Makefile.am | 2 +- kfile-plugins/mpeg/Makefile.am | 2 +- kfile-plugins/ogg/Makefile.am | 2 +- kfile-plugins/sid/Makefile.am | 2 +- kfile-plugins/theora/Makefile.am | 2 +- kfile-plugins/wav/Makefile.am | 2 +- kmid/ChangeLog | 104 --- kmid/Makefile.am | 74 -- kmid/PEOPLE | 4 - kmid/README | 123 --- kmid/audiomidi.desktop | 3 - kmid/button1.xpm | 22 - kmid/button2.xpm | 22 - kmid/channel.cpp | 233 ----- kmid/channel.h | 105 --- kmid/channel3d.cpp | 149 --- kmid/channel3d.h | 52 -- kmid/channel4d.cpp | 232 ----- kmid/channel4d.h | 58 -- kmid/channelcfgdlg.cpp | 39 - kmid/channelcfgdlg.h | 52 -- kmid/channelview.cpp | 165 ---- kmid/channelview.h | 77 -- kmid/collectdlg.cpp | 307 ------ kmid/collectdlg.h | 84 -- kmid/configure.in.in | 5 - kmid/drums.o3 | Bin 7680 -> 0 bytes kmid/drums.sb | Bin 6656 -> 0 bytes kmid/examples/DiesIrae.kar | Bin 45515 -> 0 bytes kmid/examples/Guantanamera.kar | Bin 37539 -> 0 bytes kmid/examples/Makefile.am | 6 - kmid/examples/MariaDeLasMercedes.kar | Bin 29440 -> 0 bytes kmid/examples/OFortuna.kar | Bin 51276 -> 0 bytes kmid/hi16-app-kmid.png | Bin 870 -> 0 bytes kmid/hi32-app-kmid.png | Bin 2425 -> 0 bytes kmid/hi48-app-kmid.png | Bin 4307 -> 0 bytes kmid/history.txt | 567 ----------- kmid/instrfilter.awk | 2 - kmid/instrname.cpp | 132 --- kmid/instrname.h | 6 - kmid/instrname.i18n | 133 --- kmid/kdisptext.cpp | 640 ------------- kmid/kdisptext.h | 126 --- kmid/keyboard.xpm | 50 - kmid/klcdnumber.cpp | 339 ------- kmid/klcdnumber.h | 154 --- kmid/kmid.desktop | 88 -- kmid/kmid.lsm | 14 - kmid/kmid.spec | 62 -- kmid/kmidIface.h | 46 - kmid/kmid_part.cpp | 144 --- kmid/kmid_part.h | 66 -- kmid/kmid_partui.rc | 17 - kmid/kmidbutton.h | 32 - kmid/kmidclient.cpp | 1606 -------------------------------- kmid/kmidclient.h | 241 ----- kmid/kmidframe.cpp | 728 --------------- kmid/kmidframe.h | 134 --- kmid/kmidui.rc | 44 - kmid/ktrianglebutton.cpp | 164 ---- kmid/ktrianglebutton.h | 74 -- kmid/main.cpp | 101 -- kmid/maps/Makefile.am | 5 - kmid/maps/YamahaPSR500.map | 293 ------ kmid/maps/YamahaPSS790.map | 299 ------ kmid/maps/YamahaQY10.map | 305 ------ kmid/maps/gm.map | 290 ------ kmid/midicfgdlg.cpp | 138 --- kmid/midicfgdlg.h | 61 -- kmid/pics/Makefile.am | 3 - kmid/pics/cr16-action-piano.png | Bin 248 -> 0 bytes kmid/pics/cr16-action-volume.png | Bin 180 -> 0 bytes kmid/pics/cr22-action-piano.png | Bin 272 -> 0 bytes kmid/pics/cr22-action-volume.png | Bin 377 -> 0 bytes kmid/pics/cr32-action-piano.png | Bin 361 -> 0 bytes kmid/pics/cr32-action-volume.png | Bin 447 -> 0 bytes kmid/qslidertime.cpp | 120 --- kmid/qslidertime.h | 57 -- kmid/randomlist.cpp | 103 -- kmid/randomlist.h | 34 - kmid/rhythmview.cpp | 108 --- kmid/rhythmview.h | 54 -- kmid/slman.cpp | 320 ------- kmid/slman.h | 74 -- kmid/songlist.cpp | 247 ----- kmid/songlist.h | 84 -- kmid/std.o3 | Bin 7680 -> 0 bytes kmid/std.sb | Bin 6656 -> 0 bytes kmid/version.h | 48 - kmid/x-karaoke.desktop | 61 -- krec/Makefile.am | 10 +- krec/krecglobal.cpp | 2 +- kscd/Makefile.am | 4 +- kscd/kscdmagic/Makefile.am | 2 +- noatun/Makefile.am | 2 +- tdemid/ChangeLog | 104 +++ tdemid/Makefile.am | 74 ++ tdemid/PEOPLE | 4 + tdemid/README | 123 +++ tdemid/audiomidi.desktop | 3 + tdemid/button1.xpm | 22 + tdemid/button2.xpm | 22 + tdemid/channel.cpp | 233 +++++ tdemid/channel.h | 105 +++ tdemid/channel3d.cpp | 149 +++ tdemid/channel3d.h | 52 ++ tdemid/channel4d.cpp | 232 +++++ tdemid/channel4d.h | 58 ++ tdemid/channelcfgdlg.cpp | 39 + tdemid/channelcfgdlg.h | 52 ++ tdemid/channelview.cpp | 165 ++++ tdemid/channelview.h | 77 ++ tdemid/collectdlg.cpp | 307 ++++++ tdemid/collectdlg.h | 84 ++ tdemid/configure.in.in | 5 + tdemid/drums.o3 | Bin 0 -> 7680 bytes tdemid/drums.sb | Bin 0 -> 6656 bytes tdemid/examples/DiesIrae.kar | Bin 0 -> 45515 bytes tdemid/examples/Guantanamera.kar | Bin 0 -> 37539 bytes tdemid/examples/Makefile.am | 6 + tdemid/examples/MariaDeLasMercedes.kar | Bin 0 -> 29440 bytes tdemid/examples/OFortuna.kar | Bin 0 -> 51276 bytes tdemid/hi16-app-tdemid.png | Bin 0 -> 870 bytes tdemid/hi32-app-tdemid.png | Bin 0 -> 2425 bytes tdemid/hi48-app-tdemid.png | Bin 0 -> 4307 bytes tdemid/history.txt | 567 +++++++++++ tdemid/instrfilter.awk | 2 + tdemid/instrname.cpp | 132 +++ tdemid/instrname.h | 6 + tdemid/instrname.i18n | 133 +++ tdemid/kdisptext.cpp | 640 +++++++++++++ tdemid/kdisptext.h | 126 +++ tdemid/keyboard.xpm | 50 + tdemid/klcdnumber.cpp | 339 +++++++ tdemid/klcdnumber.h | 154 +++ tdemid/ktrianglebutton.cpp | 164 ++++ tdemid/ktrianglebutton.h | 74 ++ tdemid/main.cpp | 101 ++ tdemid/maps/Makefile.am | 5 + tdemid/maps/YamahaPSR500.map | 293 ++++++ tdemid/maps/YamahaPSS790.map | 299 ++++++ tdemid/maps/YamahaQY10.map | 305 ++++++ tdemid/maps/gm.map | 290 ++++++ tdemid/midicfgdlg.cpp | 138 +++ tdemid/midicfgdlg.h | 61 ++ tdemid/pics/Makefile.am | 3 + tdemid/pics/cr16-action-piano.png | Bin 0 -> 248 bytes tdemid/pics/cr16-action-volume.png | Bin 0 -> 180 bytes tdemid/pics/cr22-action-piano.png | Bin 0 -> 272 bytes tdemid/pics/cr22-action-volume.png | Bin 0 -> 377 bytes tdemid/pics/cr32-action-piano.png | Bin 0 -> 361 bytes tdemid/pics/cr32-action-volume.png | Bin 0 -> 447 bytes tdemid/qslidertime.cpp | 120 +++ tdemid/qslidertime.h | 57 ++ tdemid/randomlist.cpp | 103 ++ tdemid/randomlist.h | 34 + tdemid/rhythmview.cpp | 108 +++ tdemid/rhythmview.h | 54 ++ tdemid/slman.cpp | 320 +++++++ tdemid/slman.h | 74 ++ tdemid/songlist.cpp | 247 +++++ tdemid/songlist.h | 84 ++ tdemid/std.o3 | Bin 0 -> 7680 bytes tdemid/std.sb | Bin 0 -> 6656 bytes tdemid/tdemid.desktop | 88 ++ tdemid/tdemid.lsm | 14 + tdemid/tdemid.spec | 62 ++ tdemid/tdemidIface.h | 46 + tdemid/tdemid_part.cpp | 144 +++ tdemid/tdemid_part.h | 66 ++ tdemid/tdemid_partui.rc | 17 + tdemid/tdemidbutton.h | 32 + tdemid/tdemidclient.cpp | 1606 ++++++++++++++++++++++++++++++++ tdemid/tdemidclient.h | 241 +++++ tdemid/tdemidframe.cpp | 728 +++++++++++++++ tdemid/tdemidframe.h | 134 +++ tdemid/tdemidui.rc | 44 + tdemid/version.h | 48 + tdemid/x-karaoke.desktop | 61 ++ 202 files changed, 11720 insertions(+), 11720 deletions(-) delete mode 100644 doc/kmid/Makefile.am delete mode 100644 doc/kmid/index.docbook create mode 100644 doc/tdemid/Makefile.am create mode 100644 doc/tdemid/index.docbook delete mode 100644 kmid/ChangeLog delete mode 100644 kmid/Makefile.am delete mode 100644 kmid/PEOPLE delete mode 100644 kmid/README delete mode 100644 kmid/audiomidi.desktop delete mode 100644 kmid/button1.xpm delete mode 100644 kmid/button2.xpm delete mode 100644 kmid/channel.cpp delete mode 100644 kmid/channel.h delete mode 100644 kmid/channel3d.cpp delete mode 100644 kmid/channel3d.h delete mode 100644 kmid/channel4d.cpp delete mode 100644 kmid/channel4d.h delete mode 100644 kmid/channelcfgdlg.cpp delete mode 100644 kmid/channelcfgdlg.h delete mode 100644 kmid/channelview.cpp delete mode 100644 kmid/channelview.h delete mode 100644 kmid/collectdlg.cpp delete mode 100644 kmid/collectdlg.h delete mode 100644 kmid/configure.in.in delete mode 100644 kmid/drums.o3 delete mode 100644 kmid/drums.sb delete mode 100644 kmid/examples/DiesIrae.kar delete mode 100644 kmid/examples/Guantanamera.kar delete mode 100644 kmid/examples/Makefile.am delete mode 100644 kmid/examples/MariaDeLasMercedes.kar delete mode 100644 kmid/examples/OFortuna.kar delete mode 100644 kmid/hi16-app-kmid.png delete mode 100644 kmid/hi32-app-kmid.png delete mode 100644 kmid/hi48-app-kmid.png delete mode 100644 kmid/history.txt delete mode 100644 kmid/instrfilter.awk delete mode 100644 kmid/instrname.cpp delete mode 100644 kmid/instrname.h delete mode 100644 kmid/instrname.i18n delete mode 100644 kmid/kdisptext.cpp delete mode 100644 kmid/kdisptext.h delete mode 100644 kmid/keyboard.xpm delete mode 100644 kmid/klcdnumber.cpp delete mode 100644 kmid/klcdnumber.h delete mode 100644 kmid/kmid.desktop delete mode 100644 kmid/kmid.lsm delete mode 100644 kmid/kmid.spec delete mode 100644 kmid/kmidIface.h delete mode 100644 kmid/kmid_part.cpp delete mode 100644 kmid/kmid_part.h delete mode 100644 kmid/kmid_partui.rc delete mode 100644 kmid/kmidbutton.h delete mode 100644 kmid/kmidclient.cpp delete mode 100644 kmid/kmidclient.h delete mode 100644 kmid/kmidframe.cpp delete mode 100644 kmid/kmidframe.h delete mode 100644 kmid/kmidui.rc delete mode 100644 kmid/ktrianglebutton.cpp delete mode 100644 kmid/ktrianglebutton.h delete mode 100644 kmid/main.cpp delete mode 100644 kmid/maps/Makefile.am delete mode 100644 kmid/maps/YamahaPSR500.map delete mode 100644 kmid/maps/YamahaPSS790.map delete mode 100644 kmid/maps/YamahaQY10.map delete mode 100644 kmid/maps/gm.map delete mode 100644 kmid/midicfgdlg.cpp delete mode 100644 kmid/midicfgdlg.h delete mode 100644 kmid/pics/Makefile.am delete mode 100644 kmid/pics/cr16-action-piano.png delete mode 100644 kmid/pics/cr16-action-volume.png delete mode 100644 kmid/pics/cr22-action-piano.png delete mode 100644 kmid/pics/cr22-action-volume.png delete mode 100644 kmid/pics/cr32-action-piano.png delete mode 100644 kmid/pics/cr32-action-volume.png delete mode 100644 kmid/qslidertime.cpp delete mode 100644 kmid/qslidertime.h delete mode 100644 kmid/randomlist.cpp delete mode 100644 kmid/randomlist.h delete mode 100644 kmid/rhythmview.cpp delete mode 100644 kmid/rhythmview.h delete mode 100644 kmid/slman.cpp delete mode 100644 kmid/slman.h delete mode 100644 kmid/songlist.cpp delete mode 100644 kmid/songlist.h delete mode 100644 kmid/std.o3 delete mode 100644 kmid/std.sb delete mode 100644 kmid/version.h delete mode 100644 kmid/x-karaoke.desktop create mode 100644 tdemid/ChangeLog create mode 100644 tdemid/Makefile.am create mode 100644 tdemid/PEOPLE create mode 100644 tdemid/README create mode 100644 tdemid/audiomidi.desktop create mode 100644 tdemid/button1.xpm create mode 100644 tdemid/button2.xpm create mode 100644 tdemid/channel.cpp create mode 100644 tdemid/channel.h create mode 100644 tdemid/channel3d.cpp create mode 100644 tdemid/channel3d.h create mode 100644 tdemid/channel4d.cpp create mode 100644 tdemid/channel4d.h create mode 100644 tdemid/channelcfgdlg.cpp create mode 100644 tdemid/channelcfgdlg.h create mode 100644 tdemid/channelview.cpp create mode 100644 tdemid/channelview.h create mode 100644 tdemid/collectdlg.cpp create mode 100644 tdemid/collectdlg.h create mode 100644 tdemid/configure.in.in create mode 100644 tdemid/drums.o3 create mode 100644 tdemid/drums.sb create mode 100644 tdemid/examples/DiesIrae.kar create mode 100644 tdemid/examples/Guantanamera.kar create mode 100644 tdemid/examples/Makefile.am create mode 100644 tdemid/examples/MariaDeLasMercedes.kar create mode 100644 tdemid/examples/OFortuna.kar create mode 100644 tdemid/hi16-app-tdemid.png create mode 100644 tdemid/hi32-app-tdemid.png create mode 100644 tdemid/hi48-app-tdemid.png create mode 100644 tdemid/history.txt create mode 100644 tdemid/instrfilter.awk create mode 100644 tdemid/instrname.cpp create mode 100644 tdemid/instrname.h create mode 100644 tdemid/instrname.i18n create mode 100644 tdemid/kdisptext.cpp create mode 100644 tdemid/kdisptext.h create mode 100644 tdemid/keyboard.xpm create mode 100644 tdemid/klcdnumber.cpp create mode 100644 tdemid/klcdnumber.h create mode 100644 tdemid/ktrianglebutton.cpp create mode 100644 tdemid/ktrianglebutton.h create mode 100644 tdemid/main.cpp create mode 100644 tdemid/maps/Makefile.am create mode 100644 tdemid/maps/YamahaPSR500.map create mode 100644 tdemid/maps/YamahaPSS790.map create mode 100644 tdemid/maps/YamahaQY10.map create mode 100644 tdemid/maps/gm.map create mode 100644 tdemid/midicfgdlg.cpp create mode 100644 tdemid/midicfgdlg.h create mode 100644 tdemid/pics/Makefile.am create mode 100644 tdemid/pics/cr16-action-piano.png create mode 100644 tdemid/pics/cr16-action-volume.png create mode 100644 tdemid/pics/cr22-action-piano.png create mode 100644 tdemid/pics/cr22-action-volume.png create mode 100644 tdemid/pics/cr32-action-piano.png create mode 100644 tdemid/pics/cr32-action-volume.png create mode 100644 tdemid/qslidertime.cpp create mode 100644 tdemid/qslidertime.h create mode 100644 tdemid/randomlist.cpp create mode 100644 tdemid/randomlist.h create mode 100644 tdemid/rhythmview.cpp create mode 100644 tdemid/rhythmview.h create mode 100644 tdemid/slman.cpp create mode 100644 tdemid/slman.h create mode 100644 tdemid/songlist.cpp create mode 100644 tdemid/songlist.h create mode 100644 tdemid/std.o3 create mode 100644 tdemid/std.sb create mode 100644 tdemid/tdemid.desktop create mode 100644 tdemid/tdemid.lsm create mode 100644 tdemid/tdemid.spec create mode 100644 tdemid/tdemidIface.h create mode 100644 tdemid/tdemid_part.cpp create mode 100644 tdemid/tdemid_part.h create mode 100644 tdemid/tdemid_partui.rc create mode 100644 tdemid/tdemidbutton.h create mode 100644 tdemid/tdemidclient.cpp create mode 100644 tdemid/tdemidclient.h create mode 100644 tdemid/tdemidframe.cpp create mode 100644 tdemid/tdemidframe.h create mode 100644 tdemid/tdemidui.rc create mode 100644 tdemid/version.h create mode 100644 tdemid/x-karaoke.desktop diff --git a/README b/README index 4e8b3ce7..4f3c94c2 100644 --- a/README +++ b/README @@ -13,8 +13,8 @@ What it is * aktion: a player specialiced on movies, needs xanim * kaudiocreator: CD ripper and audio encoder frontend. * kaboodle: light media player -* kmid: A standalone and embeddable midi player, includes a karaoke-mode -* kmidi: midi player, can use sound patch files and create a WAV file +* tdemid: A standalone and embeddable midi player, includes a karaoke-mode +* tdemidi: midi player, can use sound patch files and create a WAV file * kmix: the audio mixer as a standalone program and Kicker applet * kscd: A CD player with an interface to the internet CDDB database * krec: A recording frontend using aRts diff --git a/arts/builder/Makefile.am b/arts/builder/Makefile.am index 52682a56..fb4af798 100644 --- a/arts/builder/Makefile.am +++ b/arts/builder/Makefile.am @@ -21,7 +21,7 @@ noinst_HEADERS = qttableview.h METASOURCES = AUTO -artsbuilder_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl +artsbuilder_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl # the libraries to link against. Be aware of the order. First the libraries, # that depend on the following ones. diff --git a/arts/gui/kde/Makefile.am b/arts/gui/kde/Makefile.am index 78003d15..d772e884 100644 --- a/arts/gui/kde/Makefile.am +++ b/arts/gui/kde/Makefile.am @@ -23,12 +23,12 @@ libartsgui_kde_la_COMPILE_FIRST = ../common/artsgui.h artstestgui_SOURCES = artstestgui.cpp artstestgui_LDADD = -lqtmcop -ltdecore -lartsflow \ $(top_builddir)/arts/gui/common/libartsgui_idl.la -artstestgui_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +artstestgui_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor dbtest_SOURCES = dbtest.cpp dbtest_LDADD = -lqtmcop -ltdecore -lartsflow \ $(top_builddir)/arts/gui/kde/libartsgui_kde.la -dbtest_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +dbtest_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor libartsgui_kde_la_METASOURCES = AUTO diff --git a/arts/midi/artsmidi.idl b/arts/midi/artsmidi.idl index 70157d95..ce1c5891 100644 --- a/arts/midi/artsmidi.idl +++ b/arts/midi/artsmidi.idl @@ -36,7 +36,7 @@ module Arts { /* This is modelled somewhat after - the AudioManager concept - the aRts-0.3.4.1 MidiPort concept - - libkmid + - libtdemid It adds timing as new feature compared to older implementation, and also tries to do the full set of midi operations. diff --git a/doc/artsbuilder/apis.docbook b/doc/artsbuilder/apis.docbook index fcc036e2..8227f35f 100644 --- a/doc/artsbuilder/apis.docbook +++ b/doc/artsbuilder/apis.docbook @@ -203,8 +203,8 @@ Not yet written - -libkmid + +libtdemid Not yet written diff --git a/doc/artsbuilder/faq.docbook b/doc/artsbuilder/faq.docbook index 31590286..8bb7ae4c 100644 --- a/doc/artsbuilder/faq.docbook +++ b/doc/artsbuilder/faq.docbook @@ -198,7 +198,7 @@ you need to do is add the users to this group. -This helps for &artsd;, but what about &kmix;, &kmid;, &kscd;,&etc;? +This helps for &artsd;, but what about &kmix;, &tdemid;, &kscd;,&etc;? @@ -443,8 +443,8 @@ Obviously, all of the applications included with &kde; are &noatun; &arts-builder; &aktion; -&kmid; -&kmidi; +&tdemid; +&tdemidi; &kmix; &kscd; &kde; games such as &kpoker; and diff --git a/doc/kmid/Makefile.am b/doc/kmid/Makefile.am deleted file mode 100644 index 085981d9..00000000 --- a/doc/kmid/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ - -KDE_LANG = en -KDE_DOCS = AUTO - diff --git a/doc/kmid/index.docbook b/doc/kmid/index.docbook deleted file mode 100644 index bcfaecb1..00000000 --- a/doc/kmid/index.docbook +++ /dev/null @@ -1,1338 +0,0 @@ - - - - - -]> - - - - -The &kmid; Handbook - - -Antonio -Larrosa Jiménez - -
larrosa@kde.org
-
-
- -
- - -19992001 -Antonio Larrosa Jiménez - - -2002-02-05 -2.00.00 - - - -&kmid; is a midi/karaoke multimedia player - - - - -KMid -midi -karaoke -multimedia -mid -kar -player -music -sound -fm -awe -gus - -
- - -Introduction - - -&kmid; is &kde;'s midi and karaoke multimedia player. It features some -features not found in any other &UNIX; midi player, such as realtime -graphics and karaoke text highlighting among others. - - - -&kmid; has been reported to run on &Linux; and FreeBSD operating -systems. It uses the OSS sound driver, so it should -run on every system where &kde; and OSS -compile. &kmid; also supports the &Linux; Ultrasound Project Driver , -which is required to get sound in GUS cards. I plan -to support the ALSA driver as soon as it supports a -sequencer device. - - - -&kmid; shows the lyrics in the screen changing its color at the same -time the music is playing, so it is very easy to follow the tune of the -songs. - - - -Hope you find &kmid; as fun to use as I found developing it. - - - -Antonio Larrosa Jiménez larrosa@kde.org - - - -&kmid;'s features - - -These are some of &kmid;'s main features: - - - - - -It has a very friendly user interface to display karaoke -text with realtime highlighting of lyrics. - - - - -It features a graphical view of what is being played on each midi channel, by -highlighting the keys pressed in (virtual) keyboards. - - - - -The most powerful Midi Mapper that you will ever find in -any operating system. - - - - -Drag & drop so you can drop in &kde; any midi file from a -&konqueror; window. - - - - -You can change the tempo of songs to play them slower or -faster at your wish. - - - - -It shows lights to follow the rhythm of the song. - - - - -Customizable fonts for karaoke text to be displayed. - - - - -Supports the two standards to introduce lyrics in midi files, that is, lyrics or -text events (and guess which one a song uses automatically). - - - - -Session Management. If a song is playing while you logout from &kde;, the next -time you login, the same song will start playing. - - - - -Adjustable volume in realtime. - - - - -It can play broken midi files which make other players core dump! - - - - -It can open gzipped midi/karaoke files just as any other -file. - - - - -Consumes approximately 0.1% of my -CPU (depends on the complexity of the song). - - - - -Supports external midi synths, AWE, FM and -GUS cards (for the latter you need the LUP -driver and gusd installed). - - - - -Runs on &Linux; and FreeBSD (maybe also other unices ...). - - - - - - - - -General usage - - -Opening songs - - -You can open a song several different ways. - - - -First, you can select Open... from the -File menu, then you are presented with a standard -open dialog, with which you can select the song you wish to open. - - - -You can drag a file from a &konqueror; window and drop it in the &kmid; window. -You can also Drag & Drop multiple songs at the same time. - - - -If you specify a song in the command line when running &kmid;, it will also be -opened. - - - -And the final way is by selecting the song from the list of songs of the active -collection. - - - - - -Playing songs - - -To play a song, first open it, and then press on the -Play button of the toolbar, choose the -Play entry of the Song -menu, or just press the Space key. - - - -Note that when you open a file using Drag & Drop, &kmid; will start -playing it automatically (if you drop more than one file, they will be -added to a collection and they will be played sequentially). - - - -Once &kmid; is playing a song, you can move the time slider, by pressing -with the &MMB; mouse button, to go to a specified position. - - - -If a song is playing too fast or too slow for you, you can press on the -arrows at both sides of the tempo LCD and make it -play faster or slower. To get back to the default tempo, just do a -double click on the tempo LCD. - - - -The Space key is used for two things, when music is -playing, and you press the Space key, it will act as -when you press on the pause button or the -Pause entry of the Song -menu, that is, it will pause music. If you press the -Space key when no music is being played, &kmid; will -play it. - - - - - -Displaying lyrics - - -There are two methods to store lyrics in a song, by using -Text events or Lyrics -events, some songs use the first, some the second, some -use both of them, and some don't include lyrics :-) - - - -&kmid; lets you choose which events to display, and even better, it has -an option to automatically select the type of events that a song uses, -so that you don't have to change the type manually . That way, if you -activate the Automatic Text Chooser entry of -the Settings menu, the karaoke text will be -automatically selected, but you can still change them if you prefer to -see the other type. - - - -To select which type to see, you can use the appropriate entries in the -Settings menu, or just press the 1 -and 2 keys of your keyboard to see the -Text events or Lyrics -events respectively. - - - - - - - -Collections - - -A collection is a list of midi files that you put in a set, and which -are played one after another. This section will help you to use them, -and will give you some useful tips to make a good use of them. - - - -Creating a collection - - -To create a collection, first open the Collections -Manager dialog, by selecting the Organize -... entry of the Collections menu . -Then click on the New button, and enter the name -you want the collection to have. - - - -You can also copy a complete collection by selecting it and then -pressing the Copy button, which will ask you for -the name of the new collection that will have initially the same songs -as the selected collection. - - - -Once you have more than one collection, you can change the active -collection from the Collections Manager, by -selecting it. - - - - -The Temporary Collection - - -The Temporary Collection is a collection that is used to hold songs you -want to play but that you don't want to add to any collection. - - - -This collection is not saved on exit of the -application, so keep it in mind when you add lots of songs to it. - - - -Keep on reading this section for a better understanding of the Temporary -Collection. - - - - - -Adding songs to a collection -How to use AutoAdd to a -collection - - -There are some different ways to add a song to a collection. - - - -First of all in each method, you must have selected the collection you -want to add songs to in the Collections Manager. -Then you can press on the Add button to add a -song, there will appear an open file dialog so that you can choose which -song to add. - - - -The other methods to add a song depend on the state of the -AutoAdd to Collection option. - - - -If AutoAdd to Collection is enabled, when -you open a song (using File -Open... or Drag & Drop) it -(they) will be added to the active collection without user intervention. - - - -If AutoAdd to Collection is not enabled, -when you open a song the Temporary Collection will be activated and -cleared, and the opened songs will be added to it. - - - - - -Removing songs from collections - - -To delete a song from a collection, just open the Collection -Manager, select the appropriate collection, and the song you -wish to delete, and then click on the Remove -button. - - - - - -Playing in order or at random - - -You can select the order in which songs will be played . When you select -In order mode from the Play -Order submenu of the Collections menu, -songs will be played in the same order in which they were added to the -collection. - - - -When you select Shuffle mode, &kmid; will -generate a random variable with a discrete uniform distribution to -really play randomly the songs in the collection . It will give values -to that random variable while generating the list in which order the -songs will be played (you surely want to play random songs, but don't -want to play twice the same song, and you want to play the last played -song when you press on the Previous Song button, -don't you ? :-) ). - - - -The random list in which the collection will be played will be -regenerated each time you add or remove a file in the active collection, -and when you press on the Shuffle mode entry -of the menu. - - - - - -Selecting a song from a collection - - -You can select a song to play in the Collection -Manager, or by using the combo box over the karaoke text. - - - -You can also change to the next song by using the Next -Song entry of the Song menu, the -Next Song button of the toolbar, or pressing the -right arrow key. - - - -To change to the previous song, use the Previous -Song entry of the Song menu, the -Previous Song button of the toolbar, or press -the left arrow key of your keyboard. - - - - - -Deleting a collection - - -To delete a collection, simply open the Collection -Manager, select the collection you want to delete, and click -on Delete. Easy, it isn't? - - -Please keep in mind that you cannot delete the Temporary Collection, but -it doesn't matter as it is not saved when you quit &kmid;. - - - - - - - -Midi Maps - - -What is a midi map ? - - -A Midi Map is something that maps midi events in other midi events. - - - -This is totally needed if a synthesizer doesn't understand the standard -events (that is, if a synthesizer is not General Midi compliant), in -this case, a midi map will translate General Midi events in the events -that that synthesizer understands. - - - -For example you can make a midi map that converts all the -Change patch to Bright Piano events, to -Change patch to Trumpet events, and so when a song -tries to play a piano, it will play a trumpet instead. - - - -This may sound odd, (why playing a trumpet when the song is made to play -a piano?), but it is very useful. The GM standard -specifies that when a midi keyboard receives an event to change patch to -0, it will change the current patch to Grand -Piano, but older synthesizer will change for example to a -Electric Guitar when it receives a -0. This old keyboard, needed to receive a -3 (for example) to change to a -Piano. And here comes the midi map in action, -changing all change patch to 0 to change -patch to 3 and thus really playing the correct instrument when -it has to. - - - - - -Do I need a midi map ? - - -In short, if you don't have an external synth, no! - - - -If you only have a sound card, midi maps are not needed because all the -sound cards are GM compliant (this include AWE cards, -GUS cards, FM devices and so on). - - - -If you are playing music through an external synthesizer, and it is not -GM compliant, you will need to make a midi map for your midi keyboard . -Although you will perhaps be a whole afternoon doing your map file and -trying different values for all the options, you will be fully rewarded -when you finish it, because then you will find all the hidden -possibilities of your keyboard. For example, I have a low-cost Yamaha -PSS-790, which is not GM compatible, and doesn't has -as many instruments as a GM synthesizer, but with -&kmid;'s midi mapper, it sounds even better than many soundcards -(including AWE :-)), due to the sound quality found in external synths -(even on non GM compliant ones). - - - - - -Creating a midi map - - -There isn't any program to generate midi maps, so you will have to edit a file -by hand (using your favorite text editor). - - - -A Midi map is a text file that keeps all the needed translations there will be -made when playing music. - - - -It consist of four sections: PATCHMAP, -KEYMAP, CHANNELMAP and -OPTIONS. - - - -Each section must appear only once, except the KEYMAP section -that can appear as many times as needed, provided that each appearance use a -different TextID (continue reading for details). - - - -The general structure of a map file is: - - -DEFINE PATCHMAP -... -END - -DEFINE KEYMAP "Name of Keymap" -... -END - -DEFINE KEYMAP "Another Keymap" -... -END - -DEFINE CHANNELMAP -... -END - -OPTIONS -... -END - - - -You can see that the DEFINE word is used to specify -which section is going to be started (except for -OPTIONS), and END is put at the -end of each section. - - -You can put comments by starting the line with a -# character. - - - -Please, don't forget to send me your map file by email, so that future -releases of &kmid; will include support for more non General Midi -compliant keyboards. - - - -The <literal>PATCHMAP</literal> section - - -This section is used to specify how patches are going to be mapped, from -GM to your keyboard specs . The general usage is: - - -(Name of GM Patch name)=(N) [AllKeysTo M] - - - -Where N is the number that you keyboard needs to -receive to change the patch to the same that the GM standard does . - - - -Please note that the left side of the equal sign is ignored, so -GM patches are supposed to be in order (from 0 to 127) , and -so you are not allowed to change the order of the lines nor to omit any of the -128 instruments. - - - -The optional AllKeysTo M is used to map all notes -that use that instrument to the M key . For example, -suppose that your midi keyboard doesn't have a Gun Shot sound (GM patch -127) so you want to map it to a percussion drum (i.e. key 60), which -sounds similar to a gun shot, then you can put in the 127th line of the -PATCHMAP section: - - -Gunshot =100 AllKeysTo 60 - - - -So when a midi file tries to play a note with the patch 127 (gun shot), it will -be mapped to the patch 100 (your keyboard's percussion patch) and play the note -60 (independently of the key that was going to be played). - - - -Please note that when I use the expression Percussion patch, I -mean the patch in which each key plays a different drum, cymbal, tom, maracas -and so on, and not to a possible sound which some keyboards have and which plays -a different tone of the same drum with each key. - - - - - -The <literal>KEYMAP</literal> section - - -The KEYMAP section is used to specify how keys are -going to be mapped, within a given channel or instrument . The usage is: - - -DEFINE KEYMAP "Name of Keymap" -C 0 =0 -C#0 =1 -D 0 =2 -... -END - - - -As with the PATCHMAP section, it is very important -the order of the lines, and that they are all there (the 128 keys). - - - -As you can define multiple keymaps for different channels and instruments, -you must give a different name to each one in the first line. - - - -Keymaps are mainly used to map keys in the percussion channel . Have a -look at the distributed maps to see some examples. - - - - - -The <literal>CHANNELMAP</literal> section - - -This section can be used to map some channels to different ones . For -example, if you want to swap the first and second channels, you can -easily do it within the CHANNELMAP section. - - - -However it is more useful for keyboards that need the percussion -channel to be in a given channel (the GM standard use the channel 10, -others use the channel 16 and others use channel 9). - - - -Note that midi devices use 16 channels, so the CHANNELMAP -section, has 16 lines, from 0 to 15 , as this one: - - -(N) = (M) [Keymap "Name"] [ForcePatch x] - - - -Where N is the channel which is mapped to the -M channel . If the Keymap option -is used, the Keymap with name Name will be used in -this channel (this Keymap should be defined earlier in the map file !) . -If the ForcePatch option is used, all events that try -to change the patch which is used in this channel will be ignored, and -patch x will be used instead. - - - -The ForcePatch option may be useful for example to -always use the percussion patch on the percussion channel. - - - - - -The <literal>OPTIONS</literal> section - - -The OPTIONS section has some general options that can -be very useful: - - -OPTIONS -PitchBenderRatio = r -MapExpressionToVolumeEvents -END - - - -You can specify both options, only one, or none of them. - - - -The PitchBenderRatio r value, has the ratio by which -pitch bender events will be multiplied . That is, when a midi file tries -to send a pitch bender event with a n value, the real -value that will be sent is n*(r/4096) (the -4096 value is for not having to put decimal points in -the map file). - - - -This is used because the GM standard says that when a -midi keyboard receives a Pitch Bender event with a 4096 data value, it -should bend the note to a higher one , but some midi keyboards try to -bend the initial note by two or more higher notes (even an octave -higher!) when they receive a 4096 . This can be easily fixed by trying -different values so that instead of sending a 4096, KMid sends the -appropriate value. - - - -When the MapExpressionToVolumeEvents option is set in -the map file, and a midi file try to send an expression event, KMid will -send a volume event which is understood by more non-GM keyboards, and -which has a similar effect . There are many midi files which use -expression events to fade out at the end of a song, so if you feel that -music should be heard softer and softer, you can turn on this option and -see if this is what you need, because your midi synthesizer could be -ignoring the expression events because it doesn't understand them. - - - - - - - -Using midi maps - - -To use a midi map, simply open the Midi Setup -dialog by selecting the Midi Setup ... entry -of the Settings menu. - - - -Then click on Browse ..., select the map file within the open -file dialog and enjoy the music ! :-) - - - - - -Advanced features - - -The Channel View - - -The Channel view is a window where you are shown a heap of keyboards (one for -each midi channel). In these keyboards, the notes that are being played with -each instrument are highlighted so that you can see what is each instrument -playing. - - - -Changing instruments - - -You can use the Channel View to change the instrument that each channel is -playing. In each channel there is a combo box where you can select it. Once you -change it, the green button next to it will change to red to indicate that this -is not the default instrument. - - - -If you want to set again the default instrument, click on the red button, and it -will be automatically set. - - - - - -Changing the look mode - - -The Channel View has two different ways (for now) to display the played notes, -you can select them from the Channel View Options... -item in the Settings menu. - - - -You can choose between a mode in which played keys are pressed, as if it were a -normal piano (3D look), or a mode in which keys are also -filled with red color, so that pressed keys are easily recognized (3D -- filled). If you play the piano, or any other music instrument, you -can use this view to learn to play a song by yourself. I've used this technique -and it (along with a tempo reduction) is great to -learn new compositions. - - - - - - - -The Tempo <acronym>LCD</acronym> - - -This shows the tempo in which a song is played, that is, the velocity of the -song. The higher this number is, the faster the song will play. - - - -You can also change the tempo of the song, so if a song plays too fast for you -to follow the lyrics, you can make it play slower. To change the tempo, you can -use the arrows that appear at each sides of the LCD. - - - -Once you have changed the tempo, you can get back the default one by doing a -double click on the LCD. - - - - - - - -Key bindings - - - - - -Key -Action - - - - -Space -Play the loaded song, if it isn't playing, or pause it, if it's already -playing. - - -Backspace -Stop playing - - -Right Arrow -Next song in current collection - - -Left Arrow -Previous song in current collection - - -Up Arrow -Scroll lyrics one line up - - -Down Arrow -Scroll lyrics one line down - - -Page Up -Scroll lyrics one page up - - -Page Down -Scroll lyrics one page down - - -1 -Display text events - - -2 -Display lyric events - - -&Ctrl;O -Open a song - - -&Ctrl;Q -Quit &kmid; - - -F1 -Open this document - - - - - - - - -Frequently Asked Questions (FAQ) - - - - - -What is exactly a midi file? - - - - -A Midi file is a file that contains the information on how to play -a song, that is, it contains simply the notes, the rhythm, -velocity,&etc; This implies that the same midi file, when played in two -different devices, can produce very different results, as well as a -given staff can be played very differently by two different musicians. - - - - - - - -I can get better sound with a mp3/wav player, why should I use &kmid;? - - - - -Well, I cannot force anyone to use &kmid;, but a typical midi file -occupies 50 Kb. while a typical mp3 file occupies 4 Mb. (and that is a -1:80 compression ratio :-) . And with a good synthesizer device, you can -get a comparable sound quality. Even more, with a midi file, you can -change individual instruments, change the velocity of a song, &etc; so -you have more overall control. - - - - - - - -I can't get my AWE card to work with KMid, what can I do? - - - - -This can happen when you get a binary distribution (rpm, deb) of &kmid;. It -happens because &kmid; was compiled without awe support. If it doesn't -work, then you must download a source code distribution (for example, from -&kmid;'s homepage) - - - - - - - -I want to add a whole folder to a collection, but having to add the midi -files one by one is not funny. - - - - - -I agree, that's why &kmid; supports Drag & Drop. Just open, in &konqueror;, -the folder you want to add, select all the files, drag them and drop them in -&kmid;. - - -Be sure to set the AutoAdd to Collection option before, so that the -files will be added to the current collection. If you don't do this, files will -be added to the Temporary Collection. - - - - - - - -I can't follow the lyrics, it's playing too fast! - - - - -You can press the left arrow of the tempo LCD to make it play -slower. Remember that you can do a double click on the LCD to -get the default tempo. - - - - - - - - -Final notes - - -Some tips and tricks - - -I will include some tips so that you can take fully advantage from all -the features of &kmid;: - - - - -Opening files - -I always keep a &kde; desktop with a &konqueror; window in my root -midi folder, and &kmid; in this desktop (if playing a midi file) or -sticky (if playing a karaoke file :-)). This way, when the active -collection finishes, or I want to play some file, I just go to the -konqueror; window, select the desired files and Drag & Drop to the -&kmid;'s window. - - - -Suppose that you want to play some midi files, but don't want to add -them to any collection, well, just turn off the AutoAdd to -Collection option in the Collections -menu, and open the files, they will be added to the Temporary -Collection. - - - - - -Another method to create a new Collection - - -Suppose that you have midi files A.mid, -B.mid and C.mid. At first you -only want to play the first midi file, so you unselect -AutoAdd and open -A.mid. You get then a Temporary Collection with -only one midi file. - - -Then you decide to play also B and C, and make a collection with all them, what -do you do? - - -Easy, select AutoAdd and open -B.mid and C.mid (by any of the -multiple methods), they will be automatically added to the Temporary -Collection, that will then have A.mid, -B.mid and C.mid. At this -point, you can open the Organize Collections -dialog, select the Temporary Collection, and click on the -Copy button, enter the name of the new collection, -and you are done . You already have a new collection, which holds the -A,B and C midi files, and that is not deleted when you close &kmid;. - - - - - - - - -Hall of &kmid;'s friends - - -These are some folks who have sent me midi files or a postcard, thanks -to everyone! Hearing those songs and watching those postcards will keep -me programming more and more on &kmid;. - - - - -Ola Sigurdson - Taking Care of Business (Bachman -Turner Overdrive) - - -EG Lim - A really very nice postcard from Penang. - - -Guenther Starnberger - Amadeus (Falco) and -Schrei Nach Liebe (Die Aerzte) - - -Leandro Terrés - All That She Wants and -The Sign (Ace of Base) - - -Nick Stoic - Two midi files - - - - - - -About the author - - -&kmid; has been made by Antonio Larrosa Jiménez, in Málaga -(Spain). I am a student of Mathematics at the University of -Málaga, currently I'm doing the third course, so I don't have -much free time for my hobbies, but I always try to get some :-) . My -hobbies include : Programming, collecting midi files, playing music and -proving theorems ;-). - - - -If you want to know where to download midi/karaoke files, you have any -question, a bug to report, an idea or a feature you'd like to see in -&kmid; or just want to make me happy, feel free to send me an email to: -larrosa@kde.org or antlarr@arrakis.es - - -or write to me by snail-mail at: - - - Antonio Larrosa Jimenez -Rio Arnoya 10 5B -Malaga (Spain) - - - -You will really make me happy if you send me a postcard from where you -live, or a midi/karaoke file from a local music group of your country -. Everyone who sends me a postcard or a midi file will have his/her name -in the Hall of &kmid;'s friends of this file (provided they don't oppose -to this). Please contact me before sending me any midi files because I -may have it already. - - - -I'd like stress that &kmid; has been done completely on free time, -without any monetary support from any company nor particular. So please -keep in mind when you use it, that the only think that keep me working -on this is getting some feedback from its users (a postcard, or just an -email). - - - -I would like to thanks the following persons their help in developing &kmid;: - - - - - -Paul J. Leonard P.J.Leonard@bath.ac.uk - Support for AWE -cards - - - - -Sebestyen Zoltan szoli@digo.inf.elte.hu- FreeBSD port and -AWE testing - - - - -Christian Esken esken@kde.org - For organizing the KDE -multimedia efforts - - - - -Stephan Kulow coolo@kde.org- Configure scripts and help -with automake and CVS - - - - -Jaroslav Kysela - Help in doing the &Linux; Ultrasound Project driver -support - - - - -Takashi Iwai and Joseph H. Buehler - Fix for AWE cards pitch being -too high - - - - -Adrian Knoth - For giving me good news and many suggestions - - - - -Kevin Street - Patch to support FreeBSD 3.0 - - - - -Thanks go also to Jose Luis Sanchez for his testing of GUS support, -Ignacio Garcia for testing the AWE support, Hans Petter Bieker, Ola -Sigurdson, Marc Diefenbruch, Peter Gritsch, Magnus Pfeffer, Urko Lusa, -Peter-Paul Witta, Thorsten Westheider, Ulrich Cordes and everyone that -sent me a patch, bug report or just an email to give me encouragement. - - - - -And of course to all the fabulous musicians over the net that keep giving -us those wonderful midi and karaoke files. - - - - - - - - - -Copyrights and License - -&kmid; is copyright Antonio Larrosa Jiménez, 1999-2001 - -Documentation is copyright Antonio Larrosa Jiménez 1999, -2001 - -&underFDL; -&underGPL; - - - - - - -Installation - - -How to obtain &kmid; - -&install.intro.documentation; - - -Additionally, &kmid; can be found on its homepage, which is at -http://www.arrakis.es/~rlarrosa/kmid.html. In the homepage, you can -follow its development, see some information about it, some screenshots, a list -of sites from where you can download more karaoke songs, &etc; - - - - - -Requirements - -&kmid; requires to work: - - - - -&kde;. Well, you probably already have this :-) - - - - -A sound card. A good soundcard and/or external synthesizer are -recommended, as the sound quality depends greatly in your soundcard, -it's not the same to play the music using an FM device, than using an -AWE card. - - - -If you don't have a soundcard, you can still compile &kmid; with -MODE_DEMO_ONLYVISUAL defined and it will run as if -you had one (but you'll get no music, of course :-( ). - - - - - - - -Compilation and Installation - -&install.compile.documentation; - - -I've included some examples that are installed in $dollar;TDEDIR/share/apps/kmid - - - -If you run into any problem, don't hesitate to contact any of the &kde; mailing -list, or send a report directly to me. - - - - - - -
- diff --git a/doc/tdemid/Makefile.am b/doc/tdemid/Makefile.am new file mode 100644 index 00000000..085981d9 --- /dev/null +++ b/doc/tdemid/Makefile.am @@ -0,0 +1,4 @@ + +KDE_LANG = en +KDE_DOCS = AUTO + diff --git a/doc/tdemid/index.docbook b/doc/tdemid/index.docbook new file mode 100644 index 00000000..b08a1d9a --- /dev/null +++ b/doc/tdemid/index.docbook @@ -0,0 +1,1338 @@ + + + + + +]> + + + + +The &tdemid; Handbook + + +Antonio +Larrosa Jiménez + +
larrosa@kde.org
+
+
+ +
+ + +19992001 +Antonio Larrosa Jiménez + + +2002-02-05 +2.00.00 + + + +&tdemid; is a midi/karaoke multimedia player + + + + +KMid +midi +karaoke +multimedia +mid +kar +player +music +sound +fm +awe +gus + +
+ + +Introduction + + +&tdemid; is &kde;'s midi and karaoke multimedia player. It features some +features not found in any other &UNIX; midi player, such as realtime +graphics and karaoke text highlighting among others. + + + +&tdemid; has been reported to run on &Linux; and FreeBSD operating +systems. It uses the OSS sound driver, so it should +run on every system where &kde; and OSS +compile. &tdemid; also supports the &Linux; Ultrasound Project Driver , +which is required to get sound in GUS cards. I plan +to support the ALSA driver as soon as it supports a +sequencer device. + + + +&tdemid; shows the lyrics in the screen changing its color at the same +time the music is playing, so it is very easy to follow the tune of the +songs. + + + +Hope you find &tdemid; as fun to use as I found developing it. + + + +Antonio Larrosa Jiménez larrosa@kde.org + + + +&tdemid;'s features + + +These are some of &tdemid;'s main features: + + + + + +It has a very friendly user interface to display karaoke +text with realtime highlighting of lyrics. + + + + +It features a graphical view of what is being played on each midi channel, by +highlighting the keys pressed in (virtual) keyboards. + + + + +The most powerful Midi Mapper that you will ever find in +any operating system. + + + + +Drag & drop so you can drop in &kde; any midi file from a +&konqueror; window. + + + + +You can change the tempo of songs to play them slower or +faster at your wish. + + + + +It shows lights to follow the rhythm of the song. + + + + +Customizable fonts for karaoke text to be displayed. + + + + +Supports the two standards to introduce lyrics in midi files, that is, lyrics or +text events (and guess which one a song uses automatically). + + + + +Session Management. If a song is playing while you logout from &kde;, the next +time you login, the same song will start playing. + + + + +Adjustable volume in realtime. + + + + +It can play broken midi files which make other players core dump! + + + + +It can open gzipped midi/karaoke files just as any other +file. + + + + +Consumes approximately 0.1% of my +CPU (depends on the complexity of the song). + + + + +Supports external midi synths, AWE, FM and +GUS cards (for the latter you need the LUP +driver and gusd installed). + + + + +Runs on &Linux; and FreeBSD (maybe also other unices ...). + + + + + + + + +General usage + + +Opening songs + + +You can open a song several different ways. + + + +First, you can select Open... from the +File menu, then you are presented with a standard +open dialog, with which you can select the song you wish to open. + + + +You can drag a file from a &konqueror; window and drop it in the &tdemid; window. +You can also Drag & Drop multiple songs at the same time. + + + +If you specify a song in the command line when running &tdemid;, it will also be +opened. + + + +And the final way is by selecting the song from the list of songs of the active +collection. + + + + + +Playing songs + + +To play a song, first open it, and then press on the +Play button of the toolbar, choose the +Play entry of the Song +menu, or just press the Space key. + + + +Note that when you open a file using Drag & Drop, &tdemid; will start +playing it automatically (if you drop more than one file, they will be +added to a collection and they will be played sequentially). + + + +Once &tdemid; is playing a song, you can move the time slider, by pressing +with the &MMB; mouse button, to go to a specified position. + + + +If a song is playing too fast or too slow for you, you can press on the +arrows at both sides of the tempo LCD and make it +play faster or slower. To get back to the default tempo, just do a +double click on the tempo LCD. + + + +The Space key is used for two things, when music is +playing, and you press the Space key, it will act as +when you press on the pause button or the +Pause entry of the Song +menu, that is, it will pause music. If you press the +Space key when no music is being played, &tdemid; will +play it. + + + + + +Displaying lyrics + + +There are two methods to store lyrics in a song, by using +Text events or Lyrics +events, some songs use the first, some the second, some +use both of them, and some don't include lyrics :-) + + + +&tdemid; lets you choose which events to display, and even better, it has +an option to automatically select the type of events that a song uses, +so that you don't have to change the type manually . That way, if you +activate the Automatic Text Chooser entry of +the Settings menu, the karaoke text will be +automatically selected, but you can still change them if you prefer to +see the other type. + + + +To select which type to see, you can use the appropriate entries in the +Settings menu, or just press the 1 +and 2 keys of your keyboard to see the +Text events or Lyrics +events respectively. + + + + + + + +Collections + + +A collection is a list of midi files that you put in a set, and which +are played one after another. This section will help you to use them, +and will give you some useful tips to make a good use of them. + + + +Creating a collection + + +To create a collection, first open the Collections +Manager dialog, by selecting the Organize +... entry of the Collections menu . +Then click on the New button, and enter the name +you want the collection to have. + + + +You can also copy a complete collection by selecting it and then +pressing the Copy button, which will ask you for +the name of the new collection that will have initially the same songs +as the selected collection. + + + +Once you have more than one collection, you can change the active +collection from the Collections Manager, by +selecting it. + + + + +The Temporary Collection + + +The Temporary Collection is a collection that is used to hold songs you +want to play but that you don't want to add to any collection. + + + +This collection is not saved on exit of the +application, so keep it in mind when you add lots of songs to it. + + + +Keep on reading this section for a better understanding of the Temporary +Collection. + + + + + +Adding songs to a collection +How to use AutoAdd to a +collection + + +There are some different ways to add a song to a collection. + + + +First of all in each method, you must have selected the collection you +want to add songs to in the Collections Manager. +Then you can press on the Add button to add a +song, there will appear an open file dialog so that you can choose which +song to add. + + + +The other methods to add a song depend on the state of the +AutoAdd to Collection option. + + + +If AutoAdd to Collection is enabled, when +you open a song (using File +Open... or Drag & Drop) it +(they) will be added to the active collection without user intervention. + + + +If AutoAdd to Collection is not enabled, +when you open a song the Temporary Collection will be activated and +cleared, and the opened songs will be added to it. + + + + + +Removing songs from collections + + +To delete a song from a collection, just open the Collection +Manager, select the appropriate collection, and the song you +wish to delete, and then click on the Remove +button. + + + + + +Playing in order or at random + + +You can select the order in which songs will be played . When you select +In order mode from the Play +Order submenu of the Collections menu, +songs will be played in the same order in which they were added to the +collection. + + + +When you select Shuffle mode, &tdemid; will +generate a random variable with a discrete uniform distribution to +really play randomly the songs in the collection . It will give values +to that random variable while generating the list in which order the +songs will be played (you surely want to play random songs, but don't +want to play twice the same song, and you want to play the last played +song when you press on the Previous Song button, +don't you ? :-) ). + + + +The random list in which the collection will be played will be +regenerated each time you add or remove a file in the active collection, +and when you press on the Shuffle mode entry +of the menu. + + + + + +Selecting a song from a collection + + +You can select a song to play in the Collection +Manager, or by using the combo box over the karaoke text. + + + +You can also change to the next song by using the Next +Song entry of the Song menu, the +Next Song button of the toolbar, or pressing the +right arrow key. + + + +To change to the previous song, use the Previous +Song entry of the Song menu, the +Previous Song button of the toolbar, or press +the left arrow key of your keyboard. + + + + + +Deleting a collection + + +To delete a collection, simply open the Collection +Manager, select the collection you want to delete, and click +on Delete. Easy, it isn't? + + +Please keep in mind that you cannot delete the Temporary Collection, but +it doesn't matter as it is not saved when you quit &tdemid;. + + + + + + + +Midi Maps + + +What is a midi map ? + + +A Midi Map is something that maps midi events in other midi events. + + + +This is totally needed if a synthesizer doesn't understand the standard +events (that is, if a synthesizer is not General Midi compliant), in +this case, a midi map will translate General Midi events in the events +that that synthesizer understands. + + + +For example you can make a midi map that converts all the +Change patch to Bright Piano events, to +Change patch to Trumpet events, and so when a song +tries to play a piano, it will play a trumpet instead. + + + +This may sound odd, (why playing a trumpet when the song is made to play +a piano?), but it is very useful. The GM standard +specifies that when a midi keyboard receives an event to change patch to +0, it will change the current patch to Grand +Piano, but older synthesizer will change for example to a +Electric Guitar when it receives a +0. This old keyboard, needed to receive a +3 (for example) to change to a +Piano. And here comes the midi map in action, +changing all change patch to 0 to change +patch to 3 and thus really playing the correct instrument when +it has to. + + + + + +Do I need a midi map ? + + +In short, if you don't have an external synth, no! + + + +If you only have a sound card, midi maps are not needed because all the +sound cards are GM compliant (this include AWE cards, +GUS cards, FM devices and so on). + + + +If you are playing music through an external synthesizer, and it is not +GM compliant, you will need to make a midi map for your midi keyboard . +Although you will perhaps be a whole afternoon doing your map file and +trying different values for all the options, you will be fully rewarded +when you finish it, because then you will find all the hidden +possibilities of your keyboard. For example, I have a low-cost Yamaha +PSS-790, which is not GM compatible, and doesn't has +as many instruments as a GM synthesizer, but with +&tdemid;'s midi mapper, it sounds even better than many soundcards +(including AWE :-)), due to the sound quality found in external synths +(even on non GM compliant ones). + + + + + +Creating a midi map + + +There isn't any program to generate midi maps, so you will have to edit a file +by hand (using your favorite text editor). + + + +A Midi map is a text file that keeps all the needed translations there will be +made when playing music. + + + +It consist of four sections: PATCHMAP, +KEYMAP, CHANNELMAP and +OPTIONS. + + + +Each section must appear only once, except the KEYMAP section +that can appear as many times as needed, provided that each appearance use a +different TextID (continue reading for details). + + + +The general structure of a map file is: + + +DEFINE PATCHMAP +... +END + +DEFINE KEYMAP "Name of Keymap" +... +END + +DEFINE KEYMAP "Another Keymap" +... +END + +DEFINE CHANNELMAP +... +END + +OPTIONS +... +END + + + +You can see that the DEFINE word is used to specify +which section is going to be started (except for +OPTIONS), and END is put at the +end of each section. + + +You can put comments by starting the line with a +# character. + + + +Please, don't forget to send me your map file by email, so that future +releases of &tdemid; will include support for more non General Midi +compliant keyboards. + + + +The <literal>PATCHMAP</literal> section + + +This section is used to specify how patches are going to be mapped, from +GM to your keyboard specs . The general usage is: + + +(Name of GM Patch name)=(N) [AllKeysTo M] + + + +Where N is the number that you keyboard needs to +receive to change the patch to the same that the GM standard does . + + + +Please note that the left side of the equal sign is ignored, so +GM patches are supposed to be in order (from 0 to 127) , and +so you are not allowed to change the order of the lines nor to omit any of the +128 instruments. + + + +The optional AllKeysTo M is used to map all notes +that use that instrument to the M key . For example, +suppose that your midi keyboard doesn't have a Gun Shot sound (GM patch +127) so you want to map it to a percussion drum (i.e. key 60), which +sounds similar to a gun shot, then you can put in the 127th line of the +PATCHMAP section: + + +Gunshot =100 AllKeysTo 60 + + + +So when a midi file tries to play a note with the patch 127 (gun shot), it will +be mapped to the patch 100 (your keyboard's percussion patch) and play the note +60 (independently of the key that was going to be played). + + + +Please note that when I use the expression Percussion patch, I +mean the patch in which each key plays a different drum, cymbal, tom, maracas +and so on, and not to a possible sound which some keyboards have and which plays +a different tone of the same drum with each key. + + + + + +The <literal>KEYMAP</literal> section + + +The KEYMAP section is used to specify how keys are +going to be mapped, within a given channel or instrument . The usage is: + + +DEFINE KEYMAP "Name of Keymap" +C 0 =0 +C#0 =1 +D 0 =2 +... +END + + + +As with the PATCHMAP section, it is very important +the order of the lines, and that they are all there (the 128 keys). + + + +As you can define multiple keymaps for different channels and instruments, +you must give a different name to each one in the first line. + + + +Keymaps are mainly used to map keys in the percussion channel . Have a +look at the distributed maps to see some examples. + + + + + +The <literal>CHANNELMAP</literal> section + + +This section can be used to map some channels to different ones . For +example, if you want to swap the first and second channels, you can +easily do it within the CHANNELMAP section. + + + +However it is more useful for keyboards that need the percussion +channel to be in a given channel (the GM standard use the channel 10, +others use the channel 16 and others use channel 9). + + + +Note that midi devices use 16 channels, so the CHANNELMAP +section, has 16 lines, from 0 to 15 , as this one: + + +(N) = (M) [Keymap "Name"] [ForcePatch x] + + + +Where N is the channel which is mapped to the +M channel . If the Keymap option +is used, the Keymap with name Name will be used in +this channel (this Keymap should be defined earlier in the map file !) . +If the ForcePatch option is used, all events that try +to change the patch which is used in this channel will be ignored, and +patch x will be used instead. + + + +The ForcePatch option may be useful for example to +always use the percussion patch on the percussion channel. + + + + + +The <literal>OPTIONS</literal> section + + +The OPTIONS section has some general options that can +be very useful: + + +OPTIONS +PitchBenderRatio = r +MapExpressionToVolumeEvents +END + + + +You can specify both options, only one, or none of them. + + + +The PitchBenderRatio r value, has the ratio by which +pitch bender events will be multiplied . That is, when a midi file tries +to send a pitch bender event with a n value, the real +value that will be sent is n*(r/4096) (the +4096 value is for not having to put decimal points in +the map file). + + + +This is used because the GM standard says that when a +midi keyboard receives a Pitch Bender event with a 4096 data value, it +should bend the note to a higher one , but some midi keyboards try to +bend the initial note by two or more higher notes (even an octave +higher!) when they receive a 4096 . This can be easily fixed by trying +different values so that instead of sending a 4096, KMid sends the +appropriate value. + + + +When the MapExpressionToVolumeEvents option is set in +the map file, and a midi file try to send an expression event, KMid will +send a volume event which is understood by more non-GM keyboards, and +which has a similar effect . There are many midi files which use +expression events to fade out at the end of a song, so if you feel that +music should be heard softer and softer, you can turn on this option and +see if this is what you need, because your midi synthesizer could be +ignoring the expression events because it doesn't understand them. + + + + + + + +Using midi maps + + +To use a midi map, simply open the Midi Setup +dialog by selecting the Midi Setup ... entry +of the Settings menu. + + + +Then click on Browse ..., select the map file within the open +file dialog and enjoy the music ! :-) + + + + + +Advanced features + + +The Channel View + + +The Channel view is a window where you are shown a heap of keyboards (one for +each midi channel). In these keyboards, the notes that are being played with +each instrument are highlighted so that you can see what is each instrument +playing. + + + +Changing instruments + + +You can use the Channel View to change the instrument that each channel is +playing. In each channel there is a combo box where you can select it. Once you +change it, the green button next to it will change to red to indicate that this +is not the default instrument. + + + +If you want to set again the default instrument, click on the red button, and it +will be automatically set. + + + + + +Changing the look mode + + +The Channel View has two different ways (for now) to display the played notes, +you can select them from the Channel View Options... +item in the Settings menu. + + + +You can choose between a mode in which played keys are pressed, as if it were a +normal piano (3D look), or a mode in which keys are also +filled with red color, so that pressed keys are easily recognized (3D +- filled). If you play the piano, or any other music instrument, you +can use this view to learn to play a song by yourself. I've used this technique +and it (along with a tempo reduction) is great to +learn new compositions. + + + + + + + +The Tempo <acronym>LCD</acronym> + + +This shows the tempo in which a song is played, that is, the velocity of the +song. The higher this number is, the faster the song will play. + + + +You can also change the tempo of the song, so if a song plays too fast for you +to follow the lyrics, you can make it play slower. To change the tempo, you can +use the arrows that appear at each sides of the LCD. + + + +Once you have changed the tempo, you can get back the default one by doing a +double click on the LCD. + + + + + + + +Key bindings + + + + + +Key +Action + + + + +Space +Play the loaded song, if it isn't playing, or pause it, if it's already +playing. + + +Backspace +Stop playing + + +Right Arrow +Next song in current collection + + +Left Arrow +Previous song in current collection + + +Up Arrow +Scroll lyrics one line up + + +Down Arrow +Scroll lyrics one line down + + +Page Up +Scroll lyrics one page up + + +Page Down +Scroll lyrics one page down + + +1 +Display text events + + +2 +Display lyric events + + +&Ctrl;O +Open a song + + +&Ctrl;Q +Quit &tdemid; + + +F1 +Open this document + + + + + + + + +Frequently Asked Questions (FAQ) + + + + + +What is exactly a midi file? + + + + +A Midi file is a file that contains the information on how to play +a song, that is, it contains simply the notes, the rhythm, +velocity,&etc; This implies that the same midi file, when played in two +different devices, can produce very different results, as well as a +given staff can be played very differently by two different musicians. + + + + + + + +I can get better sound with a mp3/wav player, why should I use &tdemid;? + + + + +Well, I cannot force anyone to use &tdemid;, but a typical midi file +occupies 50 Kb. while a typical mp3 file occupies 4 Mb. (and that is a +1:80 compression ratio :-) . And with a good synthesizer device, you can +get a comparable sound quality. Even more, with a midi file, you can +change individual instruments, change the velocity of a song, &etc; so +you have more overall control. + + + + + + + +I can't get my AWE card to work with KMid, what can I do? + + + + +This can happen when you get a binary distribution (rpm, deb) of &tdemid;. It +happens because &tdemid; was compiled without awe support. If it doesn't +work, then you must download a source code distribution (for example, from +&tdemid;'s homepage) + + + + + + + +I want to add a whole folder to a collection, but having to add the midi +files one by one is not funny. + + + + + +I agree, that's why &tdemid; supports Drag & Drop. Just open, in &konqueror;, +the folder you want to add, select all the files, drag them and drop them in +&tdemid;. + + +Be sure to set the AutoAdd to Collection option before, so that the +files will be added to the current collection. If you don't do this, files will +be added to the Temporary Collection. + + + + + + + +I can't follow the lyrics, it's playing too fast! + + + + +You can press the left arrow of the tempo LCD to make it play +slower. Remember that you can do a double click on the LCD to +get the default tempo. + + + + + + + + +Final notes + + +Some tips and tricks + + +I will include some tips so that you can take fully advantage from all +the features of &tdemid;: + + + + +Opening files + +I always keep a &kde; desktop with a &konqueror; window in my root +midi folder, and &tdemid; in this desktop (if playing a midi file) or +sticky (if playing a karaoke file :-)). This way, when the active +collection finishes, or I want to play some file, I just go to the +konqueror; window, select the desired files and Drag & Drop to the +&tdemid;'s window. + + + +Suppose that you want to play some midi files, but don't want to add +them to any collection, well, just turn off the AutoAdd to +Collection option in the Collections +menu, and open the files, they will be added to the Temporary +Collection. + + + + + +Another method to create a new Collection + + +Suppose that you have midi files A.mid, +B.mid and C.mid. At first you +only want to play the first midi file, so you unselect +AutoAdd and open +A.mid. You get then a Temporary Collection with +only one midi file. + + +Then you decide to play also B and C, and make a collection with all them, what +do you do? + + +Easy, select AutoAdd and open +B.mid and C.mid (by any of the +multiple methods), they will be automatically added to the Temporary +Collection, that will then have A.mid, +B.mid and C.mid. At this +point, you can open the Organize Collections +dialog, select the Temporary Collection, and click on the +Copy button, enter the name of the new collection, +and you are done . You already have a new collection, which holds the +A,B and C midi files, and that is not deleted when you close &tdemid;. + + + + + + + + +Hall of &tdemid;'s friends + + +These are some folks who have sent me midi files or a postcard, thanks +to everyone! Hearing those songs and watching those postcards will keep +me programming more and more on &tdemid;. + + + + +Ola Sigurdson - Taking Care of Business (Bachman +Turner Overdrive) + + +EG Lim - A really very nice postcard from Penang. + + +Guenther Starnberger - Amadeus (Falco) and +Schrei Nach Liebe (Die Aerzte) + + +Leandro Terrés - All That She Wants and +The Sign (Ace of Base) + + +Nick Stoic - Two midi files + + + + + + +About the author + + +&tdemid; has been made by Antonio Larrosa Jiménez, in Málaga +(Spain). I am a student of Mathematics at the University of +Málaga, currently I'm doing the third course, so I don't have +much free time for my hobbies, but I always try to get some :-) . My +hobbies include : Programming, collecting midi files, playing music and +proving theorems ;-). + + + +If you want to know where to download midi/karaoke files, you have any +question, a bug to report, an idea or a feature you'd like to see in +&tdemid; or just want to make me happy, feel free to send me an email to: +larrosa@kde.org or antlarr@arrakis.es + + +or write to me by snail-mail at: + + + Antonio Larrosa Jimenez +Rio Arnoya 10 5B +Malaga (Spain) + + + +You will really make me happy if you send me a postcard from where you +live, or a midi/karaoke file from a local music group of your country +. Everyone who sends me a postcard or a midi file will have his/her name +in the Hall of &tdemid;'s friends of this file (provided they don't oppose +to this). Please contact me before sending me any midi files because I +may have it already. + + + +I'd like stress that &tdemid; has been done completely on free time, +without any monetary support from any company nor particular. So please +keep in mind when you use it, that the only think that keep me working +on this is getting some feedback from its users (a postcard, or just an +email). + + + +I would like to thanks the following persons their help in developing &tdemid;: + + + + + +Paul J. Leonard P.J.Leonard@bath.ac.uk - Support for AWE +cards + + + + +Sebestyen Zoltan szoli@digo.inf.elte.hu- FreeBSD port and +AWE testing + + + + +Christian Esken esken@kde.org - For organizing the KDE +multimedia efforts + + + + +Stephan Kulow coolo@kde.org- Configure scripts and help +with automake and CVS + + + + +Jaroslav Kysela - Help in doing the &Linux; Ultrasound Project driver +support + + + + +Takashi Iwai and Joseph H. Buehler - Fix for AWE cards pitch being +too high + + + + +Adrian Knoth - For giving me good news and many suggestions + + + + +Kevin Street - Patch to support FreeBSD 3.0 + + + + +Thanks go also to Jose Luis Sanchez for his testing of GUS support, +Ignacio Garcia for testing the AWE support, Hans Petter Bieker, Ola +Sigurdson, Marc Diefenbruch, Peter Gritsch, Magnus Pfeffer, Urko Lusa, +Peter-Paul Witta, Thorsten Westheider, Ulrich Cordes and everyone that +sent me a patch, bug report or just an email to give me encouragement. + + + + +And of course to all the fabulous musicians over the net that keep giving +us those wonderful midi and karaoke files. + + + + + + + + + +Copyrights and License + +&tdemid; is copyright Antonio Larrosa Jiménez, 1999-2001 + +Documentation is copyright Antonio Larrosa Jiménez 1999, +2001 + +&underFDL; +&underGPL; + + + + + + +Installation + + +How to obtain &tdemid; + +&install.intro.documentation; + + +Additionally, &tdemid; can be found on its homepage, which is at +http://www.arrakis.es/~rlarrosa/tdemid.html. In the homepage, you can +follow its development, see some information about it, some screenshots, a list +of sites from where you can download more karaoke songs, &etc; + + + + + +Requirements + +&tdemid; requires to work: + + + + +&kde;. Well, you probably already have this :-) + + + + +A sound card. A good soundcard and/or external synthesizer are +recommended, as the sound quality depends greatly in your soundcard, +it's not the same to play the music using an FM device, than using an +AWE card. + + + +If you don't have a soundcard, you can still compile &tdemid; with +MODE_DEMO_ONLYVISUAL defined and it will run as if +you had one (but you'll get no music, of course :-( ). + + + + + + + +Compilation and Installation + +&install.compile.documentation; + + +I've included some examples that are installed in $dollar;TDEDIR/share/apps/tdemid + + + +If you run into any problem, don't hesitate to contact any of the &kde; mailing +list, or send a report directly to me. + + + + + + +
+ diff --git a/juk/Makefile.am b/juk/Makefile.am index 2422be5d..ff1ceb64 100644 --- a/juk/Makefile.am +++ b/juk/Makefile.am @@ -85,12 +85,12 @@ endif ################################################## juk_LDADD = -lm $(LDADD_GST) $(mblibs) $(LIB_KIO) $(taglib_libs) $(akode_libs) $(LIB_KHTML) $(LIB_ARTS) -juk_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LDFLAGS_GST) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl $(akode_libs) +juk_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LDFLAGS_GST) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl $(akode_libs) KDE_CXXFLAGS = $(USE_EXCEPTIONS) tagguessertest_LDADD = $(LIB_TDECORE) -tagguessertest_LDFLAGS = $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl +tagguessertest_LDFLAGS = $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl SUBDIRS = pics diff --git a/kaboodle/Makefile.am b/kaboodle/Makefile.am index 0c1a0cee..1f39c8f4 100644 --- a/kaboodle/Makefile.am +++ b/kaboodle/Makefile.am @@ -12,11 +12,11 @@ libkaboodle_noinst_la_SOURCES = conf.cpp \ view.cpp \ kaboodle_factory.cpp -libs = $(LIB_KPARTS) -lqtmcop -lkmedia2_idl -lsoundserver_idl -lartskde -lkmediaplayer +libs = $(LIB_KPARTS) -lqtmcop -lkmedia2_idl -lsoundserver_idl -lartskde -ltdemediaplayer libkaboodlepart_la_SOURCES = dummy.cpp -libkaboodlepart_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -libkaboodlepart_la_LIBADD = libkaboodle_noinst.la $(libs) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl +libkaboodlepart_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl +libkaboodlepart_la_LIBADD = libkaboodle_noinst.la $(libs) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl kaboodle_SOURCES = main.cpp \ kaboodleapp.cpp \ @@ -27,8 +27,8 @@ dummy.cpp: CLEANFILES = dummy.cpp -kaboodle_LDADD = libkaboodle_noinst.la $(libs) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -kaboodle_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl +kaboodle_LDADD = libkaboodle_noinst.la $(libs) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl +kaboodle_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl bin_PROGRAMS = kaboodle diff --git a/kaboodle/engine.h b/kaboodle/engine.h index b4d1b24b..974a8541 100644 --- a/kaboodle/engine.h +++ b/kaboodle/engine.h @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include +#include #include namespace Arts diff --git a/kaboodle/kaboodle_factory.h b/kaboodle/kaboodle_factory.h index 7a85afb8..ca00c084 100644 --- a/kaboodle/kaboodle_factory.h +++ b/kaboodle/kaboodle_factory.h @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include +#include namespace Kaboodle { diff --git a/kaboodle/player.h b/kaboodle/player.h index 67bc2e65..f269dbbf 100644 --- a/kaboodle/player.h +++ b/kaboodle/player.h @@ -25,8 +25,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define PLAYER_H #include -#include -#include +#include +#include #include #include #include diff --git a/kaboodle/userinterface.h b/kaboodle/userinterface.h index 90a18ad0..f786ad81 100644 --- a/kaboodle/userinterface.h +++ b/kaboodle/userinterface.h @@ -27,7 +27,7 @@ #include "kaboodleapp.h" #include -#include +#include #include #include "player.h" diff --git a/kaboodle/view.h b/kaboodle/view.h index 59c26358..9b4e8fba 100644 --- a/kaboodle/view.h +++ b/kaboodle/view.h @@ -24,8 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef KABOODLEVIEW_H #define KABOODLEVIEW_H -#include -#include +#include +#include #include #include #include diff --git a/kaudiocreator/Makefile.am b/kaudiocreator/Makefile.am index aa30ce8a..ba0f65ad 100644 --- a/kaudiocreator/Makefile.am +++ b/kaudiocreator/Makefile.am @@ -12,7 +12,7 @@ kaudiocreator_SOURCES = main.cpp kaudiocreator.cpp encoder.cpp \ EXTRA_DIST = encoder.h kaudiocreator.h kaudiocreator.desktop encoderconfigimp.h \ obqueimp.h ripper.h tracksimp.h encodefileimp.h -kaudiocreator_LDFLAGS = $(all_libraries) $(KDE_RPATH) -lkutils $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kaudiocreator_LDFLAGS = $(all_libraries) $(KDE_RPATH) -ltdeutils $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor METASOURCES = AUTO @@ -20,7 +20,7 @@ messages: rc.cpp $(XGETTEXT) *.cpp *.h -o $(podir)/kaudiocreator.pot kaudiocreator_LDADD = $(LIB_KIO) $(top_builddir)/libkcddb/libkcddb.la \ - $(top_builddir)/kscd/libkcompactdisc.la $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor + $(top_builddir)/kscd/libkcompactdisc.la $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor KDE_ICON = AUTO diff --git a/kfile-plugins/au/Makefile.am b/kfile-plugins/au/Makefile.am index 77647de3..f9a1649b 100644 --- a/kfile-plugins/au/Makefile.am +++ b/kfile-plugins/au/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_au.h kde_module_LTLIBRARIES = kfile_au.la kfile_au_la_SOURCES = kfile_au.cpp -kfile_au_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_au_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_au_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/avi/Makefile.am b/kfile-plugins/avi/Makefile.am index 0577f2fe..43590f82 100644 --- a/kfile-plugins/avi/Makefile.am +++ b/kfile-plugins/avi/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_avi.h kde_module_LTLIBRARIES = kfile_avi.la kfile_avi_la_SOURCES = kfile_avi.cpp -kfile_avi_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_avi_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_avi_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/flac/Makefile.am b/kfile-plugins/flac/Makefile.am index 2b091517..34a0ffb3 100644 --- a/kfile-plugins/flac/Makefile.am +++ b/kfile-plugins/flac/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_flac.h kde_module_LTLIBRARIES = kfile_flac.la kfile_flac_la_SOURCES = kfile_flac.cpp -kfile_flac_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor $(taglib_libs) -module $(KDE_PLUGIN) +kfile_flac_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor $(taglib_libs) -module $(KDE_PLUGIN) kfile_flac_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/m3u/Makefile.am b/kfile-plugins/m3u/Makefile.am index a6289c6b..11b59685 100644 --- a/kfile-plugins/m3u/Makefile.am +++ b/kfile-plugins/m3u/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_m3u.h kde_module_LTLIBRARIES = kfile_m3u.la kfile_m3u_la_SOURCES = kfile_m3u.cpp -kfile_m3u_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_m3u_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_m3u_la_LIBADD = $(LIB_KSYCOCA) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/mp3/Makefile.am b/kfile-plugins/mp3/Makefile.am index 71f8239b..0c238b67 100644 --- a/kfile-plugins/mp3/Makefile.am +++ b/kfile-plugins/mp3/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_mp3.h kde_module_LTLIBRARIES = kfile_mp3.la kfile_mp3_la_SOURCES = kfile_mp3.cpp -kfile_mp3_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor $(taglib_libs) -module $(KDE_PLUGIN) +kfile_mp3_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor $(taglib_libs) -module $(KDE_PLUGIN) kfile_mp3_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/mpc/Makefile.am b/kfile-plugins/mpc/Makefile.am index 89b04866..11a639e7 100644 --- a/kfile-plugins/mpc/Makefile.am +++ b/kfile-plugins/mpc/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_mpc.h kde_module_LTLIBRARIES = kfile_mpc.la kfile_mpc_la_SOURCES = kfile_mpc.cpp -kfile_mpc_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor $(taglib_libs) -module $(KDE_PLUGIN) +kfile_mpc_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor $(taglib_libs) -module $(KDE_PLUGIN) kfile_mpc_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/mpeg/Makefile.am b/kfile-plugins/mpeg/Makefile.am index 7b5392b6..00b40647 100644 --- a/kfile-plugins/mpeg/Makefile.am +++ b/kfile-plugins/mpeg/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_mpeg.h kde_module_LTLIBRARIES = kfile_mpeg.la kfile_mpeg_la_SOURCES = kfile_mpeg.cpp -kfile_mpeg_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_mpeg_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_mpeg_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/ogg/Makefile.am b/kfile-plugins/ogg/Makefile.am index a5080db7..b53709a8 100644 --- a/kfile-plugins/ogg/Makefile.am +++ b/kfile-plugins/ogg/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_ogg.h kde_module_LTLIBRARIES = kfile_ogg.la kfile_ogg_la_SOURCES = kfile_ogg.cpp vcedit.c -kfile_ogg_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_ogg_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_ogg_la_LIBADD = $(LIB_KIO) -logg -lvorbis -lvorbisfile # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/sid/Makefile.am b/kfile-plugins/sid/Makefile.am index 834236b4..8f7d59be 100644 --- a/kfile-plugins/sid/Makefile.am +++ b/kfile-plugins/sid/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_sid.h kde_module_LTLIBRARIES = kfile_sid.la kfile_sid_la_SOURCES = kfile_sid.cpp -kfile_sid_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_sid_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_sid_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/theora/Makefile.am b/kfile-plugins/theora/Makefile.am index 9b0d73d3..a2495cec 100644 --- a/kfile-plugins/theora/Makefile.am +++ b/kfile-plugins/theora/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_theora.h kde_module_LTLIBRARIES = kfile_theora.la kfile_theora_la_SOURCES = kfile_theora.cpp -kfile_theora_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_theora_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_theora_la_LIBADD = $(LIB_KIO) -logg -lvorbis -ltheora # let automoc handle all of the meta source files (moc) diff --git a/kfile-plugins/wav/Makefile.am b/kfile-plugins/wav/Makefile.am index 05843fb3..5254d014 100644 --- a/kfile-plugins/wav/Makefile.am +++ b/kfile-plugins/wav/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = kfile_wav.h kde_module_LTLIBRARIES = kfile_wav.la kfile_wav_la_SOURCES = kfile_wav.cpp -kfile_wav_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module $(KDE_PLUGIN) +kfile_wav_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module $(KDE_PLUGIN) kfile_wav_la_LIBADD = $(LIB_KIO) # let automoc handle all of the meta source files (moc) diff --git a/kmid/ChangeLog b/kmid/ChangeLog deleted file mode 100644 index 6914c1d0..00000000 --- a/kmid/ChangeLog +++ /dev/null @@ -1,104 +0,0 @@ -0.1 30-10-97 ------ -------- -First version - -0.2 9-11-97 ------ ------- -Better syncronization between lyrics and music. -Drag&Drop, better installation, icons, Customizable fonts. - -0.3 16-11-97 ------ -------- -The lyrics handler is very improved. -Option to automagically select lyrics or text. -Better handling for broken files. -Few bug fixes. -Real Session Management. -First rpm version. - -0.4 30-12-97 ------ -------- -Fixed the pthread bug (sorry to everyone that suffered it ;-)) -Added support for AWE and GUS cards -Can modify the midi device without recompiling. -Can play gzipped files - -0.41 22-2-98 ------ ------- -Fixed a problem with GUS cards -Improved midi mapper -Fixed a non-feature :-) related to FM -New icon and toolbar pixmaps which use fewer colors - -0.5 15-3-98 ------ ------- -FM support -Playlists (Collections) -Some small improvements here and there - -0.5.1 15-3-98 ------ ------- -A very small bug fix - -0.5.2 5-4-98 ------ ------ -Save Lyrics -Some bug fixes -More keys binded to functions (arrows, space, backspace, etc.) - -0.5.3 24-4-98 ------ ------- -Improved Synchronization between gui and player -Some bug fixes: - - One which caused kmid to freeze when playing a collection with only 1 song - in aleatory mode and changing to next song - (reported by Jose Luis Sanchez) - - It was not possible to play a gzipped file that have spaces in its name - - There were some songs that played at a lower volume when moving the - slider, but not if playing from the beginning. -Better support for shuffle mode (now it doesn't repeat songs :-)) - -0.6 7-5-98 ------ ------ -Just thought that everything worked fine and did a major release to -put it in my homepage - -1.0 22-6-98 ------ ------- -Well, I should be studying, but KDE 1.0 good deserves a few minutes -to change the version number everywhere, remove debug printfs, and -clean the latest bugs, isn't it ? :-) - -1.2 14-9-98 ------ ------- -This version includes a new ChannelView to see notes played by each -instrument and a volume bar. -It also has some bug fixes and support for really broken midi files. - -1.6 27-11-98 ------ -------- -This version fix a bug that made kmid totally unusable to many users -because it played music at different tempos (sometimes faster and -sometimes slower), without any rhythm. Anyway, this isn't a public -version yet, it's only available from CVS. - -1.7 2-4-99 ------ ------- -Modified KMid to work with Linux kernels from the 2.2.x series which -work very different than the ones in 2.0.x . That problem made KMid -continue playing music for a while (up to a few minutes !) after the -user had pressed the stop button. -Fixed a problem with AWE cards that made it play files with the pitch -bender raised. -Fixed a problem that made kmid not to play the last few milliseconds of -some songs (sometimes up to half a second) -Another usual fixes (better support for kernel modules, workarounds for -compiler bugs, etc.) - -2.0 1-10-2000 ------ --------- -KMid has been ported to KDE 2.0 -Now has a separated ui and engine, it also has native ALSA support -It's a part now, so you can embed KMid in Konqueror and other apps. -Ah, and the scroll is smooth now :) - diff --git a/kmid/Makefile.am b/kmid/Makefile.am deleted file mode 100644 index 6ac77820..00000000 --- a/kmid/Makefile.am +++ /dev/null @@ -1,74 +0,0 @@ -INCLUDES = $(all_includes) - -kde_module_LTLIBRARIES = libkmidpart.la -lib_LTLIBRARIES = libkmidlib.la - -libkmidlib_la_LDFLAGS = $(all_libraries) -libkmidlib_la_LIBADD = $(LIB_KFILE) $(LIB_KPARTS) $(LIB_KIO) -lkmid $(LIB_QT) $(LIB_TDEUI) -lDCOP $(LIB_TDECORE) - -libkmidpart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -libkmidpart_la_LIBADD = libkmidlib.la - -libkmidlib_la_SOURCES = kmidframe.cpp kmidclient.cpp kdisptext.cpp \ - qslidertime.cpp klcdnumber.cpp ktrianglebutton.cpp \ - midicfgdlg.cpp collectdlg.cpp randomlist.cpp \ - channelview.cpp channel.cpp channel3d.cpp channel4d.cpp \ - channelcfgdlg.cpp instrname.cpp rhythmview.cpp \ - songlist.cpp slman.cpp kmid_part.cpp kmidIface.skel - -libkmidpart_la_SOURCES = part_dummy.cpp - -part_dummy.cpp: - touch part_dummy.cpp - -noinst_HEADERS = kmidframe.h kmidclient.h kdisptext.h \ - qslidertime.h klcdnumber.h ktrianglebutton.h \ - midicfgdlg.h collectdlg.h randomlist.h \ - channelview.h channel.h channel3d.h channel4d.h \ - channelcfgdlg.h instrname.h rhythmview.h \ - songlist.h slman.h kmid_part.h - -kmid_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -kmid_SOURCES = main.cpp -kmid_LDADD = libkmidlib.la - -bin_PROGRAMS = kmid -METASOURCES = AUTO - -servicetype_DATA = audiomidi.desktop -servicetypedir = $(kde_servicetypesdir) - -SUBDIRS = maps examples pics - -xdg_apps_DATA = kmid.desktop - -mime_DATA = x-karaoke.desktop -mimedir = $(kde_mimedir)/audio - -rc_DATA = kmidui.rc -rcdir = $(kde_datadir)/kmid - -KDE_ICON = kmid - -fmpatches_DATA = std.sb drums.sb std.o3 drums.o3 -fmpatchesdir = $(kde_datadir)/kmid/fm - -partdir = $(kde_datadir)/kmid -part_DATA = kmid_partui.rc - -channelview_DATA = keyboard.xpm button1.xpm button2.xpm -channelviewdir = $(kde_datadir)/kmid/icons - -EXTRA_DIST = $(xdg_apps_DATA) $(mime_DATA) $(fmpatches_DATA) $(part_DATA) - -instrname.i18n: instrname.cpp - echo "/* This is an automatically generated file" > instrname.i18n - echo " * DO NOT EDIT !!!" >> instrname.i18n - echo " * To create this file run : ""make instrname.i18n"" " >> instrname.i18n - echo " */" >> instrname.i18n - echo "" >> instrname.i18n - awk -f instrfilter.awk instrname.cpp >> instrname.i18n - - -messages: instrname.i18n rc.cpp - $(XGETTEXT) *.cpp instrname.i18n -o $(podir)/kmid.pot diff --git a/kmid/PEOPLE b/kmid/PEOPLE deleted file mode 100644 index 4cd777c2..00000000 --- a/kmid/PEOPLE +++ /dev/null @@ -1,4 +0,0 @@ -Please take a look at the online help for a list of people who have helped -me in the development of KMid (emotionally or with patches :-) ). - - - Antonio Larrosa diff --git a/kmid/README b/kmid/README deleted file mode 100644 index 52c5f759..00000000 --- a/kmid/README +++ /dev/null @@ -1,123 +0,0 @@ -********************************************************************** - KKK KK MMM MMM IIIIII DDDDD - KKK KK MMMMMMMMMM IIII DDDDDDD - KKKKK MMMMMMMMMM II DDD DD - Console KKKKKK MMM MM MMM IIII DDDDDDD - KKK KKK MMM MMM IIIIII DDDDD - - ConsoleKMID - - - This info is up to date if you have KMid version 1.7 - -________________________________________________ -If you are looking for a KMid README file, then this is NOT the one you are -looking for. Please look the online documentation, that is, the html help - -I've left this file only for help on the small cousin of KMid, ConsoleKMid. - - - Antonio Larrosa ------------------------------------------------- - -Index -------- - 1. What is ConsoleKMid ? - 2. Requirements of consoleKMid - 3. Compiling consoleKMid - 4. Installing - 5. Running - 6. How do I use a Midi Mapper ? - 7. Where can I download KMid and consoleKMid from ? - 8. To do list - -1. What is ConsoleKMid ? ------------------------- - ConsoleKMid is a small program for Unix in console mode, which uses the same - player engine of KMid. Of course it doesn't have the same friendly - interface of KMid but it works to play midi files. - - If you have the rpm distribution, you will not find the consolekmid program - unless you have compiled it from the src.rpm distribution - - -2. Requirements of consoleKMid -------------------------------- - - A UNIX machine, a soundcard and a /dev/sequencer device well installed. - If you have a GUS, you need a properly installed driver from the Linux - Ultrasound Project, AWE cards are also supported, but you will probably - need to compile consoleKMid in order to get an AWE card to work. - FM devices are also supported. - I have only tested KMid in Linux, but I have had sucessful reports getting - KMid to work on FreeBSD - If you sucessfully run KMid in other unices, please tell me ! - - Currently GUS cards make a little sound when using the oss driver, but are - not supported officially, I'm looking to find people with GUS cards that - want to help me to provide such support (either programming or testing), - as I think that if nobody has worried about it it's because there's no - need for it ;-) - -3. Compiling consoleKMid ------------------ - Do a configure from the parent directory, then go to the player directory, - and do a 'make' . Simple , isn't it ? - - By default it will use the external midi device, if you want to use another - one (fm, awe, or anything else), edit the file main.cc and change the value - of DEFAULT_DEVICE to the one you want, or specify the -d option as in : - - consolekmid -d 1 mymidifile.mid - -4. Installing ------------------ - No installing of consoleKMid is actually done, just copy the consoleKMid file - yourself to where you want (usually /usr/local/bin ). To use the fm device, - you should specify in fmout.cc the path to where the fm patches are installed - ( /etc by default) - -5. Running --------------- - Well, it's quite easy, just type "consolekmid" and it should run :-) - -6. How do I use a Midi Mapper ? -------------------------------- - A Midi Mapper is the feature you have been waiting for in Linux for years, - (at least I have been :-) it makes a non General Midi synth, appear to the - computer as General Midi compliant. Thus, a GM synth is emulated with a - nonGM. - Look the KMid docs for more info on creating/using a midi map. - If you want to use one with consolekmid, you can use the -M option, - use it like this example : - - consolekmid -M /opt/kde/share/apps/kmid/maps/YamahaPSS790.map mymidifile - - You can also edit main.cc in the player directory and change the value of - DEFAULT_MAP to whatever you want, so that you don't need to specify the - -M option each time you run consolekmid. - - If you want to define a new map for your midi keyboard, I recommend you to - start by copying the file yamaha790.map and modifying it. And remember to - send it to me so that it will be included in future revisions and other - people can use it ! - -7. Where can I download KMid and consoleKMid from ? ---------------------------------------------------- - - KMid's homepage is at : - http://developer.kde.org/~larrosa/kmid.html - - From there you can download latest versions as well as know the latest - changes and improvements of KMid and consoleKMid - -8. To do list ---------------- - GUS support is nearly done (and also SoftOSS) but still need little - improvements. It should mostly work now. - Better AWE support and use Soundfonts - The KMidServer and make KMid use it. - -------- -30-4-2001 -Antonio Larrosa Jimenez -larrosa@kde.org diff --git a/kmid/audiomidi.desktop b/kmid/audiomidi.desktop deleted file mode 100644 index 420045bf..00000000 --- a/kmid/audiomidi.desktop +++ /dev/null @@ -1,3 +0,0 @@ -# This file used to define audio/x-midi, which is already defined as a mime type! -[Desktop Entry] -Hidden=true diff --git a/kmid/button1.xpm b/kmid/button1.xpm deleted file mode 100644 index 93d38a73..00000000 --- a/kmid/button1.xpm +++ /dev/null @@ -1,22 +0,0 @@ -/* XPM */ -static char * button1_xpm[] = { -"16 16 3 1", -" c None", -". c #000000000000", -"X c #FFFF00000000", -" ", -" .... ", -" ........ ", -" .......... ", -" .....XX..... ", -" ...XXXXXX... ", -" ....XXXXXX.... ", -" ...XXXXXXXX... ", -" ...XXXXXXXX... ", -" ....XXXXXX.... ", -" ...XXXXXX... ", -" .....XX..... ", -" .......... ", -" ........ ", -" .... ", -" "}; diff --git a/kmid/button2.xpm b/kmid/button2.xpm deleted file mode 100644 index 8c8922df..00000000 --- a/kmid/button2.xpm +++ /dev/null @@ -1,22 +0,0 @@ -/* XPM */ -static char * button2_xpm[] = { -"16 16 3 1", -" c None", -". c #000000000000", -"X c #0000FFFF0000", -" ", -" .... ", -" ........ ", -" .......... ", -" .....XX..... ", -" ...XXXXXX... ", -" ....XXXXXX.... ", -" ...XXXXXXXX... ", -" ...XXXXXXXX... ", -" ....XXXXXX.... ", -" ...XXXXXX... ", -" .....XX..... ", -" .......... ", -" ........ ", -" .... ", -" "}; diff --git a/kmid/channel.cpp b/kmid/channel.cpp deleted file mode 100644 index 214dcc18..00000000 --- a/kmid/channel.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/************************************************************************** - - channel.cpp - The KMidChannel widget (with pure virtual members) - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include "kmidbutton.h" - -#include "channel.h" -#include "instrname.h" -#include - -KMidChannel::KMidChannel(int chn,TQWidget *parent) : TQWidget (parent) -{ - channel=chn; - replay=TRUE; - int i; - for (i=0;i<128;i++) pressed[i]=0; - keyboard = TQPixmap(locate("appdata","icons/keyboard.xpm")); - penB = new TQPen (black); - penW = new TQPen (white); - penT = new TQPen (colorGroup().background()); - - TDEConfig *kcfg=TDEGlobal::instance()->config(); - kcfg->setGroup("KMid"); - TQFont *qtextfontdefault=new TQFont("lucida",18,TQFont::Bold,TRUE); - qcvfont=new TQFont(kcfg->readFontEntry("ChannelViewFont",qtextfontdefault)); - delete qtextfontdefault; - - instrumentCombo = new TQComboBox(FALSE,this,"instr"); - instrumentCombo->setGeometry(160,2,200,20); - - for (i=0;i<128;i++) - instrumentCombo->insertItem(i18n(instrumentName[i]),i); - - connect(instrumentCombo,TQT_SIGNAL(activated(int)),this,TQT_SLOT(pgmChanged(int))); - - forcepgm=new KMidButton(this,"forcepgm"); - forcepgm->setGeometry(135,4,16,16); - forcepgm->setToggleButton(TRUE); - button1 = TQPixmap(locate("appdata","icons/button1.xpm")); - button2 = TQPixmap(locate("appdata","icons/button2.xpm")); - forcepgm->setPixmaps(button1,button2); - forcepgm->show(); - connect(forcepgm,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(changeForcedState(bool))); - -} - -KMidChannel::~KMidChannel() -{ - delete penB; - delete penW; - delete penT; -} - -void KMidChannel::paintEvent( TQPaintEvent * ) -{ - - TQPainter *qpaint=new TQPainter(this); - - TQString tmp = i18n("Channel %1").arg(channel); - qpaint->setFont(*qcvfont); - qpaint->setPen(*penB); - qpaint->drawText(2,20,tmp); - qpaint->setPen(*penW); - qpaint->drawText(0,18,tmp); - - drawKeyboard(qpaint); - drawPressedKeys(qpaint); - - delete qpaint; -} - -void KMidChannel::drawKeyboard(TQPainter *qpaint) -{ - int x=1; - for (int i=0;(i<12) && (xdrawPixmap(x,KEYBOARDY,keyboard); - }; - qpaint->setPen(*penB); - qpaint->drawLine(0,KEYBOARDY,0,KEYBOARDY+44); - - qpaint->setPen(*penT); - qpaint->drawLine(0,KEYBOARDY+45,x+63,KEYBOARDY+45); - - -} - -void KMidChannel::drawPressedKeys(TQPainter *qpaint) -{ - for (int i=0;i<128;i++) - if (pressed[i]) drawKey(qpaint,i); -} - -void KMidChannel::drawKey(TQPainter *qpaint,int key) -{ - int octave=key/12; - int note=key%12; - int x=octave*63+1; - - switch (note) - { - case (0) : drawDo (qpaint,x,pressed[key]);break; - case (1) : drawDo__ (qpaint,x,pressed[key]);break; - case (2) : drawRe (qpaint,x,pressed[key]);break; - case (3) : drawRe__ (qpaint,x,pressed[key]);break; - case (4) : drawMi (qpaint,x,pressed[key]);break; - case (5) : drawFa (qpaint,x,pressed[key]);break; - case (6) : drawFa__ (qpaint,x,pressed[key]);break; - case (7) : drawSol (qpaint,x,pressed[key]);break; - case (8) : drawSol__(qpaint,x,pressed[key]);break; - case (9) : drawLa (qpaint,x,pressed[key]);break; - case (10) : drawLa__ (qpaint,x,pressed[key]);break; - case (11) : drawSi (qpaint,x,pressed[key]);break; - }; -// qpaint->flush(); -} - -void KMidChannel::noteOn(int key) -{ - pressed[key]=1; - TQPainter *qpaint=new TQPainter(this); - drawKey(qpaint,key); - delete qpaint; -} - -void KMidChannel::noteOff(int key) -{ - pressed[key]=0; - TQPainter *qpaint=new TQPainter(this); - drawKey(qpaint,key); - delete qpaint; -} - -void KMidChannel::changeInstrument(int pgm) -{ - instrumentCombo->setCurrentItem(pgm); -} - -void KMidChannel::changeForceState(bool i) -{ - replay=FALSE; - forcepgm->setOn(i); - replay=TRUE; -} - -void KMidChannel::reset(int level) -{ - for (int i=0;i<128;i++) pressed[i]=0; - if (level>=1) - { - instrumentCombo->setCurrentItem(0); - replay=FALSE; - forcepgm->setOn(FALSE); - replay=TRUE; - }; - - repaint(FALSE); -} - -void KMidChannel::saveState(bool *p,int *pgm) -{ - for (int i=0;i<128;i++) p[i]=pressed[i]; - *pgm=instrumentCombo->currentItem(); -} - -void KMidChannel::loadState(bool *p,int *pgm) -{ - for (int i=0;i<128;i++) pressed[i]=p[i]; - instrumentCombo->setCurrentItem(*pgm); - repaint(FALSE); -} - -void KMidChannel::pgmChanged(int i) -{ - int data[4]; - data[0]=CHN_CHANGE_PGM; - data[1]=channel; - data[2]=i; - data[3]=0; - - replay=FALSE; - forcepgm->setOn(TRUE); - replay=TRUE; - - emit signalToKMidClient(data); - - -} - - -void KMidChannel::changeForcedState(bool i) -{ - int data[4]; - data[0]=CHN_CHANGE_FORCED_STATE; - data[1]=channel; - data[2]=i; - data[3]=(replay)? 1 : 0; - - emit signalToKMidClient(data); - -} -#include "channel.moc" diff --git a/kmid/channel.h b/kmid/channel.h deleted file mode 100644 index 4f88ae36..00000000 --- a/kmid/channel.h +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************** - - channel.h - The KMidChannel widget (with pure virtual members) - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#ifndef KMIDCHANNEL_H -#define KMIDCHANNEL_H -#include -#include - -#define CHANNELHEIGHT 71 -#define KEYBOARDY CHANNELHEIGHT-46 - -#define CHN_CHANGE_PGM 1 -#define CHN_CHANGE_FORCED_STATE 2 - -class TQFont; -class TQComboBox; -class KMidButton; -class KMidChannel : public TQWidget -{ - Q_OBJECT - - -private: - bool pressed[128]; // The 128 keys - int channel; - bool replay; // Indicates if music should restart playing after - // changing the force state - -protected: - TQPixmap keyboard; - TQPixmap button1; - TQPixmap button2; - - TQComboBox *instrumentCombo; - - KMidButton *forcepgm; - TQFont *qcvfont; - - TQPen *penB; // Black - TQPen *penW; // White - TQPen *penT; // "Transparent" for Background - - void paintEvent( TQPaintEvent * ); -public: - KMidChannel(int i,TQWidget *Parent); - virtual ~KMidChannel(); - - void drawKeyboard(TQPainter *qpaint); - void drawPressedKeys(TQPainter *qpaint); - void drawKey(TQPainter *qpaint,int key); - - virtual void drawDo (TQPainter *qpaint,int x,int p) = 0; - virtual void drawDo__ (TQPainter *qpaint,int x,int p) = 0; - virtual void drawRe (TQPainter *qpaint,int x,int p) = 0; - virtual void drawRe__ (TQPainter *qpaint,int x,int p) = 0; - virtual void drawMi (TQPainter *qpaint,int x,int p) = 0; - virtual void drawFa (TQPainter *qpaint,int x,int p) = 0; - virtual void drawFa__ (TQPainter *qpaint,int x,int p) = 0; - virtual void drawSol (TQPainter *qpaint,int x,int p) = 0; - virtual void drawSol__(TQPainter *qpaint,int x,int p) = 0; - virtual void drawLa (TQPainter *qpaint,int x,int p) = 0; - virtual void drawLa__ (TQPainter *qpaint,int x,int p) = 0; - virtual void drawSi (TQPainter *qpaint,int x,int p) = 0; - - void noteOn(int key); - void noteOff(int key); - void changeInstrument(int pgm); - void changeForceState(bool i); - - void reset(int level=1); // 0 only release notes, 1 also set instr to 0 ... - - void saveState(bool *p,int *pgm); - void loadState(bool *p,int *pgm); - -public slots: - void pgmChanged(int i); - void changeForcedState(bool); - -signals: - void signalToKMidClient(int *data); - -}; - -#endif diff --git a/kmid/channel3d.cpp b/kmid/channel3d.cpp deleted file mode 100644 index d3bef7fd..00000000 --- a/kmid/channel3d.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************************************** - - channel3d.cpp - KMidChannel3D widget, a Channel widget with 3D look - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#include "channel3d.h" -#include - -KMidChannel3D::KMidChannel3D (int chn,TQWidget *parent) : KMidChannel(chn,parent) -{ -} - -void KMidChannel3D::drawDo(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x,KEYBOARDY+43,x+6,KEYBOARDY+43); - qpaint->drawLine(x,KEYBOARDY+44,x+6,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x-1,KEYBOARDY+45,x+8,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+7,KEYBOARDY+28,x+7,KEYBOARDY+42); -} -void KMidChannel3D::drawDo__(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+6,KEYBOARDY+2,x+6,KEYBOARDY+25); - qpaint->drawLine(x+7,KEYBOARDY+25,x+11,KEYBOARDY+25); - - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+11,KEYBOARDY+1,x+11,KEYBOARDY+27); - qpaint->drawPoint(x+10,KEYBOARDY+27); - -} -void KMidChannel3D::drawRe(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+9,KEYBOARDY+43,x+15,KEYBOARDY+43); - qpaint->drawLine(x+9,KEYBOARDY+44,x+15,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+8,KEYBOARDY+45,x+17,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+16,KEYBOARDY+28,x+16,KEYBOARDY+42); -} -void KMidChannel3D::drawRe__(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+15,KEYBOARDY+2,x+15,KEYBOARDY+25); - qpaint->drawLine(x+16,KEYBOARDY+25,x+20,KEYBOARDY+25); - - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+20,KEYBOARDY+1,x+20,KEYBOARDY+27); - qpaint->drawPoint(x+19,KEYBOARDY+27); -} -void KMidChannel3D::drawMi(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+18,KEYBOARDY+43,x+24,KEYBOARDY+43); - qpaint->drawLine(x+18,KEYBOARDY+44,x+24,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+17,KEYBOARDY+45,x+26,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+25,KEYBOARDY+1,x+25,KEYBOARDY+42); -} -void KMidChannel3D::drawFa(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+27,KEYBOARDY+43,x+33,KEYBOARDY+43); - qpaint->drawLine(x+27,KEYBOARDY+44,x+33,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+26,KEYBOARDY+45,x+35,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+34,KEYBOARDY+28,x+34,KEYBOARDY+42); -} -void KMidChannel3D::drawFa__(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+33,KEYBOARDY+2,x+33,KEYBOARDY+25); - qpaint->drawLine(x+34,KEYBOARDY+25,x+38,KEYBOARDY+25); - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+38,KEYBOARDY+1,x+38,KEYBOARDY+27); - qpaint->drawPoint(x+37,KEYBOARDY+27); -} -void KMidChannel3D::drawSol(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+36,KEYBOARDY+43,x+42,KEYBOARDY+43); - qpaint->drawLine(x+36,KEYBOARDY+44,x+42,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+35,KEYBOARDY+45,x+44,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+43,KEYBOARDY+28,x+43,KEYBOARDY+42); -} -void KMidChannel3D::drawSol__(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+42,KEYBOARDY+2,x+42,KEYBOARDY+25); - qpaint->drawLine(x+43,KEYBOARDY+25,x+47,KEYBOARDY+25); - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+47,KEYBOARDY+1,x+47,KEYBOARDY+27); - qpaint->drawPoint(x+46,KEYBOARDY+27); -} -void KMidChannel3D::drawLa(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+45,KEYBOARDY+43,x+51,KEYBOARDY+43); - qpaint->drawLine(x+45,KEYBOARDY+44,x+51,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+44,KEYBOARDY+45,x+53,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+52,KEYBOARDY+28,x+52,KEYBOARDY+42); -} -void KMidChannel3D::drawLa__(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+51,KEYBOARDY+2,x+51,KEYBOARDY+25); - qpaint->drawLine(x+52,KEYBOARDY+25,x+56,KEYBOARDY+25); - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+56,KEYBOARDY+1,x+56,KEYBOARDY+27); - qpaint->drawPoint(x+55,KEYBOARDY+27); -} -void KMidChannel3D::drawSi(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+54,KEYBOARDY+43,x+60,KEYBOARDY+43); - qpaint->drawLine(x+54,KEYBOARDY+44,x+60,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+53,KEYBOARDY+45,x+62,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+61,KEYBOARDY+1,x+61,KEYBOARDY+42); -} diff --git a/kmid/channel3d.h b/kmid/channel3d.h deleted file mode 100644 index a8c81da0..00000000 --- a/kmid/channel3d.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** - - channel3d.h - KMidChannel3D widget, a Channel widget with 3D look - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#ifndef KMIDCHANNEL3D_H -#define KMIDCHANNEL3D_H - -#include "channel.h" - -class KMidChannel3D : public KMidChannel -{ -public: - KMidChannel3D(int chn,TQWidget *parent); - - - virtual void drawDo (TQPainter *qpaint,int x,int p); - virtual void drawDo__ (TQPainter *qpaint,int x,int p); - virtual void drawRe (TQPainter *qpaint,int x,int p); - virtual void drawRe__ (TQPainter *qpaint,int x,int p); - virtual void drawMi (TQPainter *qpaint,int x,int p); - virtual void drawFa (TQPainter *qpaint,int x,int p); - virtual void drawFa__ (TQPainter *qpaint,int x,int p); - virtual void drawSol (TQPainter *qpaint,int x,int p); - virtual void drawSol__(TQPainter *qpaint,int x,int p); - virtual void drawLa (TQPainter *qpaint,int x,int p); - virtual void drawLa__ (TQPainter *qpaint,int x,int p); - virtual void drawSi (TQPainter *qpaint,int x,int p); - - -}; - -#endif diff --git a/kmid/channel4d.cpp b/kmid/channel4d.cpp deleted file mode 100644 index 4f47c3ae..00000000 --- a/kmid/channel4d.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/************************************************************************** - - channel4d.cpp - KMidChannel4D widget, with 3D look and filled - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#include "channel4d.h" -#include - -KMidChannel4D::KMidChannel4D (int chn,TQWidget *parent) : KMidChannel(chn,parent) -{ - brushR = new TQBrush (red); - brushW = new TQBrush (white); - brushB = new TQBrush (black); - penR = new TQPen (red); -} - - -void KMidChannel4D::drawDo(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penR):(*penB)); - - qpaint->drawLine(x,KEYBOARDY+43,x+6,KEYBOARDY+43); - qpaint->drawLine(x,KEYBOARDY+44,x+6,KEYBOARDY+44); - - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x-1,KEYBOARDY+45,x+8,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+7,KEYBOARDY+28,x+7,KEYBOARDY+42); - - qpaint->fillRect(x,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); - qpaint->fillRect(x,KEYBOARDY+1,5,27,((p)?*brushR:*brushW)); - qpaint->setPen(p?(*penR):(*penW)); - qpaint->drawPoint(x+5,KEYBOARDY+27); -} -void KMidChannel4D::drawDo__(TQPainter *qpaint,int x,int p) -{ - qpaint->fillRect(x+6,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); - - if (!p) - { - qpaint->setPen(*penW); - qpaint->drawLine(x+6,KEYBOARDY+2,x+6,KEYBOARDY+25); - qpaint->drawLine(x+7,KEYBOARDY+25,x+11,KEYBOARDY+25); - }; - - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+11,KEYBOARDY+1,x+11,KEYBOARDY+27); - qpaint->drawPoint(x+10,KEYBOARDY+27); - - -} -void KMidChannel4D::drawRe(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penR):(*penB)); - qpaint->drawLine(x+9,KEYBOARDY+43,x+15,KEYBOARDY+43); - qpaint->drawLine(x+9,KEYBOARDY+44,x+15,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+8,KEYBOARDY+45,x+17,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+16,KEYBOARDY+28,x+16,KEYBOARDY+42); - - qpaint->fillRect(x+9,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); - qpaint->fillRect(x+12,KEYBOARDY+1,2,27,((p)?*brushR:*brushW)); - qpaint->setPen(p?(*penR):(*penW)); - qpaint->drawPoint(x+11,KEYBOARDY+27); - qpaint->drawPoint(x+14,KEYBOARDY+27); - -} - -void KMidChannel4D::drawRe__(TQPainter *qpaint,int x,int p) -{ - qpaint->fillRect(x+15,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); - - if (!p) - { - qpaint->setPen(*penW); - qpaint->drawLine(x+15,KEYBOARDY+2,x+15,KEYBOARDY+25); - qpaint->drawLine(x+16,KEYBOARDY+25,x+20,KEYBOARDY+25); - }; - - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+20,KEYBOARDY+1,x+20,KEYBOARDY+27); - qpaint->drawPoint(x+19,KEYBOARDY+27); - - -} -void KMidChannel4D::drawMi(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penR):(*penB)); - qpaint->drawLine(x+18,KEYBOARDY+43,x+24,KEYBOARDY+43); - qpaint->drawLine(x+18,KEYBOARDY+44,x+24,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+17,KEYBOARDY+45,x+26,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+25,KEYBOARDY+1,x+25,KEYBOARDY+42); - - qpaint->fillRect(x+18,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); - qpaint->fillRect(x+21,KEYBOARDY+1,4,27,((p)?*brushR:*brushW)); - qpaint->setPen(p?(*penR):(*penW)); - qpaint->drawPoint(x+20,KEYBOARDY+27); - -} -void KMidChannel4D::drawFa(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penR):(*penB)); - qpaint->drawLine(x+27,KEYBOARDY+43,x+33,KEYBOARDY+43); - qpaint->drawLine(x+27,KEYBOARDY+44,x+33,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+26,KEYBOARDY+45,x+35,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+34,KEYBOARDY+28,x+34,KEYBOARDY+42); - - qpaint->fillRect(x+27,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); - qpaint->fillRect(x+27,KEYBOARDY+1,5,27,((p)?*brushR:*brushW)); - qpaint->setPen(p?(*penR):(*penW)); - qpaint->drawPoint(x+32,KEYBOARDY+27); - -} -void KMidChannel4D::drawFa__(TQPainter *qpaint,int x,int p) -{ - qpaint->fillRect(x+33,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); - if (!p) - { - qpaint->setPen(*penW); - qpaint->drawLine(x+33,KEYBOARDY+2,x+33,KEYBOARDY+25); - qpaint->drawLine(x+34,KEYBOARDY+25,x+38,KEYBOARDY+25); - }; - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+38,KEYBOARDY+1,x+38,KEYBOARDY+27); - qpaint->drawPoint(x+37,KEYBOARDY+27); - -} - -void KMidChannel4D::drawSol(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penR):(*penB)); - qpaint->drawLine(x+36,KEYBOARDY+43,x+42,KEYBOARDY+43); - qpaint->drawLine(x+36,KEYBOARDY+44,x+42,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+35,KEYBOARDY+45,x+44,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+43,KEYBOARDY+28,x+43,KEYBOARDY+42); - - qpaint->fillRect(x+36,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); - qpaint->fillRect(x+39,KEYBOARDY+1,2,27,((p)?*brushR:*brushW)); - qpaint->setPen(p?(*penR):(*penW)); - qpaint->drawPoint(x+38,KEYBOARDY+27); - qpaint->drawPoint(x+41,KEYBOARDY+27); - -} - -void KMidChannel4D::drawSol__(TQPainter *qpaint,int x,int p) -{ - qpaint->fillRect(x+42,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); - - if (!p) - { - qpaint->setPen(*penW); - qpaint->drawLine(x+42,KEYBOARDY+2,x+42,KEYBOARDY+25); - qpaint->drawLine(x+43,KEYBOARDY+25,x+47,KEYBOARDY+25); - }; - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+47,KEYBOARDY+1,x+47,KEYBOARDY+27); - qpaint->drawPoint(x+46,KEYBOARDY+27); - - -} -void KMidChannel4D::drawLa(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penR):(*penB)); - qpaint->drawLine(x+45,KEYBOARDY+43,x+51,KEYBOARDY+43); - qpaint->drawLine(x+45,KEYBOARDY+44,x+51,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+44,KEYBOARDY+45,x+53,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+52,KEYBOARDY+28,x+52,KEYBOARDY+42); - - qpaint->fillRect(x+45,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); - qpaint->fillRect(x+48,KEYBOARDY+1,2,27,((p)?*brushR:*brushW)); - qpaint->setPen(p?(*penR):(*penW)); - qpaint->drawPoint(x+47,KEYBOARDY+27); - qpaint->drawPoint(x+50,KEYBOARDY+27); -} -void KMidChannel4D::drawLa__(TQPainter *qpaint,int x,int p) -{ - qpaint->fillRect(x+51,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); - - if (!p) - { - qpaint->setPen(*penW); - qpaint->drawLine(x+51,KEYBOARDY+2,x+51,KEYBOARDY+25); - qpaint->drawLine(x+52,KEYBOARDY+25,x+56,KEYBOARDY+25); - }; - qpaint->setPen(p?(*penW):(*penB)); - qpaint->drawLine(x+56,KEYBOARDY+1,x+56,KEYBOARDY+27); - qpaint->drawPoint(x+55,KEYBOARDY+27); - -} -void KMidChannel4D::drawSi(TQPainter *qpaint,int x,int p) -{ - qpaint->setPen(p?(*penR):(*penB)); - qpaint->drawLine(x+54,KEYBOARDY+43,x+60,KEYBOARDY+43); - qpaint->drawLine(x+54,KEYBOARDY+44,x+60,KEYBOARDY+44); - qpaint->setPen(p?(*penB):(*penT)); - qpaint->drawLine(x+53,KEYBOARDY+45,x+62,KEYBOARDY+45); - qpaint->setPen(p?(*penB):(*penW)); - qpaint->drawLine(x+61,KEYBOARDY+1,x+61,KEYBOARDY+42); - - qpaint->fillRect(x+54,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); - qpaint->fillRect(x+57,KEYBOARDY+1,4,27,((p)?*brushR:*brushW)); - qpaint->setPen(p?(*penR):(*penW)); - qpaint->drawPoint(x+56,KEYBOARDY+27); -} diff --git a/kmid/channel4d.h b/kmid/channel4d.h deleted file mode 100644 index e6326f4a..00000000 --- a/kmid/channel4d.h +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************** - - channel4d.h - KMidChannel4D widget, with 3D look and filled - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#ifndef KMIDCHANNEL4D_H -#define KMIDCHANNEL4D_H - -#include "channel.h" - -class KMidChannel4D : public KMidChannel -{ -private: - TQBrush *brushR; - TQBrush *brushW; - TQBrush *brushB; - TQPen *penR; - -public: - KMidChannel4D(int chn,TQWidget *parent); - - - virtual void drawDo (TQPainter *qpaint,int x,int p); - virtual void drawDo__ (TQPainter *qpaint,int x,int p); - virtual void drawRe (TQPainter *qpaint,int x,int p); - virtual void drawRe__ (TQPainter *qpaint,int x,int p); - virtual void drawMi (TQPainter *qpaint,int x,int p); - virtual void drawFa (TQPainter *qpaint,int x,int p); - virtual void drawFa__ (TQPainter *qpaint,int x,int p); - virtual void drawSol (TQPainter *qpaint,int x,int p); - virtual void drawSol__(TQPainter *qpaint,int x,int p); - virtual void drawLa (TQPainter *qpaint,int x,int p); - virtual void drawLa__ (TQPainter *qpaint,int x,int p); - virtual void drawSi (TQPainter *qpaint,int x,int p); - - -}; - -#endif diff --git a/kmid/channelcfgdlg.cpp b/kmid/channelcfgdlg.cpp deleted file mode 100644 index db320a28..00000000 --- a/kmid/channelcfgdlg.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include - -#include -#include - -#include "channelview.h" -#include "channelcfgdlg.h" -#include "version.h" -#include -#include - -ChannelViewConfigDialog::ChannelViewConfigDialog(TQWidget *parent,const char *name) : KDialogBase(parent,name,TRUE,i18n("Configure Channel View"),Ok|Cancel, Ok) -{ - TQWidget *page = new TQWidget( this ); - setMainWidget(page); - TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); - qbg = new TQVButtonGroup(i18n("Choose Look Mode"),page,"qbg"); - - rb0=new TQRadioButton(i18n("3D look"),qbg,"3d"); - rb1=new TQRadioButton(i18n("3D - filled"),qbg,"4d"); - - qbg->setExclusive(TRUE); - - topLayout->addWidget( qbg ); - ((ChannelView::lookMode()==0)?rb0:rb1)->setChecked(TRUE); - - connect (qbg, TQT_SIGNAL(pressed(int)),this,TQT_SLOT(modeselected(int))); -} - -void ChannelViewConfigDialog::modeselected(int idx) -{ -selectedmode=idx; -} - -int ChannelViewConfigDialog::selectedmode; -#include "channelcfgdlg.moc" diff --git a/kmid/channelcfgdlg.h b/kmid/channelcfgdlg.h deleted file mode 100644 index c4378e4e..00000000 --- a/kmid/channelcfgdlg.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** - - channelcfgdlg.h - The channel view config dialog - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _channelcfgdlg_h_ -#define _channelcfgdlg_h_ - -#include - -class TQVButtonGroup; -class TQRadioButton; -class ChannelViewConfigDialog : public KDialogBase -{ - Q_OBJECT - - -public: - - ChannelViewConfigDialog(TQWidget *parent,const char *name); - -private: - TQVButtonGroup *qbg; - TQRadioButton *rb0; - TQRadioButton *rb1; - -public slots: - void modeselected(int idx); - -public: - static int selectedmode; -}; - -#endif diff --git a/kmid/channelview.cpp b/kmid/channelview.cpp deleted file mode 100644 index fe9043f0..00000000 --- a/kmid/channelview.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/************************************************************************** - - channelview.cpp - The ChannelView dialog - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#include -#include - -#include "channelview.h" -#include "channel3d.h" -#include "channel4d.h" -#include - - -ChannelView::ChannelView(void) : KMainWindow(0, "ChannelView") -{ - setCaption(i18n("Channel View")); - for (int i=0;i<16;i++) - { - if (lookMode()==0) - Channel[i]=new KMidChannel3D(i+1,this); - else - Channel[i]=new KMidChannel4D(i+1,this); - connect(Channel[i],TQT_SIGNAL(signalToKMidClient(int *)),this,TQT_SLOT(slottokmidclient(int *))); - Channel[i]->setGeometry(5,5+i*CHANNELHEIGHT,width()-20,CHANNELHEIGHT); - Channel[i]->show(); - } - scrollbar=new TQScrollBar(1,16,1,1,1,Qt::Vertical,this,"Channelscrollbar"); - connect(scrollbar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(ScrollChn(int))); - setScrollBarRange(); -} - -ChannelView::~ChannelView() -{ - -} - -void ChannelView::closeEvent(TQCloseEvent *e) -{ - emit destroyMe(); - e->accept(); -} - -void ChannelView::resizeEvent(TQResizeEvent *) -{ - scrollbar->setGeometry(width()-16,0,16,height()); - for (int i=0;i<16;i++) - { - Channel[i]->setGeometry(5,5+(i-(scrollbar->value()-1))*CHANNELHEIGHT,width()-20,CHANNELHEIGHT); - } - setScrollBarRange(); - -} - -void ChannelView::setScrollBarRange(void) -{ - nvisiblechannels=height()/CHANNELHEIGHT; - if (nvisiblechannels<16) - scrollbar->setRange(1,16-nvisiblechannels+1); - else - scrollbar->setRange(1,1); -} - -void ChannelView::ScrollChn(int v) -{ - for (int i=0;i<16;i++) - { - Channel[i]->move(5,5+(i-(v-1))*CHANNELHEIGHT); - } -} - -void ChannelView::noteOn(int chn,int note) -{ - Channel[chn]->noteOn(note); -} - -void ChannelView::noteOff(int chn,int note) -{ - Channel[chn]->noteOff(note); -} - -void ChannelView::changeInstrument(int chn,int pgm) -{ - Channel[chn]->changeInstrument(pgm); -} - -void ChannelView::changeForceState(int chn,bool i) -{ - Channel[chn]->changeForceState(i); -} - - -void ChannelView::reset(int level) -{ - for (int i=0;i<16;i++) - { - Channel[i]->reset(level); - } -} - -int ChannelView::lookmode=0; - -int ChannelView::lookMode(void) -{ - TDEConfig *kcfg=(TDEApplication::kApplication())->config(); - - kcfg->setGroup("KMid"); - lookmode=kcfg->readNumEntry("ChannelViewLookMode",0); - - return lookmode; -} - -void ChannelView::lookMode(int i) -{ - TDEConfig *kcfg=(TDEApplication::kApplication())->config(); - - lookmode=i; - - kcfg->setGroup("KMid"); - kcfg->writeEntry("ChannelViewLookMode",lookmode); - - bool tmp[128]; - int pgm; - for (int i=0;i<16;i++) - { - Channel[i]->saveState(tmp,&pgm); - delete Channel[i]; - - if (lookmode==0) - Channel[i]=new KMidChannel3D(i+1,this); - else - Channel[i]=new KMidChannel4D(i+1,this); - - connect(Channel[i],TQT_SIGNAL(signalToKMidClient(int *)),this,TQT_SLOT(slottokmidclient(int *))); - Channel[i]->setGeometry(5,5+(i-(scrollbar->value()-1))*CHANNELHEIGHT,width()-20,CHANNELHEIGHT); - Channel[i]->loadState(tmp,&pgm); - Channel[i]->show(); - } - -} - -void ChannelView::slottokmidclient(int *data) -{ - emit signalToKMidClient(data); -} -#include "channelview.moc" diff --git a/kmid/channelview.h b/kmid/channelview.h deleted file mode 100644 index a1789467..00000000 --- a/kmid/channelview.h +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************** - - channelview.h - The ChannelView dialog - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#ifndef CHANNELVIEW_H -#define CHANNELVIEW_H - -#include -#include -#include "channel.h" - - -class ChannelView : public KMainWindow -{ - Q_OBJECT - -private: - KMidChannel *Channel[16]; - int nvisiblechannels; - - virtual void resizeEvent(TQResizeEvent *); - virtual void closeEvent(TQCloseEvent *e); - -public: - ChannelView(void); - virtual ~ChannelView(); - - void setScrollBarRange(void); - - void noteOn(int chn,int note); - void noteOff(int chn,int note); - void changeInstrument(int chn,int pgm); - void changeForceState(int chn,bool i); - - void reset(int level=1); - - static int lookMode(void); - - void lookMode(int i); - -public slots: - void ScrollChn(int i); - void slottokmidclient(int *data); - -signals: - void destroyMe(); - void signalToKMidClient(int *data); - -private: - TQScrollBar *scrollbar; - - - static int lookmode; - - -}; -#endif diff --git a/kmid/collectdlg.cpp b/kmid/collectdlg.cpp deleted file mode 100644 index 20ac8def..00000000 --- a/kmid/collectdlg.cpp +++ /dev/null @@ -1,307 +0,0 @@ -/************************************************************************** - - collectdlg.cpp - The collections manager dialog - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "collectdlg.h" -#include "version.h" -#include "songlist.h" -#include "slman.h" - -CollectionDialog::CollectionDialog(SLManager *slm,int selC,TQWidget *parent,const char *name) : TQDialog(parent,name,TRUE) -{ -setCaption(i18n("Collections Manager")); -ok=new KPushButton(KStdGuiItem::ok(),this); -ok->setGeometry(140,200,100,30); -connect(ok,TQT_SIGNAL(clicked()),TQT_SLOT(accept()) ); -cancel=new KPushButton(KStdGuiItem::cancel(),this); -cancel->setGeometry(250,200,100,30); -connect(cancel,TQT_SIGNAL(clicked()),TQT_SLOT(reject()) ); - -label=new TQLabel(i18n("Available collections:"),this); -label->adjustSize(); -label->move(10,10); -collections=new TQListBox(this,"collectionlist"); -collections->setGeometry(10,20+label->height(),340,90); -connect(collections,TQT_SIGNAL(highlighted(int)),TQT_SLOT(collectionselected(int))); -connect(collections,TQT_SIGNAL(selected(int)),TQT_SLOT(changeCollectionName(int))); -slman=slm; -for (int i=0;i<=slman->numberOfCollections();i++) - { - collections->insertItem(i18n( slman->getCollectionName(i) ),i); -#ifdef COLLECTDLGDEBUG - printf("Name : %s\n",slman->getCollectionName(i)); -#endif - }; -selectedC=selC; -#ifdef COLLECTDLGDEBUG -printf("selectedC : %d\n",selectedC); -#endif - -label2=new TQLabel(i18n("Songs in selected collection:"),this); -label2->adjustSize(); -label2->move(10,collections->y()+collections->height()+10); - -songs=new TQListBox(this,"songlist"); -songs->setGeometry(10,label2->y()+label2->height()+10,340,120); -connect(songs,TQT_SIGNAL(highlighted(int)),TQT_SLOT(songselected(int))); -currentsl=slman->getCollection(selectedC); -if (slman->numberOfCollections()>0) - { - collections->setCurrentItem(selectedC); - collections->centerCurrentItem(); - }; -//fillInSongList(); -newC=new TQPushButton(i18n("&New..."),this); -newC->adjustSize(); -newC->move(360,collections->y()+5); -connect(newC,TQT_SIGNAL(clicked()),TQT_SLOT(newCollection()) ); -copyC=new TQPushButton(i18n("&Copy..."),this); -copyC->adjustSize(); -copyC->move(360,newC->y()+newC->height()+5); -connect(copyC,TQT_SIGNAL(clicked()),TQT_SLOT(copyCollection()) ); -deleteC=new TQPushButton(i18n("Delete"),this); -deleteC->adjustSize(); -deleteC->move(360,copyC->y()+copyC->height()+5); -connect(deleteC,TQT_SIGNAL(clicked()),TQT_SLOT(deleteCollection()) ); - -addS=new TQPushButton(i18n("&Add..."),this); -addS->adjustSize(); -addS->move(360,songs->y()+5); -connect(addS,TQT_SIGNAL(clicked()),TQT_SLOT(addSong()) ); -delS=new TQPushButton(i18n("&Remove"),this); -delS->adjustSize(); -delS->move(360,addS->y()+addS->height()+5); -connect(delS,TQT_SIGNAL(clicked()),TQT_SLOT(removeSong()) ); - -ok->move(ok->x(),songs->y()+songs->height()+10); -cancel->move(ok->x()+ok->width()+5,ok->y()); - -setMinimumSize(400,ok->y()+ok->height()+5); -//setMaximumSize(360,240); -} - -void CollectionDialog::collectionselected(int idx) -{ -selectedC=idx; -#ifdef COLLECTDLGDEBUG -printf("Selected collection: %d\n",selectedC); -#endif -currentsl=slman->getCollection(selectedC); -fillInSongList(); -} - -void CollectionDialog::fillInSongList(void) -{ -TQString qs; -songs->clear(); -if (currentsl!=NULL) - { - currentsl->iteratorStart(); - int i=0; - while (!currentsl->iteratorAtEnd()) - { - qs=TQString(currentsl->getIteratorName()); - //KURL::decode(qs); - songs->insertItem(qs,i); - currentsl->iteratorNext(); - i++; - }; - songs->setCurrentItem(currentsl->getActiveSongID()-1); - songs->centerCurrentItem(); - }; -} - -void CollectionDialog::songselected(int idx) -{ -selectedS=idx; -currentsl->setActiveSong(idx+1); - -#ifdef COLLECTDLGDEBUG -printf("Selected song: %d\n",selectedS); -#endif -} - -void CollectionDialog::newCollection() -{ - bool ok; - TQString name = KInputDialog::getText( i18n( "New Collection" ), - i18n( "Enter the name of the new collection:" ), TQString(), - &ok, this ); - - if (ok) - { - int i=slman->createCollection(name.ascii()); - if (i==-1) - { - TQString s = i18n("The name '%1' is already used").arg(name); - KMessageBox::sorry(this, s); - } - else - { - collections->insertItem(name,i); - collections->setCurrentItem(i); - collections->centerCurrentItem(); - }; - }; -} - -void CollectionDialog::copyCollection() -{ -SongList *src=currentsl; -int i; - bool ok; - TQString name = KInputDialog::getText( i18n( "Copy Collection" ), - i18n( "Enter the name of the copy collection:" ), TQString(), - &ok, this ); - - if (ok) - { - i=slman->createCollection(name.ascii()); - if (i==-1) - { - TQString s = i18n("The name '%1' is already used").arg(name); - KMessageBox::sorry(this, s); - } - else - { - collections->insertItem(name,i); - SongList *tgt=slman->getCollection(i); - src->iteratorStart(); - while (!src->iteratorAtEnd()) - { - tgt->AddSong(src->getIteratorName()); - src->iteratorNext(); - }; - collections->setCurrentItem(i); - collections->centerCurrentItem(); - }; - }; -} - -void CollectionDialog::deleteCollection() -{ -if (selectedC==0) return; -slman->deleteCollection(selectedC); -int i=selectedC; -collections->removeItem(selectedC); -collections->setCurrentItem(i); -collections->centerCurrentItem(); -} - -void CollectionDialog::changeCollectionName(int idx) -{ -if (idx==0) return; - bool ok; - - TQString name = KInputDialog::getText( i18n( "Change Collection Name" ), - i18n( "Enter the name of the selected collection:" ), TQString(), - &ok, this ); - - if (ok) - { - if (slman->getCollection(name.ascii())!=NULL) - { - TQString s = i18n("The name '%1' is already used").arg(name); - KMessageBox::sorry(this, s); - } - else - { - slman->changeCollectionName(idx,name.ascii()); - collections->changeItem(name,idx); - }; - }; -} - -void CollectionDialog::addSong(const KURL &url) -{ - if (currentsl==NULL) return; - if( url.isEmpty()) return; - - int id=currentsl->AddSong(TQFile::encodeName(url.path())); - - if (id==-1) - { - printf("Couldn't add song to collection\n"); - return; - }; - - songs->insertItem(url.fileName(),id-1); -} - - -void CollectionDialog::addSong() -{ - KURL::List urls = KFileDialog::getOpenURLs(":MidiFiles", - "*.kar *.mid *.kar.gz *.mid.gz\n*.kar *.kar.gz\n*.mid *.mid.gz\n*",this); - - KURL::List::Iterator it; - for( it = urls.begin(); it != urls.end(); ++it ) - addSong(*it); - -} - -void CollectionDialog::removeSong() -{ -if (currentsl==NULL) return; -currentsl->DelSong(selectedS+1); -int i=selectedS; -songs->removeItem(selectedS); -songs->setCurrentItem(i); -} - -void CollectionDialog::resizeEvent(TQResizeEvent *) -{ -int maxw=newC->width(); -if (copyC->width()>maxw) maxw=copyC->width(); -if (deleteC->width()>maxw) maxw=deleteC->width(); -if (addS->width()>maxw) maxw=addS->width(); -if (delS->width()>maxw) maxw=delS->width(); - -newC->setGeometry(width()-maxw-5,newC->y(),maxw,newC->height()); -copyC->setGeometry(width()-maxw-5,copyC->y(),maxw,copyC->height()); -deleteC->setGeometry(width()-maxw-5,deleteC->y(),maxw,deleteC->height()); - -collections->resize(width()-maxw-20,(height()*35)/100); -label2->move(10,collections->y()+collections->height()+10); -songs->setGeometry(10,label2->y()+label2->height()+10,width()-maxw-20,height()-(label2->y()+label2->height()+10+ok->height()+10)); -addS->setGeometry(width()-maxw-5,songs->y()+5,maxw,addS->height()); -delS->setGeometry(width()-maxw-5,addS->y()+addS->height()+5,maxw,delS->height()); - -cancel->move(width()-cancel->width()-5,height()-cancel->height()-5); -ok->move(cancel->x()-5-ok->width(),height()-ok->height()-5); -} - -int CollectionDialog::selectedC=0; -int CollectionDialog::selectedS=0; -#include "collectdlg.moc" diff --git a/kmid/collectdlg.h b/kmid/collectdlg.h deleted file mode 100644 index 262a6227..00000000 --- a/kmid/collectdlg.h +++ /dev/null @@ -1,84 +0,0 @@ -/************************************************************************** - - collectdlg.h - The collection manager dialog - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _collectdlg_h_ -#define _collectdlg_h_ - -#include -#include "songlist.h" -#include "slman.h" - -class TQLabel; -class KPushButton; -class TQPushButton; -class TQListBox; -class KURL; -class CollectionDialog : public TQDialog -{ - Q_OBJECT - -private: - SLManager *slman; - SongList *currentsl; - -protected: - - virtual void resizeEvent(TQResizeEvent *qre); - void fillInSongList(void); //clear the songs list and insert in it - // the songs in currentsl - void addSong(const KURL &); -public: - - CollectionDialog(SLManager *slm,int selc,TQWidget *parent,const char *name); - -public slots: - void collectionselected(int idx); - void songselected(int idx); - void newCollection(); - void copyCollection(); - void deleteCollection(); - void changeCollectionName(int idx); - void addSong(); - void removeSong(); - -private: -TQLabel *label; -TQLabel *label2; -KPushButton *ok; -KPushButton *cancel; -TQListBox *collections; -TQListBox *songs; -TQPushButton *newC; -TQPushButton *copyC; -TQPushButton *deleteC; -TQPushButton *addS; -TQPushButton *delS; - - -public: -static int selectedC; -static int selectedS; - -}; - -#endif diff --git a/kmid/configure.in.in b/kmid/configure.in.in deleted file mode 100644 index f1e1d100..00000000 --- a/kmid/configure.in.in +++ /dev/null @@ -1,5 +0,0 @@ -KDE_CHECK_HEADER([libkmid/libkmid.h], [kde_mid_compiles=yes], [kde_mid_compiles=no]) -if test $kde_mid_compiles = no; then - DO_NOT_COMPILE="$DO_NOT_COMPILE kmid" -fi - diff --git a/kmid/drums.o3 b/kmid/drums.o3 deleted file mode 100644 index 01d9b9c5..00000000 Binary files a/kmid/drums.o3 and /dev/null differ diff --git a/kmid/drums.sb b/kmid/drums.sb deleted file mode 100644 index 4bfaf8a3..00000000 Binary files a/kmid/drums.sb and /dev/null differ diff --git a/kmid/examples/DiesIrae.kar b/kmid/examples/DiesIrae.kar deleted file mode 100644 index c54c6fb6..00000000 Binary files a/kmid/examples/DiesIrae.kar and /dev/null differ diff --git a/kmid/examples/Guantanamera.kar b/kmid/examples/Guantanamera.kar deleted file mode 100644 index 7fee4b1a..00000000 Binary files a/kmid/examples/Guantanamera.kar and /dev/null differ diff --git a/kmid/examples/Makefile.am b/kmid/examples/Makefile.am deleted file mode 100644 index b53f7c54..00000000 --- a/kmid/examples/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ - -example_DATA = OFortuna.kar DiesIrae.kar Guantanamera.kar \ - MariaDeLasMercedes.kar -exampledir = $(kde_datadir)/kmid - -EXTRA_DIST = $(example_DATA) diff --git a/kmid/examples/MariaDeLasMercedes.kar b/kmid/examples/MariaDeLasMercedes.kar deleted file mode 100644 index 7a2e305e..00000000 Binary files a/kmid/examples/MariaDeLasMercedes.kar and /dev/null differ diff --git a/kmid/examples/OFortuna.kar b/kmid/examples/OFortuna.kar deleted file mode 100644 index cc59960e..00000000 Binary files a/kmid/examples/OFortuna.kar and /dev/null differ diff --git a/kmid/hi16-app-kmid.png b/kmid/hi16-app-kmid.png deleted file mode 100644 index dcad9f23..00000000 Binary files a/kmid/hi16-app-kmid.png and /dev/null differ diff --git a/kmid/hi32-app-kmid.png b/kmid/hi32-app-kmid.png deleted file mode 100644 index 4538ad78..00000000 Binary files a/kmid/hi32-app-kmid.png and /dev/null differ diff --git a/kmid/hi48-app-kmid.png b/kmid/hi48-app-kmid.png deleted file mode 100644 index 928cebca..00000000 Binary files a/kmid/hi48-app-kmid.png and /dev/null differ diff --git a/kmid/history.txt b/kmid/history.txt deleted file mode 100644 index b6ed3407..00000000 --- a/kmid/history.txt +++ /dev/null @@ -1,567 +0,0 @@ -Thursday 11-9-97 -- I have started with some tries to make the midi work and due to the - success I have even made an object to manage the midi : midiOut - -Friday 12-9-97 -- Waking up at 7:00am, working from 8:20 to 11:20 and doing some fixes - at 14:20, I have been able to play a midi file through the /dev/sequencer - using the class midiOut and writing some new classes like : midfile - track and some more. - -Saturday 13-9-97 -- Today I have made a midi mapper (object mapper) which read a map config file - and is used to support older synths without general midi compliance. - -Sunday 14-9-97 -- I have made a window, with a KMenuBar, and a KSilder, which reads a mid file - and play it (using a fork) - -Monday 15-9-97 -- fork copy the memory and thus, I cannot tell the player to pause, I have read - much about the subject, and about threads - -Tuesday 16-9-97 -- I have made a small program to test the threads and forks, threads apparently -are faster, but it seems to have a problem with libqt or anyone, and I get -core dumpes what I run kmid even if I only link libpthread but don't use it. -So I've decided to make a fork, in the other way, I've learned to share memory - -Wednesday 17-9-97 -- Christian Esken has told me to use mediatool, but I don't have the -documentation, so I cannot continue work until I get it. - -Thursday 18-9-97 -- Well, I'll continue even without the docs, and when I have them, I will -make the neccesary changes to the code. I have made a few details in windows - -Friday 19-9-97 -- Today I have made the Pause and Stop buttons work. Also, I have made the -slide bar move. And also, I have made a parser of the midi file, which tells -how long the song is, in seconds. If this was little, I have made the interface -between the ui and the player. - -Saturday 20-9-97 -- The interface between the ui and the player doesn't work well, I have to -redesign it because it's difficult to be accurate writing the karaoke at the same that the note plays - -Sunday 21-9-97 -- I have redesigned twice the interface between ui and player and it still -doesn't work well, the first method was creating a list of the karaoke events -and using a timer to process the next event at the right time, but that doesn't -work perfectly, because the text appears a moment after or before the note is -played. The second method is a while loop, which calls processEvents, but -that isn't a very good option, because, though text appears just at the same -time of the note is played, top tells me that kmid is consuming up to 98% of -CPU time, and I don't want to make such a monster. - -Monday 22-9-97 -- Another failed method, and another passed day - -Tuesday 23-9-97 -- Some small changes beautifying the monster to send it to Christian - -Wednesday 24-9-97 -- More debugging and no result. I have uploaded current version to arrakis for -Christian to see it. - -Thursday 25-9-97 -- Eureka ! , at last, I have made the player and the ui run at the same time -with PERFECT syncronisation :-) (at 10:30 pm) - -Friday,Saturday,Sunday 26,27,28-9-97 -- I've been looking at the birds flying freely from tree to tree in all this -weekend, also, I've studied for the test drive. - -Monday 29-9-97 -- I have passed the exam and also, I have (almost) done the karaoke widget -and it works very well ! - -Tuesday 30-9-97 -- The karaoke widget is finished, it also have a scrollbar to see all the -lyrics. By the way, StarTrek : First Contact is a very recommended film - -Wednesday 1-10-97 -- I have fixed pause and stop, which were broken during the karaoke syncro -By the way, kmid consumes 0.0% CPU and 00:00 time while playing a 6 minute song -(and I think that even in longer songs !) - -Thursday 2-10-97 -- I have started classes, so I think I will have less time :-( - -Wednesday 8-10-97 -- The player now recognizes the SETPOS message, but the ui is not syncronized -yet - -Thursday 9-10-97 -- S. R. has "show"ed me the way to initialize the menu, toolbar and client of a -KTopLevelWidget, without the need to resize the window. - -Sunday 12-10-97 -- I have made that all time variables are expressed in milliseconds, so no -more change units !! - -Sunday 19-10-97 -- I have programmed very little this week, but today I have kill a big bug, -now all the songs play well. Some songs were played with some parts faster and -some parts slower than they should (thanks to Christian Esken for reporting - the bug!) - -Tuesday 21-10-97 -- WOE, KDE-Beta-ONE is even better than before. But now kmid doesn't compile (?) - -Wednesday 22-10-97 -- After compiling the kde libs, kmid compiles ok. KSlider has changed and its -behaviour (Arrrgh!), so I have trickered a little the code. - -Thursday 23-10-97 -- I have cleaned a little the code. - -Friday 24-10-97 -- I started to "rewrite" the track class to make the slider work well - -Saturday 25-10-97 -- I have passed the day working in the time. - -Sunday 26-10-97 -- Eureka !!!, KMid works great! with good timings and syncronization between - O ~ music and lyrics. - U - \_/ - -Monday 27-10-97 -- After 10 hours in the university, I have made the final touches to send -kmid 0.1 to the internet. - -??? 7-11-97 -- Finally, there's an impossible-better syncro between the program -and the user !!!. I mean, that when you press the pause button, the music -is inmediatly paused !!! - -Saturday 8-11-97 -- So I suppose yesterday was Friday, but I should demostrate it :-) -I have added drag & drop support in kmid to load files by dropping them from kfm -Also made the slider show the time played at resizeable steps - -Sunday 9-11-97 -- Today I have made possible to change the font and I have made an icon. -Prepare a version to upload tomorrow to the internet. - -Thursday 13-11-97 -- I have nearly rewritten (made lots of changes to) the lyrics display widget -Also fixed that old "bug" that let in black the last word of a phrase in some -songs. - -Friday 14-11-97 -- Automatic text event chooser is done ! -- Fixed a bug that could freeze kmid under very rare circunstances. -- Added more support for incomplete/broken files - -Saturday 15-11-97 -- I have changed the exit-behaviour for a messagebox-behaviour -- Fixed a bug that could leave the children running when closing kmid - -Sunday 16-11-97 -- KMid adds a mime entry for karaoke files in audio/x-karaoke -- Real Session Management. -- Made the first rpm of kmid. - -Monday 17-11-97 -- Release version 0.3 in tgz and rpm - -Friday 28-11-97 -- I've been quite busy this week, but I have had reports and patches :-) on -how to make kmid to work with an AWE, a GUS, and in FreeBSD :-)))) - -Monday 8-12-97 -- I have fixed a small bug with which the time that a song longs was not well -reported. -- Also a tiny bug in consolekmid - -Tuesday 9-12-97 -- I've made the first feature that I've been asked for. Another thing to map -with the midi mapper for Dietmar's PSR500 - -Friday 12-12-97 -- Nearly done the map chooser so that there will no be needed to edit the kmidrc -for anything. -Now when you choose a new map or change GM/MT32 mode, the music is automatically -changed while playing !. - -...... **-12-97 -- I have been the rest of the month implementing a midi server that I will -call KMidServer and that will provide any application with easy control over -midi functions. - -30-12-97 -- KMid now can play gzipped midi files just as any other normal file. - -.... **-1-98 -- I have improved the midi mapper by allowing to factor the pitch bender. - Now pitch benders works OK !! (at last I have improved the windows mapper :-) - I have also added support to convert expression events to volume events. -* I have been doing the kfourier this month and studying (little time to do more) - - -Thursday 5-2-98 -- After doing my first exam this year, I have decided to calm things a little - by programming something. I have made the options added to the mapper available -through the config map file. - -Monday 9-2-98 -- 2nd exam done and a bug that I introduced last thrusday fixed. - -Friday 20-2-98 -- I've finished exams, have installed the yesterday snapshots and have -updated the configure scripts to add rpath and all that stuff to my copy -of kmid (thanks to Kulow, who added it to kmid in tdemultimedia) - -Saturday 21-2-98 -- Fixed the not-a-feature problem with FM, next time I will not let the -option for the user to select something that doesn't work. -Final touches to release kmid 0.41 tomorrow morning. - -Monday 23-2-98 -- I've started working on FM support (and it goes very fast) - -Tuesday 24-2-98 -- fm already works, but notes are shifted to a higher key !!! -Also pitch bender seems not to be accurate. - -Wednesday 25-2-98 -- pitch bender is now fixed, and also the shift of notes, now the problem - is that some notes are lost (always from the same track/channel/patch?!?!) - -Friday 27-2-98 -- The problem with the lost notes is fixed :-/, the problem was that some -notes are played through the left speaker and some thru the right speaker, -and my wires for the right speaker were broken, but it wasn't noted with -the surround activated :-))))))) (Sometimes I feel real shame). Three days -lost in that !! - -Saturday 28-2-98 -- I've gone to the country and I've done the internals of the playlists in a -486/50 without linux, so I'll compile the Monday. - -Sunday 1-3-98 -- Some test with multiple toolbars. - -Monday 2-3-98 -- Started to do the collections manager dialog - -Tuesday 3-3-98 -- The collections manager dialog is done. - -Wednesday 4-3-98 -- KKeyConfig is a really good class, easy to use to make the karaoke scroll -when arrow keys are pressed. - -Thursday 5-3-98 -- I've done the playlist hardest part, now it works and there's only left - some final touches to do - -Tuesday 10-3-98 -- Playlists are finally working ok. - -Wednesday 11-3-98 -- Fixed the session management (in fact, I've changed it a little to support -collections) - -Thursday 12-3-98 -- Fixed some small bugs. - -Friday 13-3-98 -- I have replaced my new Makefiles.am (just two days old) with the one -of Stephan Kulow which look much better. - -Saturday 14-3-98 -- Finished deleting printf's to upload kmid tomorrow :-) - -Sunday 15-3-98 -- Upload it, but as I forgot to delete some printf messages :-( , I had -to quickly do a fix and send also 0.5.1 - -**** **-3-98 -- I've passed many days configuring the modem, the internet connection, -sendmail, kppp, cvs and all those programs :-) - -Monday 30-3-98 -- I've implemented the save-Lyrics feature that Adrian Knoth suggested (thanks!) - -Tuesday 31-3-98 -- I've done some changes to support the new KFileDialog and the new -changes in tdelibs done by Matthias. - -Thursday 2-4-98 -- Some bug fixes - -Monday 6-4-98 -- I've found and fixed a memory leakage bug, I forgot to delete the -SpecialEvents from each song, so kmid was using more and more memory with -each opened song. - -Tuesday 7-4-98 -- Aaaargh !, I have to remove the changes that I did last tuesday because it -seems that the changes in the tdelibs have been removed. - -Monday 13-4-98 -- Added support for midi files with strange headers not related to midi files. - (suggested by Adrian Knoth, thanks !) - -Friday 24-4-98 -- At last, I have had some free time and have done some things: - 1. Finally fixed the synchronization between gui and player (hopefully forever) - 2. Fixed a problem openning a gzipped file with spaces in its name - 3. Fixed a bug which caused kmid to freeze if collection has only 1 song, and - trying to play next song in aleatory mode. - 4. Fixed the problem which made some songs to play at a lower volume when - moving the slider, but no if playing from the beginning - That's all for now :-) , there have been so many changes that I've call - this version 0.5.3 - -Thursday 7-5-98 -- Released version 0.6 to update my homepage which was getting very outdated - -Saturday 9-5-98 -- After fixing my midi cable, I've noticed that fm is (as Gyula Kerekes - reported), playing in mono, and I've fixed it. - -Sunday 10-5-98 -- I've fixed a small bug with which midi files without text events (nor lyrics) -got the time slider very desynchronized after pausing for a long time. - -Monday 25-5-98 -- Applied a patch submitted by Kevin Street, to compile kmid on FreeBSD 3.0 -systems with awe support (directory settings has changed since 2.2) - -Saturday 20-6-98 -- I'm on exams, but just to relax a few minutes I've been hunting for bugs :-) - -Sunday 21-6-98 -- Wow, KDE-1.0 is finally here, and it is REAL, so I will prepare very quickly -KMid 1.0 before the freeze of tdemultimedia. - -Saturday 4-7-98 -- Just finished exams :-), and I've implemented the (long awaited feature of a) -volume bar. - -Sunday 5-7-98 -- I'm doing a channel view in which you can see the keys being pressed -and released, it's very nice :-) - -Monday 6-7-98 -- Using the (still hot) shutDown signal (the most awaited thing for -kmid) - -Monday 13-7-98 -- I've restructured the Channel view, it's much nicer and allows for easier -expansion. It also shows the used instrument - -Saturday 15-8-98 -- Wow, I haven't updated this file for so long ... - I've finished the changing instrument feature and so the channel view. - I've also improved speed a little by supressing some parses to the midi file. - I have improved consolekmid, now it is much more usuable. - Finally, I've changed the sources to use the KAccel class. - -Monday 31-8-98 -- I've fixed some bugs, the most important one being that kmid left its player - processes as zombies after stopping playing (it worked ok, but now it doesn't, - dunno why). That problem made to appear some weird dialogs telling "song is already - playing" at each moment -- I left a color hardcoded in button*.xpm when it should be Transparent (not - everybody has a window background color of #5D5D8F8FA0A0 :-) ) -- I created a Motif 1.0 combo box in the channelview, but it should be Motif 2.0 - because 1.0 has a "feature" for large como boxes (as this one) - - -Wednesday 9-9-98 -- Fixed the last bug for leaving zombies around. - -Monday 14-9-98 -- Released Version 1.2 - -Tuesday 15-9-98 -- Added the change tempo widget and the KTriangleButton widget - -Wednesday 16-9-98 -- It's possible now to change the tempo of a song. - -Thursday 1-10-98 -- Fixed some problems - -Thursday 15-10-98 -- FIXED !!! - The long awaited fix has arrived for songs keeping playing after X11' logout - when channelview was actived. - Now also the ChannelView change its colors when the user change the - global colors, kdisptext paints a frame over the karaoke text, - KLCDNumber only accepts a range of values (from 3 to 999) - -Friday 16-10-98 -- Improved support for really broken files. -- Added some translations to Spanish - -Friday 23-10-98 -- I've started writing the internals of a rhythm view - -Saturday 24-10-98 -- Now KMid shows a new widget to make easier follow the rhythm of songs. - I've also fixed a small bug by which the tempo (and rhythm) changed its - state before the event actually happening if you moved the timebar near - before the event time. The problem was caused by volatile shared variables. - -Sunday 25-10-98 -- Fixed a serious bug I introduced in the previous commitment - -Monday 2-11-98 -- Fixed some problems - -Sunday 8-11-98 -- Some small changes - -Wednesday 25-11-98 -- I've finally fixed the bug that made kmid play music sometimes -faster and sometimes slower on some machines (i.e. mine, since I installed -kernel 2.0.36) -This bug was there since the real beginning, and now, it is FIXED. -This deserves a new 2.0 version, probably next week. - -Friday 27-11-98 -- Fixed a broken link in the .kdelnk file (DocPath) and raised version -number to 1.6 - -Thursday 10-12-98 -- Added new sgml documentation, updated up to KMid 1.6 - -Friday 11-12-98 -- Fixed a shared memory leackage bug (hopefully the last bug in KMid :) ). - -Thursday 17-12-98 -- Initial support for SoftOSS (this is making some sound now :)) -- Indentified the player directory sources and beautified them a little - -Friday 18-12-98 -- Fixed a geometry layout bug - -Sunday 20-12-98 -- Fixed a problem when [un]installing midi devices (not such a mad idea if you -use kernel modules) that made kmid segfault because it couldn't found -the device. - -Saturday 16-1-99 -- Decode URL before showing it on the screen. - -Thursday 21-1-99 -- Fixed a null pointer access while generating beats, because I didn't -checked for songs which didn't contain any spev (songs which use absolute 0 spev -are extremely rare to find, as any song must include at least a tempo event) - -Tuesday 26-1-99 -- Removed ; after QOBJECT and fixed default midi map in consolekmid (not kmid) - -Sunday 21-2-99 -- Made a quick hack (no more than 15 lines) and kmid uses TDEIOJob to be -net transparent (now it can download files using an http or ftp protocol just -using dnd from a kfm window or using the open file dialog) - -Saturday 6-3-99 -- The sound driver in Linux kernels from the 2.2.x series work very different -than the ones in 2.0.x so kmid was severely damaged. After several days of -hacking (and after getting from A.Cox that this wasn't going to be fixed in the -kernel) I've found a fix that even works in the 2.0.x kernels. - -Sunday 21-3-99 -- Fixed the high pitch of AWE cards (thanks to Joseph H. Buehler and Takashi Iwai for - the indications) -- Raised version number to 1.7 - -Friday 2-4-99 -- Did a workaround for a bug in egcs which doesn't seem to optimize simple -return-a-value function as an inline function when using -O2 and it made kmid -freeze under certain conditions when parsing some midi files. - -- Removed a comparison of double variables which is very dangerous (_even_ after -storing in one of them the value of the other one) -- Fixed a problem by which kmid didn't play the last half second or so of some songs. - -Thursday 8-4-99 -- Fixed a problem that made Kmid consume 99% of CPU since a month ago. Now it's back -to the usual 0.00% of CPU use :-) - -Monday 12-4-99 -- Fixed a bug that made KMid freeze when trying to open a directory - -Thursday 15-4-99 -- Better support for broken karaoke files which has duplicated lyrics - -Thursday 11-11-99 -- Fixed a problem with corrupt files that suddenly doesn't work (but KMid - from the 1.1 branch works ok (?) ). Anyway, I've got it to work even - better with broken files -- Fixed the KLed usage, which was broken since the KLedLamp -> KLed transition. -- Fixed a repaint bug with the time tags that has been here for too long. - -Friday 12-11-99 -- Instead of using manual layout, let's use QLayouts (there are still some - problems with this ) -- Added xdnd support (finally !) - -Thursday 25-11-99 -- Changed a lot of code to look much better -- Fixed many problems when painting lyrics in different colors - -Friday 26-11-99 -- The lyrics display doesn't flicker anymore (finally :-) ) -- Reworked the scrolling code, it's smooth now instead of line-by-line (but also - makes consumes a bit of CPU, so I'll make it configurable for people who don't - want to waste resources) -- note: don't call resizeContents from drawContents, or you'll have some - problems (QScrollView bug ?, anyway, this note should be on the docs) - -Tuesday 11-1-2000 -- SoftOSS is working now ! -- Added LOTS of documentation to the MIDI library. Anyway, there's a lot more -to come. -- Also fixed a few problems in the lyrics display, and added a new option -to consolekmid - -Sunday 27-2-2000 -- Ported KMid to use the "official" LibKMid and KXMLGUI, with the following - result : - # wc kmidframe.cpp - Before: 769 1450 24820 kmidframe.cpp - After : 622 1171 19045 kmidframe.cpp - -Monday 28-2-2000 -- Added ALSA support to libkmid - -Tuesday 29-2-2000 -- I'm making KMid a part - -It took me : exactly 13 minutes to port the app - 30 seconds to do /LD/LIB/ in Makefile.am - 5:14 to compile it and see that kbrowser.h doesn't exist now :( - -Sunday 5-3-2000 -- Now libkmid does build and run on systems where OSS is not installed. -- Updated the code to simplify it a bit due to libkmid changes. -- I still have to search for a bug that makes KMid (and the part!) to crash - when destroying KDisplayText (the curious thing is that it crashes on - QScrollView) - -Sunday 2-4-2000 -- Now Libkmid links with tdecore and qt in order to use a TDEConfig object to -read the default settings as saved by the user with the midi kcontrol module. -- It creates a "dummy" TDEInstance in case of the application being a non-KDE -application. -- Fixed compilation of KMid, as 1) someone renamed klinedit.h to klineedit.h -and 2) now we have to include qiconset.h when creating an action with pictures -as in kmid_part.cpp -- Now I just have to find why KMid doesn't show any interface except the -standard actions - -Saturday 30-9-2000 -- Hmm, it's been a long time since I don't update this file. In summer - I've fixed ALSA support and many related bugs. -- Today, I've finally added the accelerators. -- Raised version to 2.0 diff --git a/kmid/instrfilter.awk b/kmid/instrfilter.awk deleted file mode 100644 index 078169aa..00000000 --- a/kmid/instrfilter.awk +++ /dev/null @@ -1,2 +0,0 @@ -{ match ($0,"\".*\"") } -{ if (RSTART>0) print "i18n("substr($0,RSTART,RLENGTH)");" }; diff --git a/kmid/instrname.cpp b/kmid/instrname.cpp deleted file mode 100644 index 551b85c9..00000000 --- a/kmid/instrname.cpp +++ /dev/null @@ -1,132 +0,0 @@ -const char *instrumentName[128]={ - "Acoustic Grand Piano", - "Bright Acoustic Piano", - "Electric Grand Piano", - "Honky-Tonk", - "Rhodes Piano", - "Chorused Piano", - "Harpsichord", - "Clavinet", - "Celesta", - "Glockenspiel", - "Music Box", - "Vibraphone", - "Marimba", - "Xylophone", - "Tubular Bells", - "Dulcimer", - "Hammond Organ", - "Percussive Organ", - "Rock Organ", - "Church Organ", - "Reed Organ", - "Accordion", - "Harmonica", - "Tango Accordion", - "Acoustic Guitar (Nylon)", - "Acoustic Guitar (Steel)", - "Electric Guitar (Jazz)", - "Electric Guitar (Clean)", - "Electric Guitar (Muted)", - "Overdriven Guitar", - "Distortion Guitar", - "Guitar Harmonics", - "Acoustic Bass", - "Electric Bass (Finger)", - "Electric Bass (Pick)", - "Fretless Bass", - "Slap Bass 1", - "Slap Bass 2", - "Synth Bass 1", - "Synth Bass 2", - "Violin", - "Viola", - "Cello", - "Contrabass", - "Tremolo Strings", - "Pizzicato Strings", - "Orchestral Harp", - "Timpani", - "String Ensemble 1", - "String Ensemble 2", - "Synth Strings 1", - "Synth Strings 2", - "Choir Aahs", - "Voice Oohs", - "Synth Voice", - "Orchestra Hit", - "Trumpet", - "Trombone", - "Tuba", - "Muted Trumpet", - "French Horn", - "Brass Section", - "Synth Brass 1", - "Synth Brass 2", - "Soprano Sax", - "Alto Sax", - "Tenor Sax", - "Baritone Sax", - "Oboe", - "English Horn", - "Bassoon", - "Clarinet", - "Piccolo", - "Flute", - "Recorder", - "Pan Flute", - "Blown Bottle", - "Shakuhachi", - "Whistle", - "Ocarina", - "Lead 1 - Square Wave", - "Lead 2 - Saw Tooth", - "Lead 3 - Calliope", - "Lead 4 - Chiflead", - "Lead 5 - Charang", - "Lead 6 - Voice", - "Lead 7 - Fifths", - "Lead 8 - Bass+Lead", - "Pad 1 - New Age", - "Pad 2 - Warm", - "Pad 3 - Polysynth", - "Pad 4 - Choir", - "Pad 5 - Bow", - "Pad 6 - Metallic", - "Pad 7 - Halo", - "Pad 8 - Sweep", - "FX 1 - Rain", - "FX 2 - Soundtrack", - "FX 3 - Crystal", - "FX 4 - Atmosphere", - "FX 5 - Brightness", - "FX 6 - Goblins", - "FX 7 - Echoes", - "FX 8 - Sci-fi", - "Sitar", - "Banjo", - "Shamisen", - "Koto", - "Kalimba", - "Bagpipe", - "Fiddle", - "Shannai", - "Tinkle Bell", - "Agogo", - "Steel Drum", - "Wook Block", - "Taiko Drum", - "Melodic Tom", - "Synth Drum", - "Reverse Cymbal", - "Guitar Fret Noise", - "Breath Noise", - "Seashore", - "Bird Tweet", - "Telephone", - "Helicopter", - "Applause", - "Gunshot" -}; - - diff --git a/kmid/instrname.h b/kmid/instrname.h deleted file mode 100644 index 80e199c4..00000000 --- a/kmid/instrname.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _INSTRNAME_H -#define _INSTRNAME_H - -extern const char *instrumentName[128]; - -#endif diff --git a/kmid/instrname.i18n b/kmid/instrname.i18n deleted file mode 100644 index 08ec0938..00000000 --- a/kmid/instrname.i18n +++ /dev/null @@ -1,133 +0,0 @@ -/* This is an automatically generated file - * DO NOT EDIT !!! - * To create this file run : make instrname.i18n - */ - -i18n("Acoustic Grand Piano"); -i18n("Bright Acoustic Piano"); -i18n("Electric Grand Piano"); -i18n("Honky-Tonk"); -i18n("Rhodes Piano"); -i18n("Chorused Piano"); -i18n("Harpsichord"); -i18n("Clavinet"); -i18n("Celesta"); -i18n("Glockenspiel"); -i18n("Music Box"); -i18n("Vibraphone"); -i18n("Marimba"); -i18n("Xylophone"); -i18n("Tubular Bells"); -i18n("Dulcimer"); -i18n("Hammond Organ"); -i18n("Percussive Organ"); -i18n("Rock Organ"); -i18n("Church Organ"); -i18n("Reed Organ"); -i18n("Accordion"); -i18n("Harmonica"); -i18n("Tango Accordion"); -i18n("Acoustic Guitar (Nylon)"); -i18n("Acoustic Guitar (Steel)"); -i18n("Electric Guitar (Jazz)"); -i18n("Electric Guitar (Clean)"); -i18n("Electric Guitar (Muted)"); -i18n("Overdriven Guitar"); -i18n("Distortion Guitar"); -i18n("Guitar Harmonics"); -i18n("Acoustic Bass"); -i18n("Electric Bass (Finger)"); -i18n("Electric Bass (Pick)"); -i18n("Fretless Bass"); -i18n("Slap Bass 1"); -i18n("Slap Bass 2"); -i18n("Synth Bass 1"); -i18n("Synth Bass 2"); -i18n("Violin"); -i18n("Viola"); -i18n("Cello"); -i18n("Contrabass"); -i18n("Tremolo Strings"); -i18n("Pizzicato Strings"); -i18n("Orchestral Harp"); -i18n("Timpani"); -i18n("String Ensemble 1"); -i18n("String Ensemble 2"); -i18n("Synth Strings 1"); -i18n("Synth Strings 2"); -i18n("Choir Aahs"); -i18n("Voice Oohs"); -i18n("Synth Voice"); -i18n("Orchestra Hit"); -i18n("Trumpet"); -i18n("Trombone"); -i18n("Tuba"); -i18n("Muted Trumpet"); -i18n("French Horn"); -i18n("Brass Section"); -i18n("Synth Brass 1"); -i18n("Synth Brass 2"); -i18n("Soprano Sax"); -i18n("Alto Sax"); -i18n("Tenor Sax"); -i18n("Baritone Sax"); -i18n("Oboe"); -i18n("English Horn"); -i18n("Bassoon"); -i18n("Clarinet"); -i18n("Piccolo"); -i18n("Flute"); -i18n("Recorder"); -i18n("Pan Flute"); -i18n("Blown Bottle"); -i18n("Shakuhachi"); -i18n("Whistle"); -i18n("Ocarina"); -i18n("Lead 1 - Square Wave"); -i18n("Lead 2 - Saw Tooth"); -i18n("Lead 3 - Calliope"); -i18n("Lead 4 - Chiflead"); -i18n("Lead 5 - Charang"); -i18n("Lead 6 - Voice"); -i18n("Lead 7 - Fifths"); -i18n("Lead 8 - Bass+Lead"); -i18n("Pad 1 - New Age"); -i18n("Pad 2 - Warm"); -i18n("Pad 3 - Polysynth"); -i18n("Pad 4 - Choir"); -i18n("Pad 5 - Bow"); -i18n("Pad 6 - Metallic"); -i18n("Pad 7 - Halo"); -i18n("Pad 8 - Sweep"); -i18n("FX 1 - Rain"); -i18n("FX 2 - Soundtrack"); -i18n("FX 3 - Crystal"); -i18n("FX 4 - Atmosphere"); -i18n("FX 5 - Brightness"); -i18n("FX 6 - Goblins"); -i18n("FX 7 - Echoes"); -i18n("FX 8 - Sci-fi"); -i18n("Sitar"); -i18n("Banjo"); -i18n("Shamisen"); -i18n("Koto"); -i18n("Kalimba"); -i18n("Bagpipe"); -i18n("Fiddle"); -i18n("Shannai"); -i18n("Tinkle Bell"); -i18n("Agogo"); -i18n("Steel Drum"); -i18n("Wook Block"); -i18n("Taiko Drum"); -i18n("Melodic Tom"); -i18n("Synth Drum"); -i18n("Reverse Cymbal"); -i18n("Guitar Fret Noise"); -i18n("Breath Noise"); -i18n("Seashore"); -i18n("Bird Tweet"); -i18n("Telephone"); -i18n("Helicopter"); -i18n("Applause"); -i18n("Gunshot"); diff --git a/kmid/kdisptext.cpp b/kmid/kdisptext.cpp deleted file mode 100644 index edaede4a..00000000 --- a/kmid/kdisptext.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/************************************************************************** - - kdisptext.cpp - The widget that displays the karaoke/lyrics text - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include "kdisptext.h" -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include "version.h" - - -#define NUMPREVLINES 2 -//#define DRAW_BOUNDING_RECTS - - -KDisplayText::KDisplayText(TQWidget *parent,const char *name) : TQScrollView(parent,name) -{ - first_line_[0]=first_line_[1]=NULL; - linked_list_[0]=linked_list_[1]=NULL; - cursor_line_[0]=cursor_line_[1]=NULL; - cursor_[0]=cursor_[1]=NULL; - nlines_[0]=nlines_[1]=0; - linked_list=NULL; - cursor_line=NULL; - first_line=NULL; - cursor=NULL; - nlines=0; - lyrics_codec=TDEGlobal::locale()->codecForEncoding(); - - viewport()->setBackgroundColor(TQColor (110,110,110)); -// setBackgroundMode(NoBackground); - TDEConfig *kcfg=TDEGlobal::instance()->config(); - kcfg->setGroup("KMid"); - typeoftextevents=kcfg->readNumEntry("TypeOfTextEvents",1); - TQFont *qtextfontdefault=new TQFont(TDEGlobalSettings::fixedFont().family(),22); - qtextfont=new TQFont(kcfg->readFontEntry("KaraokeFont",qtextfontdefault)); - delete qtextfontdefault; - qfmetr=new TQFontMetrics(*qtextfont); - nvisiblelines=height()/qfmetr->lineSpacing(); - autoscrollv=0; -} - -KDisplayText::~KDisplayText() -{ - RemoveLinkedList(); -} - -/*void KDisplayText::PreDestroyer(void) -{ - delete qfmetr; - delete qtextfont; -} -*/ - -void KDisplayText::RemoveLine(kdispt_line *tmpl) -{ - kdispt_ev *tmpe; - while (tmpl->ev!=NULL) - { - tmpe=tmpl->ev; - tmpl->ev=tmpe->next; - // delete tmpe->spev; Remember that the Special Events that this pointer - // points to is the same that the Player object has instantiated - delete tmpe; - } -} - -void KDisplayText::RemoveLinkedList(void) -{ - cursor=NULL; - cursor_line=NULL; - first_line=NULL; - linked_list=NULL; - nlines=0; - nlines_[0]=nlines_[1]=0; - first_line_[0]=first_line_[1]=NULL; - cursor_line_[0]=cursor_line_[1]=NULL; - cursor_[0]=cursor_[1]=NULL; - - kdispt_line *tmpl; - for (int i=0;i<2;i++) - { - while (linked_list_[i]!=NULL) - { - RemoveLine(linked_list_[i]); - tmpl=linked_list_[i]; - linked_list_[i]=linked_list_[i]->next; - delete tmpl; - } - } -} - -void KDisplayText::ClearEv(bool totally) -{ - RemoveLinkedList(); - if (totally) - { - TQT_TQOBJECT(this)->killTimers(); - autoscrollv=0; - resizeContents(0,0); - viewport()->repaint(TRUE); - } -} - -int KDisplayText::IsLineFeed(char c,int type) -{ - switch (type) - { - case (1) : if (/*(c==0)||*/(c=='\\')||(c=='/')||(c=='@')) return 1;break; - case (5) : if (/*(c==0)||*/(c==10)||(c==13)) return 1;break; - default : if ((c==0)||(c==10)||(c==13)||(c=='\\')||(c=='/')||(c=='@')) return 1;break; - } - return 0; -} - -void KDisplayText::AddEv(SpecialEvent *ev) -{ - if ((ev->type==1) || (ev->type==5)) - { - int idx=(ev->type==1)? 0 : 1; - if (linked_list_[idx]==NULL) - { - linked_list_[idx]=new kdispt_line; - linked_list_[idx]->next=NULL; - linked_list_[idx]->num=1; - linked_list_[idx]->ev=new kdispt_ev; - cursor_line_[idx]=linked_list_[idx]; - cursor_[idx]=cursor_line_[idx]->ev; - cursor_[idx]->spev=ev; - cursor_[idx]->next=NULL; - first_line_[idx]=linked_list_[idx]; - first_line=first_line_[idx]; - nlines_[idx]=1; - } - else - { - if (IsLineFeed(ev->text[0],ev->type)) - { - nlines_[idx]++; - cursor_line_[idx]->next=new kdispt_line; - cursor_line_[idx]=cursor_line_[idx]->next; - cursor_line_[idx]->num=nlines_[idx]; - cursor_line_[idx]->ev=new kdispt_ev; - cursor_line_[idx]->next=NULL; - cursor_[idx]=cursor_line_[idx]->ev; - } - else - { - cursor_[idx]->next=new kdispt_ev; - cursor_[idx]=cursor_[idx]->next; - } - cursor_[idx]->spev=ev; - cursor_[idx]->next=NULL; - } - } -} - -void KDisplayText::calculatePositions(void) -{ - int typeoftextevents=1; - int fin=0; - kdispt_line *tmpl; - kdispt_ev *tmp; - int tmpx=0; - int tmpy=0; - int tmpw=0; - int maxx=0; - nlines=nlines_[(typeoftextevents==1)? 0:1]; - int lineSpacing=qfmetr->lineSpacing(); - int descent=qfmetr->descent(); - while (!fin) - { - tmpl=linked_list_[(typeoftextevents==1)?0:1]; - tmpy=lineSpacing; - maxx=0; - while (tmpl!=NULL) - { - tmp=tmpl->ev; - tmpx=5; - while (tmp!=NULL) - { - if (tmp->spev->type==typeoftextevents) - { - if (IsLineFeed(tmp->spev->text[0],typeoftextevents)) - { - tmpy+=lineSpacing; - tmpx=5; - - tmp->xpos=tmpx; - if (tmp->spev->text[0]!=0) tmpw=qfmetr->width(lyrics_codec->toUnicode(&tmp->spev->text[1])); - else tmpw=0; - tmp->r=qfmetr->boundingRect(lyrics_codec->toUnicode(&tmp->spev->text[1])); - } - else - { - tmp->xpos=tmpx; - tmpw=qfmetr->width(lyrics_codec->toUnicode(tmp->spev->text)); - tmp->r=qfmetr->boundingRect(lyrics_codec->toUnicode(tmp->spev->text)); - } - // We add 5 pixels above, below and to the right because of a - // problem with latest released Xft - tmp->r.moveBy(tmpx,tmpy-tmp->r.height()-tmp->r.y()-5); - tmp->r.setHeight(tmp->r.height()+descent+10); - tmp->r.setWidth(tmp->r.width()+5); - tmpx+=tmpw; - if (tmpx>maxx) maxx=tmpx; - } - tmp=tmp->next; - } - tmpl->ypos=tmpl->num*lineSpacing; - tmpy=tmpl->ypos; - tmpl=tmpl->next; - } - maxX[(typeoftextevents==1)?0:1]=maxx+10; - maxY[(typeoftextevents==1)?0:1]= - nlines_[(typeoftextevents==1)?0:1]*lineSpacing+descent+10; - - if (typeoftextevents==1) typeoftextevents=5; - else fin=1; - } - -} - -kdispt_line *KDisplayText::searchYOffset(int y, kdispt_line *start) -{ -kdispt_line *t=start; -while (t!=NULL) - { -// if (t->ypos+qfmetr->descent()>y) return start; - if (t->ypos+qfmetr->descent()+20>y) return start; - start=t; - t=t->next; - }; -return start; -} - -void KDisplayText::drawContents(TQPainter *p, int /*clipx*/, int clipy, int /*clipw*/, int cliph) -{ - p->setFont(*qtextfont); - if (linked_list==NULL) return; - int i=0; - p->setPen(yellow); - int colorplayed=1; - if (cursor==NULL) colorplayed=0; // Thus, the program doesn't change the color - kdispt_line *tmpl=linked_list; - kdispt_ev *tmp; - -#ifdef KDISPTEXTDEBUG - printf("events displayed %d\n",typeoftextevents); -#endif - - tmpl=searchYOffset(clipy,linked_list); - int nlinestodraw=1; - kdispt_line *t=tmpl; - while ((t!=NULL)&&(t->ypos+qfmetr->descent()next; - } - - i=0; - while ((iev; - while ((tmp!=NULL)&&(tmp->spev->type!=typeoftextevents)) tmp=tmp->next; - while (tmp!=NULL) - { - if ( colorplayed && - // (tmp->spev->absmilliseconds>=cursor->spev->absmilliseconds)) - (tmp->spev->id>=cursor->spev->id)) - { - p->setPen(black); - colorplayed=0; - } - - if (IsLineFeed(tmp->spev->text[0],tmp->spev->type)) - p->drawText(tmp->xpos,tmpl->ypos,lyrics_codec->toUnicode(&tmp->spev->text[1])); - else - p->drawText(tmp->xpos,tmpl->ypos,lyrics_codec->toUnicode(tmp->spev->text)); - -#ifdef DRAW_BOUNDING_RECTS - p->setPen(red); - p->drawRect(tmp->r); - p->setPen((colorplayed)?yellow:black); -#endif - tmp=tmp->next; - while ((tmp!=NULL)&&(tmp->spev->type!=typeoftextevents)) tmp=tmp->next; - } - i++; - tmpl=tmpl->next; - } - -} - - -void KDisplayText::resizeEvent(TQResizeEvent *e) -{ - TQScrollView::resizeEvent(e); - nvisiblelines=visibleHeight()/qfmetr->lineSpacing(); - if ( (nlines>nvisiblelines) || (nvisiblelines==0) ) - resizeContents(maxX[(typeoftextevents==1)?0:1],maxY[(typeoftextevents==1)?0:1]); - else - resizeContents(0,0); - -} - -void KDisplayText::CursorToHome(void) -{ -/* TDEConfig *kcfg=TDEGlobal::instance()->config(); - kcfg->setGroup("KMid"); - typeoftextevents=kcfg->readNumEntry("TypeOfTextEvents",1); -*/ - linked_list=linked_list_[(typeoftextevents==1)? 0:1]; - nlines=nlines_[(typeoftextevents==1)? 0:1]; - cursor_line_[0]=linked_list_[0]; - first_line_[0]=cursor_line_[0]; - if (cursor_line_[0]!=NULL) cursor_[0]=cursor_line_[0]->ev; - cursor_line_[1]=linked_list_[1]; - first_line_[1]=cursor_line_[1]; - if (cursor_line_[1]!=NULL) cursor_[1]=cursor_line_[1]->ev; - - if (linked_list==NULL) - { - cursor_line=NULL; - cursor=NULL; - first_line=NULL; - } - else - { - cursor_line=linked_list; - cursor=cursor_line->ev; - first_line=linked_list; - } - - nvisiblelines=visibleHeight()/qfmetr->lineSpacing(); - if (nlines>nvisiblelines) - resizeContents(maxX[(typeoftextevents==1)?0:1],maxY[(typeoftextevents==1)?0:1]); - else - resizeContents(0,0); - - - setContentsPos(0,0); - viewport()->repaint(true); -} - -void KDisplayText::PaintIn(int type) -{ - bool paint=false; - if (type!=typeoftextevents) - { - int idx=(type==1)?0:1; - if (cursor_[idx]==NULL) return; - cursor_[idx]=cursor_[idx]->next; - while ((cursor_[idx]==NULL)&&(cursor_line_[idx]!=NULL)) - { - cursor_line_[idx]=cursor_line_[idx]->next; - if (cursor_line_[idx]!=NULL) - { - cursor_[idx]=cursor_line_[idx]->ev; - if ((cursor_line_[idx]->num>first_line_[idx]->num+NUMPREVLINES) - &&(cursor_line_[idx]->numnum+nvisiblelines+1)) - if ((first_line_[idx]!=NULL)&&(first_line_[idx]->num+nvisiblelines<=nlines_[idx])) first_line_[idx]=first_line_[idx]->next; - } - } - return; - } - - if ((cursor==NULL)||(cursor_line==NULL)) - { - printf("KDispT : cursor == NULL !!!\n"); - return; - } - - kdispt_ev *tmp=cursor; - if (cursor->spev->type==typeoftextevents) - { -// int x,y; -// contentsToViewport(cursor->xpos,cursor_line->ypos,x,y); - - cursor=cursor->next; - paint=true; - - } - else - cursor=cursor->next; - - - while ((cursor==NULL)&&(cursor_line!=NULL)) - { - cursor_line=cursor_line->next; - if (cursor_line!=NULL) - { - cursor=cursor_line->ev; - if ((cursor_line->ypos>contentsY()+(visibleHeight()*5/8))&& - (cursor_line->yposlineSpacing(); - if (b) startTimer(100); - else { - TQT_TQOBJECT(this)->killTimers(); - startTimer(100/(autoscrollv/qfmetr->lineSpacing()+1)); - } - } -// scrollBy(0,qfmetr->lineSpacing()); - } - } - if (paint) repaintContents(tmp->r); -} - -void KDisplayText::gotomsec(ulong i) -{ - int notidx=(typeoftextevents==1)?1:0; - - if (linked_list_[notidx]!=NULL) - { - cursor_line_[notidx]=linked_list_[notidx]; - first_line_[notidx]=cursor_line_[notidx]; - cursor_[notidx]=cursor_line_[notidx]->ev; - while ((cursor_line_[notidx]!=NULL)&&(cursor_[notidx]->spev->absmillisecondsnext; - while ((cursor_[notidx]==NULL)&&(cursor_line_[notidx]!=NULL)) - { - cursor_line_[notidx]=cursor_line_[notidx]->next; - if (cursor_line_[notidx]!=NULL) - { - cursor_[notidx]=cursor_line_[notidx]->ev; - if ((cursor_line_[notidx]->num>first_line_[notidx]->num+NUMPREVLINES) - &&(cursor_line_[notidx]->numnum+nvisiblelines+1)) - if ((first_line_[notidx]!=NULL)&&(first_line_[notidx]->num+nvisiblelines<=nlines_[notidx])) first_line_[notidx]=first_line_[notidx]->next; - } - } - } - } - - if (linked_list!=NULL) - { - cursor_line=linked_list; - cursor=cursor_line->ev; - first_line=linked_list; - while ((cursor_line!=NULL)&&(cursor->spev->absmillisecondsnext; - while ((cursor==NULL)&&(cursor_line!=NULL)) - { - cursor_line=cursor_line->next; - if (cursor_line!=NULL) - { - cursor=cursor_line->ev; - if ((cursor_line->num>first_line->num+NUMPREVLINES) - &&(cursor_line->numnum+nvisiblelines+1)) - if ((first_line!=NULL)&&(first_line->num+nvisiblelines<=nlines)) first_line=first_line->next; - } - } - - - } - - TQT_TQOBJECT(this)->killTimers(); - autoscrollv=0; - setContentsPos(0,first_line->ypos); - viewport()->repaint(); - - } -} - -TQFont *KDisplayText::getFont(void) -{ - return qtextfont; -} - -void KDisplayText::fontChanged(void) -{ - TDEConfig *kcfg=TDEGlobal::instance()->config(); - kcfg->setGroup("KMid"); - TQFont *qtextfontdefault=new TQFont(*qtextfont); - delete qtextfont; - qtextfont=new TQFont(kcfg->readFontEntry("KaraokeFont",qtextfontdefault)); - delete qtextfontdefault; - qfmetr=new TQFontMetrics(*qtextfont); - calculatePositions(); - nvisiblelines=height()/qfmetr->lineSpacing(); - viewport()->repaint(TRUE); -} - -void KDisplayText::ChangeTypeOfTextEvents(int type) -{ - int idxold=(typeoftextevents==1)?0:1; - int idxnew=(type==1)?0:1; - cursor_line_[idxold]=cursor_line; - first_line_[idxold]=first_line; - cursor_[idxold]=cursor; - linked_list=linked_list_[idxnew]; - cursor_line=cursor_line_[idxnew]; - first_line=first_line_[idxnew]; - cursor=cursor_[idxnew]; - nlines=nlines_[idxnew]; - typeoftextevents=type; - if (first_line!=NULL) - { - nvisiblelines=height()/qfmetr->lineSpacing(); - if (nlines>nvisiblelines) - resizeContents(maxX[(typeoftextevents==1)?0:1],maxY[(typeoftextevents==1)?0:1]); - else - resizeContents(0,0); - - setContentsPos(0,first_line->ypos); - } - viewport()->repaint(TRUE); -} - -int KDisplayText::ChooseTypeOfTextEvents(void) -{ - return (nlines_[0]>nlines_[1])? 1 : 5; -} - -void KDisplayText::ScrollDown() -{ - scrollBy(0,2/**qfmetr->lineSpacing()*/); -} - -void KDisplayText::ScrollUp() -{ - scrollBy(0,-2/**qfmetr->lineSpacing()*/); -} - -void KDisplayText::ScrollPageDown() -{ - scrollBy(0,nvisiblelines*qfmetr->lineSpacing()); -} - -void KDisplayText::ScrollPageUp() -{ - scrollBy(0,-nvisiblelines*qfmetr->lineSpacing()); -} - -void KDisplayText::saveLyrics(FILE *fh) -{ - kdispt_line *Lptr=linked_list_[(typeoftextevents==1)? 0:1]; - while (Lptr!=NULL) - { - kdispt_ev *Cptr=Lptr->ev; - if (Cptr!=NULL) - { - if (strcmp(Cptr->spev->text,"")!=0) - if (IsLineFeed(Cptr->spev->text[0],Cptr->spev->type)) - fputs(&Cptr->spev->text[1],fh); - else - fputs(Cptr->spev->text,fh); - Cptr=Cptr->next; - } - while (Cptr!=NULL) - { - fputs(Cptr->spev->text,fh); - Cptr=Cptr->next; - } - fputs("\n",fh); - Lptr=Lptr->next; - } -} - -void KDisplayText::timerEvent(TQTimerEvent *e) -{ - int dy; - if (autoscrollv>0) - { - dy=2+autoscrollv/50; - scrollBy(0,dy); - autoscrollv-=dy; - if (autoscrollv<0) - { - killTimer(e->timerId()); - autoscrollv=0; - } - } - else - if (autoscrollv<0) - { -// dy=(autoscrollv<-2*qfmetr->lineSpacing())?-7:-2; - dy=-2+autoscrollv/50; - scrollBy(0,dy); - autoscrollv-=dy; - if (autoscrollv>0) - { - killTimer(e->timerId()); - autoscrollv=0; - } - } - else - killTimer(e->timerId()); - -} - -void KDisplayText::setLyricsEncoding(const TQString &enc) -{ - TQTextCodec *newcodec; - if (enc.isEmpty()) - newcodec=TDEGlobal::locale()->codecForEncoding(); - else - newcodec=TQTextCodec::codecForName(enc.latin1()); - - if (newcodec!=lyrics_codec) - { - if (newcodec) - { - lyrics_codec=newcodec; - fontChanged(); - } - } -} - -#include "kdisptext.moc" diff --git a/kmid/kdisptext.h b/kmid/kdisptext.h deleted file mode 100644 index 9b99e7fa..00000000 --- a/kmid/kdisptext.h +++ /dev/null @@ -1,126 +0,0 @@ -/************************************************************************** - - kdisptext.h - The widget that displays the karaoke/lyrics text - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _kdisptext_h_ -#define _kdisptext_h_ - -#include -#include -#include - -struct kdispt_ev -{ - SpecialEvent *spev; - int xpos; - class TQRect r; - kdispt_ev *next; -}; - -struct kdispt_line -{ - kdispt_ev *ev; - int num; - int ypos; - kdispt_line *next; -}; - -class TQFont; -class TQFontMetrics; -class TQScrollBar; - -class KDisplayText : public TQScrollView -{ - Q_OBJECT - -private: - TQTextCodec *lyrics_codec; - - TQFontMetrics *qfmetr; - TQFont *qtextfont; - - int typeoftextevents; - - kdispt_line *linked_list_[2]; - int nlines_[2]; - kdispt_line *first_line_[2]; - kdispt_line *cursor_line_[2]; - kdispt_ev *cursor_[2]; - - kdispt_line *linked_list; - kdispt_line *cursor_line; - kdispt_ev *cursor; - - kdispt_line *first_line; // Pointer to first text at first visible line - - int nlines; // Total number of lines - int nvisiblelines; // Number of visible lines - - void RemoveLine(kdispt_line *tmpl); - void RemoveLinkedList(void); - - int IsLineFeed(char c,int type=0); - virtual void drawContents(TQPainter *qpaint,int clipx,int clipy,int clipw,int cliph); - - kdispt_line * searchYOffset(int y, kdispt_line *start); - - int maxX[2]; - int maxY[2]; - int autoscrollv; - -protected: - virtual void resizeEvent(TQResizeEvent *qre); - virtual void timerEvent(TQTimerEvent *e); - -public: - KDisplayText(TQWidget *parent,const char *name); - virtual ~KDisplayText(); - - void ClearEv(bool totally=true); - void AddEv(SpecialEvent *ev); - void calculatePositions(void); - - void CursorToHome(void); - - void ChangeTypeOfTextEvents(int type); - int ChooseTypeOfTextEvents(void); - void PaintIn(int type); - void gotomsec(ulong i); - - TQFont *getFont(void); - void fontChanged(void); - - void saveLyrics(FILE *fh); - - void setLyricsEncoding(const TQString &enc); - -// TQSize sizeHint(); - -public slots: - void ScrollDown(); - void ScrollUp(); - void ScrollPageDown(); - void ScrollPageUp(); - -}; - -#endif diff --git a/kmid/keyboard.xpm b/kmid/keyboard.xpm deleted file mode 100644 index 9859e3a7..00000000 --- a/kmid/keyboard.xpm +++ /dev/null @@ -1,50 +0,0 @@ -/* XPM */ -static char * keyboard_xpm[] = { -"63 45 2 1", -" c #000000000000", -". c #FFFFFFFFFFFF", -" ", -"..... .. ..... ..... .. .. ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... . .. . ..... ..... . .. . .. . ..... ", -"..... .... .. .... ..... ..... .... .. .... .. .... ..... ", -"..... .. ..... ..... .. .. ..... ", -"...... .... ...... ...... .... .... ...... ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -"........ ........ ........ ........ ........ ........ ........ ", -" ", -" "}; diff --git a/kmid/klcdnumber.cpp b/kmid/klcdnumber.cpp deleted file mode 100644 index 3fdf80c4..00000000 --- a/kmid/klcdnumber.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/************************************************************************** - - klcdnumber.cpp - The KLCDNumber widget (displays a lcd number) - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include "klcdnumber.h" -#include -#include -#include "ktrianglebutton.h" - -#define BUTTONWIDTH 9 - -KLCDNumber::KLCDNumber(int _numDigits,TQWidget *parent,const char *name) - : TQWidget(parent,name) -{ - initDigits(); - setUserChangeValue=false; - numDigits=_numDigits; - value=0; - minValue=0; - maxValue=1000; - oldvalue=-1; - // setPalette( TQPalette (TQColor(0,0,0))); - upBtn=NULL; - downBtn=NULL; - setUserDefaultValue=false; - doubleclicked=false; - setLCDBackgroundColor(0,0,0); - setLCDColor(100,255,100); -} - -KLCDNumber::KLCDNumber(bool _setUserChangeValue,int _numDigits,TQWidget *parent,const char *name) - : TQWidget(parent,name) -{ - initDigits(); - setUserChangeValue=_setUserChangeValue; - numDigits=_numDigits; - value=0; - minValue=0; - maxValue=1000; - oldvalue=-1; -// setBackgroundColor(TQColor(0,0,0)); -// setPalette( TQPalette (TQColor(0,0,0))); - upBtn=NULL; - downBtn=NULL; - setUserDefaultValue=false; - doubleclicked=false; - setLCDBackgroundColor(0,0,0); - setLCDColor(100,255,100); - if (setUserChangeValue) - { - upBtn=new KTriangleButton(KTriangleButton::Right,this,"Up"); - downBtn=new KTriangleButton(KTriangleButton::Left,this,"Down"); - upBtn->setGeometry(width()-BUTTONWIDTH,0,BUTTONWIDTH,height()); - downBtn->setGeometry(0,0,BUTTONWIDTH,height()); - connect(upBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(increaseValue())); - connect(downBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(decreaseValue())); - connect(upBtn,TQT_SIGNAL(clickedQuickly()),this,TQT_SLOT(increaseValueFast())); - connect(downBtn,TQT_SIGNAL(clickedQuickly()),this,TQT_SLOT(decreaseValueFast())); - }; -} - -void KLCDNumber::initDigits (void) -{ -Digit[0] = digit(true,true,true,false,true,true,true); -Digit[1] = digit(false,false,true,false,false,true,false); -Digit[2] = digit(true,false,true,true,true,false,true); -Digit[3] = digit(true,false,true,true,false,true,true); -Digit[4] = digit(false,true,true,true,false,true,false); -Digit[5] = digit(true,true,false,true,false,true,true); -Digit[6] = digit(true,true,false,true,true,true,true); -Digit[7] = digit(true,false,true,false,false,true,false); -Digit[8] = digit(true,true,true,true,true,true,true); -Digit[9] = digit(true,true,true,true,false,true,true); -Digit[10] = digit(false,false,false,false,false,false,false); -} - -void KLCDNumber::resizeEvent ( TQResizeEvent *) -{ - if (setUserChangeValue) - { - upBtn->setGeometry(width()-BUTTONWIDTH,0,BUTTONWIDTH,height()); - downBtn->setGeometry(0,0,BUTTONWIDTH,height()); - } -} - -void KLCDNumber::drawVerticalBar(TQPainter *qpaint,int x,int y,int w,int h,int d) -{ - /* If d is 0 it means that it is a bar on the left and if 1 it is on the right */ - /* - |\ /| - | | | | - | | = 0 1 = | | - | | | | - |/ \| - */ - - y++; - h-=2; - if (d==0) - { - for (int i=x;idrawLine(i,y,i,y+h); - y++; - h-=2; - } - } else { - for (int i=x+w;i>x;i--) - { - qpaint->drawLine(i,y,i,y+h); - y++; - h-=2; - } - } -} - -void KLCDNumber::drawHorizBar(TQPainter *qpaint,int x,int y,int w,int h,int d) -{ - // 0 is upper, 1 is bottom and 2 is the middle bar. - x++; - w-=3; - if (d==0) - { - for (int i=y;idrawLine(x,i,x+w,i); - x++; - w-=2; - } - } - else if (d==1) - { - for (int i=y+h;i>y;i--) - { - qpaint->drawLine(x,i,x+w,i); - x++; - w-=2; - } - } - else - { - for (int i=0;i<=h/2;i++) - { - qpaint->drawLine(x,y-i,x+w,y-i); - qpaint->drawLine(x,y+i,x+w,y+i); - x++; - w-=2; - } - - }; - -} - -void KLCDNumber::drawDigit(TQPainter *qpaint,int x,int y,int w,int h,digit d) -{ -if (d.nw) drawVerticalBar(qpaint,x,y,w/5,h/2,0); -if (d.ne) drawVerticalBar(qpaint,x+w*4/5,y,w/5,h/2,1); -if (d.sw) drawVerticalBar(qpaint,x,y+h/2,w/5,h/2,0); -if (d.se) drawVerticalBar(qpaint,x+w*4/5,y+h/2,w/5,h/2,1); -if (d.up) drawHorizBar (qpaint,x,y,w,w/5,0); -if (d.bt) drawHorizBar (qpaint,x,y+h-w/5,w,w/5,1); -if (d.md) drawHorizBar (qpaint,x,y+h/2,w,w/5,2); -} - - -void KLCDNumber::setValue(double v) -{ - oldvalue=value; - if (vmaxValue) - value=maxValue; - else - value=v; - -} - -void KLCDNumber::display (double v) -{ - setValue(v); - repaint(FALSE); -} - -void KLCDNumber::display (int v) -{ - display((double)v); -} - - -void KLCDNumber::paintEvent ( TQPaintEvent * ) -{ - TQPainter qpaint(this); - qpaint.fillRect(0,0,width(),height(),backgcolor); - qpaint.setPen(LCDcolor); - - TQString numStr; - numStr.setNum((int) value); - numStr = numStr.rightJustify( numDigits, ' ', true); - - int dx,dy,dw,dh; - if (setUserChangeValue) - { - dx=BUTTONWIDTH; - dy=height()/10; - dh=height()-dy*2; - dw=(width()-(BUTTONWIDTH*2))/numDigits; - } else - { - dx=0; - dy=height()/10; - dh=height()-dy*2; - dw=width()/numDigits; - }; - int sep=dw/10; - - for(int i=0; i < numDigits; i++) - { - char dig = numStr[i].latin1(); - if ((dig>='0')&&(dig<='9')) - drawDigit(&qpaint,dx+sep,dy,dw-sep*2,dh,Digit[dig-'0']); - else - drawDigit(&qpaint,dx+sep,dy,dw-sep*2,dh,KLCDNumber::Digit[10]); - dx+=dw; - }; -} - -void KLCDNumber::setUserSetDefaultValue(bool _userSetDefaultValue) -{ - if (setUserDefaultValue!=_userSetDefaultValue) - { - setUserDefaultValue=_userSetDefaultValue; - /* if (setUserDefaultValue) - connect(); - else - disconnect(); - */ - } - -} - -void KLCDNumber::setDefaultValue(double v) -{ - defaultValue=v; -} - - -void KLCDNumber::decreaseValue() -{ - display( value-1 ); - emit valueChanged( value ); -} - -void KLCDNumber::increaseValue() -{ - display( value+1 ); - emit valueChanged( value ); -} - -void KLCDNumber::decreaseValueFast() -{ - display( value-1 ); -} - -void KLCDNumber::increaseValueFast() -{ - display( value+1 ); -} - -void KLCDNumber::mouseDoubleClickEvent (TQMouseEvent *) -{ - doubleclicked=true; - defaultValueClicked(); -} - -void KLCDNumber::mousePressEvent (TQMouseEvent *e) -{ - startTimer(200); - TQWidget::mousePressEvent(e); -} - -void KLCDNumber::timerEvent(TQTimerEvent *) -{ - TQT_TQOBJECT(this)->killTimers(); - doubleclicked=false; - -} - - -void KLCDNumber::defaultValueClicked() -{ - if (setUserDefaultValue) - { - display( defaultValue ); - emit valueChanged( value ); - } -} - -void KLCDNumber::setLCDBackgroundColor(int r,int g,int b) -{ - backgcolor=TQColor(r,g,b); - repaint(FALSE); -} - -void KLCDNumber::setLCDColor(int r,int g,int b) -{ - LCDcolor=TQColor(r,g,b); - repaint(FALSE); -} - -void KLCDNumber::setRange(double min, double max) -{ - minValue=min; - maxValue=max; -} - -TQSize KLCDNumber::sizeHint() -{ - return TQSize(83,28); -} -#include "klcdnumber.moc" diff --git a/kmid/klcdnumber.h b/kmid/klcdnumber.h deleted file mode 100644 index b124a5db..00000000 --- a/kmid/klcdnumber.h +++ /dev/null @@ -1,154 +0,0 @@ -/************************************************************************** - - klcdnumber.h - The KLCDNumber widget (displays a lcd number) - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _klcdnumber_h_ -#define _klcdnumber_h_ - -#include - -class TQPainter; -class KTriangleButton; -class TQColor; - -class KLCDNumber : public TQWidget -{ - Q_OBJECT - -protected: - class digit { -public: - digit() - : up(false), nw(false), ne(false), md(false), - sw(false), se(false), bt(false) { } - digit( bool _up, bool _nw, bool _ne, - bool _md, bool _sw, bool _se, bool _bt) - : up(_up), nw(_nw), ne(_ne), md(_md), - sw(_sw), se(_se), bt(_bt) { } - bool up; - bool nw; - bool ne; - bool md; - bool sw; - bool se; - bool bt; - }; - /* - up - --- - nw| |ne - |___|<------ md - | | - sw|___|se - bt - */ - - - KLCDNumber::digit Digit[11]; -/* -={ - / 0 / {true,true,true,false,true,true,true}, - / 1 / {false,false,true,false,false,true,false}, - / 2 / {true,false,true,true,true,false,true}, - / 3 / {true,false,true,true,false,true,true}, - / 4 / {false,true,true,true,false,true,false}, - / 5 / {true,true,false,true,false,true,true}, - / 6 / {true,true,false,true,true,true,true}, - / 7 / {true,false,true,false,false,true,false}, - / 8 / {true,true,true,true,true,true,true}, - / 9 / {true,true,true,true,false,true,true}, - / / {false,false,false,false,false,false,false} - };*/ - - int numDigits; - bool setUserChangeValue; - bool setUserDefaultValue; - bool doubleclicked; - - TQColor backgcolor; - TQColor LCDcolor; - - double value; - double oldvalue; - double defaultValue; - - double minValue; - double maxValue; - - void drawVerticalBar(TQPainter *qpaint,int x,int y,int w,int h,int d); - void drawHorizBar(TQPainter *qpaint,int x,int y,int w,int h,int d); - void drawDigit(TQPainter *qpaint,int x,int y,int w,int h,digit d); - - void initDigits(void); - -public: - KLCDNumber(int _numDigits,TQWidget *parent,const char *name); - KLCDNumber(bool _setUserChangeValue,int _numDigits,TQWidget *parent,const char *name); - - void setUserSetDefaultValue(bool _userSetDefaultValue); - void setDefaultValue(double v); - - void setValue(double v); - double getValue(void) { return value; }; - double getOldValue(void) { return oldvalue; }; - - double getMinValue(void) { return minValue;}; - double getMaxValue(void) { return maxValue;}; - void setRange(double min, double max); - - void setLCDBackgroundColor (int r,int g,int b); - void setLCDColor (int r,int g,int b); - - void display (int v); - void display (double v); - - TQSize sizeHint (); -// TQSizePolicy sizePolicy(); - -protected: - - virtual void paintEvent ( TQPaintEvent *e ); - virtual void resizeEvent ( TQResizeEvent *e); - virtual void mouseDoubleClickEvent (TQMouseEvent *e); - virtual void mousePressEvent (TQMouseEvent *e); - virtual void timerEvent(TQTimerEvent *e); - void defaultValueClicked(); - - KTriangleButton *downBtn; - KTriangleButton *upBtn; - - - -public slots: - - void decreaseValue(); - void increaseValue(); - void decreaseValueFast(); - void increaseValueFast(); - -signals: - - void valueChanged(double v); - -}; - -#endif diff --git a/kmid/kmid.desktop b/kmid/kmid.desktop deleted file mode 100644 index d51087ac..00000000 --- a/kmid/kmid.desktop +++ /dev/null @@ -1,88 +0,0 @@ -[Desktop Entry] -Name=KMid -Name[af]=Kmid -Name[bn]=কে-মিড -Name[eo]=MIDI-ludilo -Name[hi]=के-मिड -Name[ne]=केडीई मिड -Name[sv]=Kmid -Name[tr]=Kmid -Name[zh_HK]=KMidi -Name[zh_TW]=KMid 播放器 -Name[zu]=KMidi -MimeType=audio/x-karaoke;audio/x-midi;audio/midi; -GenericName=Midi/Karaoke Player -GenericName[af]=Midi/Kareokie Speler -GenericName[ar]=مشغل Midi/Karaoke -GenericName[bg]=Midi/Karaoke плеър -GenericName[br]=C'hoarier Midi/Karaoke -GenericName[bs]=Preglednik Midi/Karaoke datoteka -GenericName[ca]=Reproductor Midi/Karaoke -GenericName[cs]=Přehrávač Midi/Karaoke -GenericName[cy]=Chwaraewr Midi/Karaoke -GenericName[da]=Midi/Karaoke-afspiller -GenericName[de]=Midi/Karaoke-Programm -GenericName[el]=Αναπαραγωγέας Midi/Karaoke -GenericName[eo]=Ludilo por Midi/Karaoko-dosieroj -GenericName[es]=Un reproductor MIDI/Karaoke -GenericName[et]=Midi/karaoke mängija -GenericName[eu]=Midi/Karaoke erreproduzigailua -GenericName[fa]=پخش‌کنندۀ Midi/Karaoke -GenericName[fi]=Midi/Karaokesoitin -GenericName[fr]=Platine MIDI / Karaoké -GenericName[ga]=Seinnteoir Midi/Karaoke -GenericName[gl]=Reproductor de Midi/Karaoke -GenericName[he]=נגן MIDI/קריוקי -GenericName[hi]=मिडी/कराओके प्लेयर -GenericName[hr]=Midi/Karaoke player -GenericName[hu]=MIDI/Karaoke-lejátszó -GenericName[is]=Midi / Karaoke spilari -GenericName[it]=Lettore MIDI/Karaoke -GenericName[ja]=Midi/カラオケプレーヤ -GenericName[kk]=Midi/Караоке ойнатқышы -GenericName[km]=កម្មវិធី​ចាក់ Midi/ខារ៉ាអូខេ -GenericName[ko]=미디/노래방 재생기 -GenericName[lt]=Midi/Karaoke grotuvas -GenericName[lv]=Midi/Karaoke Atskaņotājs -GenericName[mk]=Midi/Karaoke изведувач -GenericName[ms]=Pemain Midi/Karaoke -GenericName[nb]=Midi-/karaokespiller -GenericName[nds]=Midi-/Karaoke-Afspeler -GenericName[ne]=मिडि/कारावके प्लेयर -GenericName[nl]=Midi/karaokespeler -GenericName[nn]=Midi-/karaoke-spelar -GenericName[pl]=Odtwarzacz Midi/Karaoke -GenericName[pt]=Leitor de MIDI/Karaoke -GenericName[pt_BR]=Reprodutor de Midi/Karaokê -GenericName[ro]=Program de redare MIDI/Karaoke -GenericName[ru]=Проигрыватель midi/караоке -GenericName[se]=Midi-/karaoke-čuojaheaddji -GenericName[sk]=Prehrávač Midi/Karaoke -GenericName[sl]=Predvajalnik datotek MIDI/Karaoke -GenericName[sr]=MIDI/караока плејер -GenericName[sr@Latn]=MIDI/karaoka plejer -GenericName[sv]=Midi/Karaoke-spelare -GenericName[ta]=ஒரு மிடி/கரயோக்கே இயக்கி -GenericName[tg]=Бозингари Midi/Karaoke -GenericName[th]=โปรแกรมเล่นแฟ้มมิดี้/คาราโอเกะ -GenericName[tr]=Midi ve Karaoke Yürütücü -GenericName[uk]=Програвач Midi/Karaoke -GenericName[uz]=Midi/Karaoki pleyer -GenericName[uz@cyrillic]=Midi/Караоки плейер -GenericName[ven]=Midi/Tshitambi tsha Karaoke -GenericName[xh]=Umdlali we Midi/Karaoke -GenericName[zh_CN]=Midi/卡拉 OK 播放器 -GenericName[zh_HK]=Midi/卡拉OK 播放器 -GenericName[zh_TW]=Midi/卡拉OK播放器 -GenericName[zu]=Umdlali weMidi/Karaoke -Exec=kmid %u -Icon=kmid -Path= -DocPath=kmid/index.html -Type=Application -Terminal=false -ServiceTypes=Browser/View -X-TDE-Library=libkmidpart -X-TDE-StartupNotify=true -X-DCOP-ServiceType=Multi -Categories=Qt;TDE;AudioVideo; diff --git a/kmid/kmid.lsm b/kmid/kmid.lsm deleted file mode 100644 index 36f0f119..00000000 --- a/kmid/kmid.lsm +++ /dev/null @@ -1,14 +0,0 @@ -Begin4 -Title: kmid -Version: R14.0.0 -Entered-date: 2010-05-10 -Description: A midi/karaoke player with a friendly interface. -Keywords: mid kar player midi karaoke TDE X11 Qt kmid fm awe gus synth -Author: larrosa@kde.org (Antonio Larrosa Jimenez) -Maintained-by: The Trinity Desktop Environment (TDE) http://www.trinitydesktop.org/ -Primary-site: http://git.trinitydesktop.org/cgit/ -Alternate-site: -Original-site: http://perso.wanadoo.es/antlarr/kmid.html -Platforms: Linux and other Unices running TDE -Copying-policy: GPL -End diff --git a/kmid/kmid.spec b/kmid/kmid.spec deleted file mode 100644 index 1c178c1a..00000000 --- a/kmid/kmid.spec +++ /dev/null @@ -1,62 +0,0 @@ -Summary: Play midi/karaoke files and show lyrics. Support External synths, AWE, GUS, and FM devices. For X11/KDE -Name: kmid -Version: 1.2 -Release: 1 -Copyright: GPL -Group: X11/K Desktop Environment/Multimedia -Source: kmid-1.2.tar.gz -Requires: qt >= 1.3 , tdelibs - -%description -KMid is a midi/karaoke file player, with configurable midi mapper, -real Session Management, drag & drop, customizable fonts, etc. -It has a very nice interface which let you easily follow the tune while -changing the color of the lyrics. -It supports output through external synthesizers, AWE, FM and GUS cards. -It also has a keyboard view to see the notes played by each instrument - -%prep -%setup - -%build -export TDEDIR=/opt/kde -./configure -make all - -%install -export TDEDIR=/opt/kde -make install - -%files -%doc kmid/README kmid/COPYING kmid/PEOPLE kmid/kmid.lsm kmid/ChangeLog - -/opt/kde/bin/kmid -/opt/kde/share/doc/tde/HTML/en/kmid -/opt/kde/share/doc/tde/HTML/es/kmid -/opt/kde/share/icons/kmid.xpm -/opt/kde/share/icons/mini/kmid.xpm -/opt/kde/share/applnk/Multimedia/kmid.kdelnk -/opt/kde/share/mimelnk/audio/x-karaoke.kdelnk -/opt/kde/share/apps/kmid/toolbar -/opt/kde/share/apps/kmid/fm -/opt/kde/share/apps/kmid/maps/gm.map -/opt/kde/share/apps/kmid/maps/YamahaPSS790.map -/opt/kde/share/apps/kmid/maps/YamahaPSR500.map -/opt/kde/share/apps/kmid/OFortuna.kar -/opt/kde/share/apps/kmid/StopInTheNameOfLove.kar -/opt/kde/share/apps/kmid/TheGirlFromIpanema.kar -/opt/kde/share/apps/kmid/AnotherGlitchInTheCall.kar -/opt/kde/share/locale/es/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/cs/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/de/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/fi/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/hr/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/pl/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/pt/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/sk/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/eo/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/no/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/sv/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/pt_BR/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/zh_CN.GB2312/LC_MESSAGES/kmid.mo -/opt/kde/share/locale/zh_TW.Big5/LC_MESSAGES/kmid.mo diff --git a/kmid/kmidIface.h b/kmid/kmidIface.h deleted file mode 100644 index 8bba2575..00000000 --- a/kmid/kmidIface.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _KMIDIFACE_H_ -#define _KMIDIFACE_H_ - -#include - -class KMidIface : virtual public DCOPObject -{ - K_DCOP - -k_dcop: -// File - - virtual int openURL( const TQString s )=0; - - // Song - virtual void play()=0; - virtual void pause()=0; - virtual void stop()=0; - virtual void rewind()=0; - virtual void forward()=0; - virtual void seek(int ms)=0; - virtual void prevSong()=0; - virtual void nextSong()=0; - - virtual void setSongLoop(int i)=0; - virtual void setVolume(int i)=0; - virtual void setTempo(int i)=0; -// GUI - - - virtual void setSongEncoding( int i )=0; - virtual void setLyricEvents( int i )=0; - -// Collections - virtual void setCurrentSong(int i)=0; - - virtual void setActiveCollection( int i )=0; - virtual void setCollectionPlayMode(int i)=0; - -// Midi device - - virtual void setMidiDevice(int i)=0; - -}; -#endif - diff --git a/kmid/kmid_part.cpp b/kmid/kmid_part.cpp deleted file mode 100644 index 11e2d405..00000000 --- a/kmid/kmid_part.cpp +++ /dev/null @@ -1,144 +0,0 @@ -#include "kmid_part.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include "kmidclient.h" -#include -#include - -K_EXPORT_COMPONENT_FACTORY( libkmidpart, KMidFactory ) - -/** - * We need one static instance of the factory for our C 'main' - * function - */ -TDEInstance *KMidFactory::s_instance = 0L; - -KMidFactory::KMidFactory() -{ - s_instance=0L; -} - -KMidFactory::~KMidFactory() -{ - if (s_instance) - { - delete s_instance->aboutData(); - delete s_instance; - } - - s_instance = 0; -} - -KParts::Part *KMidFactory::createPartObject(TQWidget *parentWidget, const char *widgetName, - TQObject *parent, const char *name, const char*, - const TQStringList& ) -{ - KParts::Part *obj = new KMidPart(parentWidget, widgetName, parent, name); - return obj; -} - -TDEAboutData *KMidFactory::aboutData() -{ - TDEAboutData *aboutdata = new TDEAboutData("kmid", "KMid", "2.0", - I18N_NOOP("MIDI/Karaoke file player"), TDEAboutData::License_GPL, - I18N_NOOP("(c) 1997,98,99,2000, Antonio Larrosa Jimenez"),"", - "http://perso.wanadoo.es/antlarr/kmid.html"); - aboutdata->addAuthor("Antonio Larrosa Jimenez", - I18N_NOOP("Original Developer/Maintainer"),"larrosa@kde.org", - "http://perso.wanadoo.es/antlarr/index.html"); - return aboutdata; -} - -TDEInstance *KMidFactory::instance() -{ - if ( !s_instance ) - s_instance = new TDEInstance( aboutData() ); - - return s_instance; -} - - KMidPart::KMidPart(TQWidget *parentWidget, const char *widgetName, - TQObject *parent, const char *name) -: KParts::ReadOnlyPart(parent, name) -{ - setInstance(KMidFactory::instance()); - - widget = new kmidClient(parentWidget, actionCollection()); - widget->show(); - widget->setFocusPolicy(TQ_ClickFocus); - setWidget(widget); - - // create and connect our actions - (void)new KAction(i18n("Play"), "player_play", 0, this, - TQT_SLOT(slotPlay()), actionCollection(), - "play"); - - (void)new KAction(i18n("Stop"), "player_stop", 0, this, - TQT_SLOT(slotStop()), actionCollection(), - "stop"); - - (void)new KAction(i18n("Backward"), - "2leftarrow", 0, this, - TQT_SLOT(slotBackward()), actionCollection(), - "backward"); - - (void)new KAction(i18n("Forward"), - "2rightarrow", 0, this, - TQT_SLOT(slotForward()), actionCollection(), - "forward"); - - m_extension = new KMidBrowserExtension(this); - - setXMLFile("kmid_partui.rc"); - - -} - -KMidPart::~KMidPart() -{ -} - -bool KMidPart::openFile() -{ - widget->openURL(m_file); - widget->stop(); - widget->show(); - TQTimer::singleShot(2000, this, TQT_SLOT(slotPlay())); - - return true; -} - -bool KMidPart::closeURL() -{ - slotStop(); - return true; -} - -void KMidPart::slotPlay() -{ - widget->stop(); - widget->play(); -} - - -void KMidPart::slotStop() -{ - widget->stop(); -} -KMidBrowserExtension::KMidBrowserExtension(KMidPart *parent) - : KParts::BrowserExtension(parent, "KMidBrowserExtension") -{ -} - -KMidBrowserExtension::~KMidBrowserExtension() -{ -} -#include "kmid_part.moc" diff --git a/kmid/kmid_part.h b/kmid/kmid_part.h deleted file mode 100644 index 7e26ae14..00000000 --- a/kmid/kmid_part.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef __KMIDPART_H__ -#define __KMIDPART_H__ - -#include -#include -#include -class TDEAboutData; -class TDEInstance; -class KMidBrowserExtension; -class kmidClient; - -class KDE_EXPORT KMidFactory : public KParts::Factory -{ - Q_OBJECT - - public: - KMidFactory(); - virtual ~KMidFactory(); - - virtual KParts::Part* createPartObject(TQWidget *parentWidget, const char *widgetName, - TQObject* parent = 0, const char* name = 0, - const char* classname = TQOBJECT_OBJECT_NAME_STRING, - const TQStringList &args = TQStringList()); - - static TDEInstance *instance(); - - static TDEAboutData *aboutData(); - private: - static TDEInstance *s_instance; -}; - -class KMidPart: public KParts::ReadOnlyPart -{ - Q_OBJECT - - public: - KMidPart(TQWidget *parentWidget, const char *widgetName, - TQObject *parent, const char *name); - virtual ~KMidPart(); - - - virtual bool closeURL(); - - protected: - virtual bool openFile(); - - protected slots: - void slotPlay(); - void slotStop(); - - private: - kmidClient *widget; - KMidBrowserExtension *m_extension; -}; - -class KMidBrowserExtension : public KParts::BrowserExtension -{ - Q_OBJECT - - friend class KMidPart; - public: - KMidBrowserExtension(KMidPart *parent); - virtual ~KMidBrowserExtension(); -}; - -#endif diff --git a/kmid/kmid_partui.rc b/kmid/kmid_partui.rc deleted file mode 100644 index aad5c6b2..00000000 --- a/kmid/kmid_partui.rc +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/kmid/kmidbutton.h b/kmid/kmidbutton.h deleted file mode 100644 index ca48d9fb..00000000 --- a/kmid/kmidbutton.h +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include - -class KMidButton : public TQPushButton -{ -protected: - - TQPixmap pixmap1,pixmap2; - - virtual void drawButton(TQPainter *paint) - { - if ((isOn())&&(!pixmap1.isNull())) paint->drawPixmap(0,0,pixmap1); - else if ((!isOn())&&(!pixmap2.isNull())) paint->drawPixmap(0,0,pixmap2); - }; - -public: - - KMidButton (TQWidget *parent,const char *name) : TQPushButton (parent,name) - { - }; - - ~KMidButton() - { - }; - - void setPixmaps(const TQPixmap& p1, const TQPixmap& p2) - { - pixmap1=p1; - pixmap2=p2; - }; - -}; diff --git a/kmid/kmidclient.cpp b/kmid/kmidclient.cpp deleted file mode 100644 index 284aa40e..00000000 --- a/kmid/kmidclient.cpp +++ /dev/null @@ -1,1606 +0,0 @@ -/************************************************************************** - - kmidclient.cpp - The main client widget of KMid - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include -#include -#include -#include -#include -#include // kill is declared on signal.h on bsd, not sys/signal.h -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include "kmidclient.h" -#include "klcdnumber.h" -#include "randomlist.h" -#include "channelview.h" -#include "channel.h" -#include "version.h" -#include "rhythmview.h" - -//#define TEMPHACK - - -kmidClient::kmidClient(TQWidget *parent, KActionCollection *ac, const char *name) - : DCOPObject("KMidIface"), TQWidget(parent,name) -{ - actionCollection=ac; - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - midifile_opened=0L; - loopsong=cfg->readNumEntry("Loop",0); - collectionplaymode=0; - collectionplaylist=0L; - channelView=0L; - noteArray=0L; - shuttingdown=false; - - TDEConfig *kconf=TDEGlobal::instance()->config(); - - kconf->setGroup("KMid"); - TQString tmp2 = locateLocal("appdata", "collections"); - collectionsfile=kconf->readPathEntry("CollectionsFile",tmp2); - slman=new SLManager(); - slman->loadConfig(TQFile::encodeName(collectionsfile)); - currentsl=NULL; - // currentsl=slman->getCollection(activecollection); - itsme=0; - m_kMid.pid=0; - timebar = new TQSlider(0,240000,30000,60000,Qt::Horizontal, this); - timebar->setSteps(30000,60000); - timebar->setValue(0); - connect (timebar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotSeek(int))); - - timetags = new QSliderTime(timebar,this); - timetags->setMinimumSize(timetags->sizeHint()); - - qlabelTempo= new TQLabel(i18n("Tempo:"), this,"tempolabel", - TQLabel::NoFrame); - - tempoLCD = new KLCDNumber( true, 3, this, "TempoLCD"); - tempoLCD->setValue(120); - tempoLCD->display(120); - currentTempo=120; - tempoLCD->setRange(3,999); - tempoLCD->setDefaultValue(120); - tempoLCD->setUserSetDefaultValue(true); - tempoLCD->setMinimumSize(tempoLCD->sizeHint()); - connect(tempoLCD,TQT_SIGNAL(valueChanged(double)),this,TQT_SLOT(slotSetTempo(double))); - - comboSongs = new TQComboBox(FALSE, this,"Songs"); - connect (comboSongs,TQT_SIGNAL(activated(int)),this,TQT_SLOT(slotSelectSong(int))); - comboSongs->setMinimumWidth(200); - - comboEncodings = new TQComboBox(FALSE, this, "Encodings"); - connect (comboEncodings,TQT_SIGNAL(activated(int)),this,TQT_SLOT(slotSelectEncoding(int))); - comboEncodings->insertItem(i18n("Default")); - comboEncodings->insertStringList( TDEGlobal::charsets()->descriptiveEncodingNames() ); - comboEncodings->setCurrentItem(0); - - rhythmview= new RhythmView( this, "RhythmView"); - rhythmview->setMaximumHeight(7); - rhythmview->setMinimumHeight(7); - - volumebar = new TQSlider(0,200,10,100,Qt::Vertical, this ); - volumebar->setSteps(10,20); - volumebar->setValue(100); - volumebar->setTickmarks(TQSlider::NoMarks); - volumebar->setTickInterval(50); - connect (volumebar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotSetVolume(int))); - - visiblevolumebar=cfg->readNumEntry("ShowVolumeBar",0); - if (visiblevolumebar) volumebar->show(); - else volumebar->hide(); - - typeoftextevents=1; - kdispt=new KDisplayText( this, "KaraokeWindow"); - kdispt->show(); - - timer4timebar=new TQTimer(this); - connect (timer4timebar,TQT_SIGNAL(timeout()),this,TQT_SLOT(timebarUpdate())); - timer4events=new TQTimer(this); - connect (timer4events,TQT_SIGNAL(timeout()),this,TQT_SLOT(processSpecialEvent())); - - TQString samplefile = - TDEGlobal::dirs()->findAllResources("appdata", "fm/*.o3").last(); - samplefile.truncate(samplefile.findRev('/')); - FMOut::setFMPatchesDirectory(TQFile::encodeName(samplefile)); - - m_kMid.pctlsmID=shmget(IPC_PRIVATE,sizeof(PlayerController),0666 | IPC_CREAT ); - if (m_kMid.pctlsmID==-1) - { - printf("ERROR: Cannot allocate shared memory !!!\n" - "Please report to larrosa@kde.org\n"); - exit(1); - } - - m_kMid.pctl=(PlayerController *)shmat(m_kMid.pctlsmID,0L,0); - if (!m_kMid.pctl) - printf("ERROR: Cannot get shared memory !!! " - "Please report to larrosa@kde.org\n"); - m_kMid.pctl->playing=0; - m_kMid.pctl->gm=1; - m_kMid.pctl->volumepercentage=100; - m_kMid.pctl->tempo=500000; - m_kMid.pctl->ratioTempo=1.0; - for (int i=0;i<16;i++) - { - m_kMid.pctl->forcepgm[i]=0; - m_kMid.pctl->pgm[i]=0; - } - - - kconf->setGroup("KMid"); - int mididev=kconf->readNumEntry("MidiPortNumber",-1); - - midi = new DeviceManager(mididev); - midi->initManager(); - m_kMid.midi=midi; - player= new MidiPlayer(midi,m_kMid.pctl); - - kconf->setGroup("Midimapper"); - TQCString qs=TQFile::encodeName(kconf->readPathEntry("Loadfile","gm.map")); - -#ifdef KMidDEBUG - printf("Read Config file: %s\n",qs.data()); -#endif - setMidiMapFilename(qs.data()); - - initializing_songs=1; - kconf->setGroup("KMid"); - setActiveCollection(kconf->readNumEntry("ActiveCollection",0)); - initializing_songs=0; - - TQVBoxLayout *lv=new TQVBoxLayout( this ); - lv->addWidget( timebar ); - lv->addWidget( timetags ); - lv->addSpacing(5); - TQHBoxLayout *lh=new TQHBoxLayout( lv ); - lh->addWidget( qlabelTempo ); - lh->addWidget( tempoLCD ); - lh->addWidget( comboSongs, 6 ); - lv->addSpacing(5); - lh->addWidget( comboEncodings, 1 ); - lv->addSpacing(5); - lv->addWidget( rhythmview ); - lv->addSpacing(2); - TQHBoxLayout *lh2=new TQHBoxLayout( lv ); - lh2->addWidget( volumebar ); - lh2->addWidget( kdispt ); -} - -/*void kmidClient::resizeEvent(TQResizeEvent *) -{ - //timebar->resize(width()-5,timebar->height()); - timebar->setGeometry(5,10,width()-5,timebar->height()); - timetags->setGeometry(5,10+timebar->height(),width()-5,timetags->getFontHeight()); - comboSongs->setGeometry(tempoLCD->x()+tempoLCD->width()+15,tempoLCD->y(),width()-(tempoLCD->x()+tempoLCD->width()+25),tempoLCD->height()); - rhythmview->setGeometry(5,10+timebar->height()+timetags->height()+5+tempoLCD->height()+2,width()-10,7); - volumebar->setGeometry(5,10+timebar->height()+timetags->height()+5+tempoLCD->height()+10,15,height()-(10+timebar->height()+timetags->height()+5+tempoLCD->height()+15)); - kdispt->setGeometry(((visiblevolumebar)?25:5),10+timebar->height()+timetags->height()+5+tempoLCD->height()+10,width()-(5+((visiblevolumebar)?25:5)),height()-(10+timebar->height()+timetags->height()+5+tempoLCD->height()+10)); -} -*/ - -kmidClient::~kmidClient() -{ - if (m_kMid.pctl->playing==1) - { - stop(); - // sleep(1); - } - - if (m_kMid.pid!=0) - { - kill(m_kMid.pid,SIGTERM); - waitpid(m_kMid.pid, 0L, 0); - m_kMid.midi->closeDev(); - m_kMid.pid=0; - } - - allNotesOff(); - - delete midifile_opened; - delete player; - delete midi; - delete [] collectionplaylist; - - saveCollections(); - delete slman; - -// Let's detach and delete shared memory - shmdt((char *)m_kMid.pctl); - shmctl(m_kMid.pctlsmID, IPC_RMID, 0L); - m_kMid.pctl=0L; -} - -// Use KURL::filename ! (David) -char *extractFilename(const char *in,char *out) -{ - char *p=(char *)in; - char *result=out; - char *filename=(char *)in; - while (*p!=0) - { - if (*p=='/') filename=p+1; - p++; - } - while (*filename!=0) - { - *out=*filename; - out++; - filename++; - } - *out=0; - return result; -} - -int kmidClient::openFile(const char *filename) -{ - m_kMid.pctl->message|=PLAYER_HALT; - stop(); - int r; - player->setGenerateBeats(true); - if ((r=player->loadSong(filename))!=0) - { - TQString errormsg; - switch (r) - { - case (-1) : errormsg = - i18n("The file %1 does not exist or cannot be opened.").arg(filename); - break; - case (-2) : errormsg = - i18n("The file %1 is not a MIDI file.").arg(filename);break; - case (-3) : errormsg = - i18n("Ticks per quarter note is negative. Please send this file to larrosa@kde.org");break; - case (-4) : errormsg = - i18n("Not enough memory.");break; - case (-5) : errormsg = - i18n("This file is corrupted or not well built.");break; - case (-6) : errormsg = - i18n("%1 is not a regular file.").arg(filename);break; - default : errormsg = i18n("Unknown error message");break; - } - KMessageBox::error(this, errormsg); - // player->loadSong(midifile_opened); - if (midifile_opened) delete midifile_opened; - midifile_opened=0L; - timebar->setRange(0,240000); - timebar->setValue(0); - timetags->repaint(TRUE); - kdispt->ClearEv(); - kdispt->repaint(TRUE); - topLevelWidget()->setCaption("KMid"); - - return -1; - } - - if (midifile_opened) delete midifile_opened; - midifile_opened=new char[strlen(filename)+1]; - strcpy(midifile_opened,filename); -#ifdef KMidDEBUG - printf("TOTAL TIME: %g milliseconds\n",player->information()->millisecsTotal); -#endif - // noteArray=player->parseNotes(); - noteArray=player->noteArray(); - timebar->setRange(0,(int)(player->information()->millisecsTotal)); - timetags->repaint(TRUE); - kdispt->ClearEv(); - spev=player->specialEvents(); - while (spev) - { - if ((spev->type==1) || (spev->type==5)) - { - kdispt->AddEv(spev); - } - spev=spev->next; - } - - kdispt->calculatePositions(); - kdispt->CursorToHome(); -// kdispt->updateScrollBars(); - emit mustRechooseTextEvent(); - kdispt->repaint(TRUE); - tempoLCD->display(tempoToMetronomeTempo(m_kMid.pctl->tempo)); - currentTempo=tempoLCD->getValue(); - tempoLCD->setDefaultValue(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo); - - char *fn=new char[strlen(filename)+20]; - extractFilename(filename,fn); - char *capt=new char[strlen(fn)+20]; - sprintf(capt,"KMid - %s",fn); - delete fn; - topLevelWidget()->setCaption(capt); - delete capt; - - timebar->setValue(0); - return 0; -} - -int kmidClient::openURL(const TQString _url) -{ - KURL u(_url); - if (!u.isValid()) {printf("Malformed URL\n");return -1;}; - - TQString filename; - bool deleteFile=false; - if (!u.isLocalFile()) - { - filename = TQString("/tmp/") + u.filename(); - TDEIO::Job *iojob = TDEIO::copy( u, KURL::fromPathOrURL( filename ) ); - downloaded=false; - connect( iojob, TQT_SIGNAL( result( TDEIO::Job *) ), this, TQT_SLOT(downloadFinished( TDEIO::Job * ) ) ); - - if (!downloaded) - kapp->enter_loop(); - deleteFile=true; - - } - else - { - filename=u.path(); - } - - TQCString filename_8bit = TQFile::encodeName(filename); - int r=-1; - if (!filename_8bit.isEmpty()) - { - r=openFile(filename_8bit.data()); - - TDEConfig *cfg=TDEGlobal::instance()->config(); - if (cfg->readBoolEntry("deleteTmpNonLocalFiles",false)) - { - unlink(filename_8bit.data()); - } - } - return r; -} - -ulong kmidClient::timeOfNextEvent(int *type) -{ - int t=0; - ulong x=0; - - - if (!channelView) - { - if ((spev)&&(spev->type!=0)) - { - t=1; - x=spev->absmilliseconds; - } - } - else - { - if (noteArray) - { - NoteArray::noteCmd *ncmd=noteArray->get(); - if (!ncmd) - { - if ((spev)&&(spev->type!=0)) - { - t=1; - x=spev->absmilliseconds; - } - } - else - { - if ((!spev)||(spev->type==0)) - { - t=2; - x=ncmd->ms; - } - else - { - if (spev->absmillisecondsms) - { - t=1; - x=spev->absmilliseconds; - } - else - { - t=2; - x=ncmd->ms; - } - - } - } - } - } - - if (type) *type=t; - return x; - /* - - if (type!=NULL) *type=0; - if (channelView==NULL) - { - if ((spev!=NULL)&&(spev->type!=0)) - { - if (type!=NULL) *type=1; - return spev->absmilliseconds; - } - else return 0; - } - - if (noteArray==NULL) return 0; - noteCmd *ncmd=noteArray->get(); - if (ncmd==NULL) - { - if ((spev!=NULL)&&(spev->type!=0)) - { - if (type!=NULL) *type=1; - return spev->absmilliseconds; - } - else return 0; - } - else - { - if ((spev==NULL)||(spev->type==0)) - { - if (type!=NULL) *type=2; - return ncmd->ms; - } - else - { - if (spev->absmillisecondsms) - { - if (type!=NULL) *type=1; - return spev->absmilliseconds; - } - else - { - if (type!=NULL) *type=2; - return ncmd->ms; - } - - } - } - */ -} - -void kmidClient::slotPlay() -{ - if (!player->isSongLoaded()) - { - KMessageBox::sorry(this, - i18n("You must load a file before playing it.")); - return; - } - if (m_kMid.pctl->playing==1) - { - KMessageBox::sorry(this, - i18n("A song is already being played.")); - return; - } - if (midi->checkInit()==-1) - { - KMessageBox::error(this, - i18n("Could not open /dev/sequencer.\nProbably there is another program using it.")); - return; - } - - kdispt->CursorToHome(); - m_kMid.pctl->message=0; - m_kMid.pctl->playing=0; - m_kMid.pctl->finished=0; - m_kMid.pctl->error=0; - m_kMid.pctl->SPEVplayed=0; - m_kMid.pctl->SPEVprocessed=0; -#ifdef KMidDEBUG - passcount=0; -#endif - noteArray->iteratorBegin(); - - TQApplication::flushX(); - if ((m_kMid.pid=fork())==0) - { -#ifdef KMidDEBUG - printf("PlayerProcessID: %d\n",getpid()); -#endif - player->play(0,(void (*)(void))kmidOutput); -#ifdef KMidDEBUG - printf("End of child process\n"); -#endif - _exit(0); - } - m_kMid.pctl->millisecsPlayed=0; - - - spev=player->specialEvents(); -#ifdef KMidDEBUG - printf("writing SPEV\n"); - player->debugSpecialEvents(); - printf("writing SPEV(END)\n"); -#endif - - while ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->error==0)) ; - - if (m_kMid.pctl->error==1) return; - beginmillisec=m_kMid.pctl->beginmillisec; - - int type; - ulong x=timeOfNextEvent(&type); - if (type!=0) - timer4events->start(x,TRUE); - - timer4timebar->start(1000); - -#ifdef KMidDEBUG - printf("PlayerProcess: %d . ParentProcessID: %d\n",m_kMid.pid,getpid()); - printf("******************************-\n"); -#endif -} - -void kmidClient::timebarUpdate() -{ - itsme=1; - if (m_kMid.pctl->playing==0) - { - timer4timebar->stop(); - } - - timeval tv; - gettimeofday(&tv, NULL); - ulong currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; - m_kMid.pctl->millisecsPlayed=(currentmillisec-beginmillisec); - - timebar->setValue((int)(m_kMid.pctl->millisecsPlayed)); - itsme=0; - if ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->finished==1)) - { - waitpid(m_kMid.pid, NULL, 0); - if (loopsong) - { - play(); - return; - } - else - nextSong(); - } -} - -void kmidClient::slotSeek(int i) -{ - if (itsme) return; - - if (m_kMid.pctl->playing==0) - { - itsme=1; - timebar->setValue(0); - itsme=0; - return; - } - - if (m_kMid.pctl->paused) return; - - if (m_kMid.pid!=0) - { - kill(m_kMid.pid,SIGTERM); -#ifdef KMidDEBUG - printf("Waiting for Process %d to be killed\n",m_kMid.pid); -#endif - waitpid(m_kMid.pid, NULL, 0); - m_kMid.midi->closeDev(); - m_kMid.pid=0; - } - allNotesOff(); - - -#ifdef KMidDEBUG - printf("change Time: %d\n",i); -#endif - - timer4events->stop(); - if (channelView!=NULL) channelView->reset(0); - - moveEventPointersTo((ulong)i); - - m_kMid.pctl->playing=0; - m_kMid.pctl->OK=0; - m_kMid.pctl->error=0; - m_kMid.pctl->gotomsec=i; - m_kMid.pctl->message|=PLAYER_SETPOS; - - TQApplication::flushX(); - if ((m_kMid.pid=fork())==0) - { -#ifdef KMidDEBUG - printf("Player_ProcessID: %d\n",getpid()); -#endif - - player->play(0,(void (*)(void))kmidOutput); - -#ifdef KMidDEBUG - printf("End of child process\n"); -#endif - _exit(0); - } - - while ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->error==0)) ; - - if (m_kMid.pctl->error==1) return; - beginmillisec=m_kMid.pctl->beginmillisec-i; - ulong currentmillisec=m_kMid.pctl->beginmillisec; - - int type; - ulong x=timeOfNextEvent(&type); - if (type!=0) - timer4events->start(x-(currentmillisec-beginmillisec),TRUE); - - /* - if (spev==NULL) return; - ulong delaymillisec=spev->absmilliseconds-(currentmillisec-beginmillisec); - timer4events->start(delaymillisec,TRUE); - */ - - m_kMid.pctl->OK=0; -/* - tempoLCD->display(tempoToMetronomeTempo(m_kMid.pctl->tempo)); - currentTempo=tempoLCD->getValue(); - tempoLCD->setDefaultValue(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo); -*/ -} - -void kmidClient::moveEventPointersTo(ulong ms) -{ -#ifdef KMidDEBUG - printf("Move To: %lu\n",ms); -#endif - spev=player->specialEvents(); - - ulong tempo=(ulong)(500000 * m_kMid.pctl->ratioTempo); - int num=4; - int den=4; - - while ((spev!=NULL)&&(spev->absmillisecondstype==3) tempo=spev->tempo; - else if (spev->type==6) {num=spev->num;den=spev->den;} - spev=spev->next; - } - tempoLCD->display(tempoToMetronomeTempo(tempo)); - currentTempo=tempoLCD->getValue(); - tempoLCD->setDefaultValue(tempoToMetronomeTempo(tempo)*m_kMid.pctl->ratioTempo); - - rhythmview->setRhythm(num,den); - - kdispt->gotomsec(ms); -// if (noteArray!=NULL) noteArray->moveIteratorTo(ms); - if (noteArray!=NULL) - { - int pgm[16]; - noteArray->moveIteratorTo(ms,pgm); - if (channelView!=NULL) - { - for (int j=0;j<16;j++) - { - if (!m_kMid.pctl->forcepgm[j]) channelView->changeInstrument(j,(m_kMid.pctl->gm==1)?(pgm[j]):(MT32toGM[pgm[j]])); - else channelView->changeInstrument(j,(m_kMid.pctl->pgm[j])); - } - } - } - - /* - if (noteArray!=NULL) - { - noteCmd *ncmd; - noteArray->iteratorBegin(); - ncmd=noteArray->get(); - while ((ncmd!=NULL)&&(ncmd->msnext(); - ncmd=noteArray->get(); - } - } - */ -} - -void kmidClient::slotSetVolume(int i) -{ - int autochangemap=0; - if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autochangemap=1; - - if (autochangemap) - { - pause(); - } - i=200-i; - m_kMid.pctl->volumepercentage=i; - - if (autochangemap) - { - pause(); - } -} - - -void kmidClient::slotPrevSong() -{ - if (currentsl==NULL) return; - if (collectionplaylist==NULL) generateCPL(); - if (collectionplaylist==NULL) return; - /* - if (collectionplaymode==0) - { - if (currentsl->getActiveSongID()==1) return; - currentsl->previous(); - } - else - { - int r; - while ((r=1+(int) ((double)(currentsl->NumberOfSongs())*rand()/(RAND_MAX+1.0)))==currentsl->getActiveSongID()) ; - - currentsl->setActiveSong(r); - } - */ - int idx=searchInCPL(currentsl->getActiveSongID()); - if (idx==0) return; - idx--; - currentsl->setActiveSong(collectionplaylist[idx]); - - if (currentsl->getActiveSongID()==-1) - { - // comboSongs->setCurrentItem(0); - // currentsl->setActiveSong(1); - return; - } - - if (m_kMid.pctl->paused) emit stopPause(); - comboSongs->setCurrentItem(currentsl->getActiveSongID()-1); - if (openURL(currentsl->getActiveSongName())==-1) return; - play(); - -} - -void kmidClient::slotNextSong() -{ - if (currentsl==NULL) return; - if (collectionplaylist==NULL) generateCPL(); - if (collectionplaylist==NULL) return; - - /*if (collectionplaymode==0) - { - if (currentsl->getActiveSongID()==currentsl->NumberOfSongs()) return; - currentsl->next(); - } - else - { - int r; - while ((r=1+(int) ((double)(currentsl->NumberOfSongs())*rand()/(RAND_MAX+1.0)))==currentsl->getActiveSongID()) ; - - #ifdef KMidDEBUG - printf("random number:%d\n",r); - #endif - currentsl->setActiveSong(r); - } - */ - int idx=searchInCPL(currentsl->getActiveSongID()); - idx++; - if (idx==currentsl->NumberOfSongs()) return; - currentsl->setActiveSong(collectionplaylist[idx]); - if (currentsl->getActiveSongID()==-1) - { - //// comboSongs->setCurrentItem(0); - // currentsl->setActiveSong(1); - return; - } - - if (m_kMid.pctl->paused) emit stopPause(); - comboSongs->setCurrentItem(currentsl->getActiveSongID()-1); - if (openURL(currentsl->getActiveSongName())==-1) return; - play(); -} - -void kmidClient::slotPause() -{ - if (m_kMid.pctl->playing==0) return; -#ifdef KMidDEBUG - printf("song Pause\n"); -#endif - if (m_kMid.pctl->paused==0) - { - if (m_kMid.pid!=0) - { - kill(m_kMid.pid,SIGTERM); - waitpid(m_kMid.pid, NULL, 0); - m_kMid.midi->closeDev(); - m_kMid.pid=0; - } - pausedatmillisec=(ulong)m_kMid.pctl->millisecsPlayed; - m_kMid.pctl->paused=1; - timer4timebar->stop(); - timer4events->stop(); - allNotesOff(); - // kill(m_kMid.pid,SIGSTOP); - // The previous line doesn't work because it stops the two processes (!?) - } - else - { - m_kMid.pctl->playing=0; - m_kMid.pctl->OK=0; - m_kMid.pctl->error=0; - m_kMid.pctl->gotomsec=pausedatmillisec; - m_kMid.pctl->message|=PLAYER_SETPOS; - - TQApplication::flushX(); - if ((m_kMid.pid=fork())==0) - { -#ifdef KMidDEBUG - printf("PlayerProcessID: %d\n",getpid()); -#endif - player->play(0,(void (*)(void))kmidOutput); -#ifdef KMidDEBUG - printf("End of child process\n"); -#endif - _exit(0); - } - - while ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->error==0)) ; - - if (m_kMid.pctl->error) return; - - m_kMid.pctl->OK=0; - m_kMid.pctl->paused=0; - - beginmillisec=m_kMid.pctl->beginmillisec-pausedatmillisec; - ulong currentmillisec=m_kMid.pctl->beginmillisec; - - int type; - ulong x=timeOfNextEvent(&type); - if (type!=0) - timer4events->start(x-(currentmillisec-beginmillisec),TRUE); - timer4timebar->start(1000); - - if (noteArray!=NULL) - { - int pgm[16]; - noteArray->moveIteratorTo(pausedatmillisec,pgm); - if (channelView!=NULL) - { - for (int j=0;j<16;j++) - { - if (!m_kMid.pctl->forcepgm[j]) channelView->changeInstrument(j,(m_kMid.pctl->gm==1)?(pgm[j]):(MT32toGM[pgm[j]])); - else channelView->changeInstrument(j,(m_kMid.pctl->pgm[j])); - } - } - - } - - } -} - -void kmidClient::shuttingDown(void) -{ - shuttingdown=true; - stop(); -} - -void kmidClient::slotStop() -{ - if (!m_kMid.pctl) return; - - if (!shuttingdown) - { - for (int i=0;i<16;i++) m_kMid.pctl->forcepgm[i]=FALSE; - if (channelView) channelView->reset(); - if (tempoLCD) - { - tempoLCD->display(tempoToMetronomeTempo(m_kMid.pctl->tempo)); - currentTempo=tempoLCD->getValue(); - tempoLCD->setDefaultValue(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo); - } - } - - if (m_kMid.pctl->playing==0) return; - - if (m_kMid.pctl->paused) return; -#ifdef KMidDEBUG - printf("song Stop\n"); -#endif - if (m_kMid.pid!=0) - { - kill(m_kMid.pid,SIGTERM); -#ifdef KMidDEBUG - printf("Killing\n"); -#endif - waitpid(m_kMid.pid, NULL, 0); - m_kMid.midi->closeDev(); - m_kMid.pid=0; - } - - m_kMid.pctl->playing=0; - ////////m_kMid.pctl->OK=0; - ////////m_kMid.pctl->message|=PLAYER_HALT; - timer4timebar->stop(); - timer4events->stop(); - - allNotesOff(); - - //m_kMid.pctl->playing=0; - //m_kMid.pctl->paused=0; - ////////while (m_kMid.pctl->OK==0) ; -} - -void kmidClient::slotRewind() -{ - if ((m_kMid.pctl->playing)&&(!m_kMid.pctl->paused)) - { - timebar->subtractPage(); - slotSeek(timebar->value()); - } -} - -void kmidClient::slotForward() -{ - if ((m_kMid.pctl->playing)&&(!m_kMid.pctl->paused)) - { - timebar->addPage(); - slotSeek(timebar->value()); - } -} - - -void kmidClient::allNotesOff() -{ - bool done=false; - m_kMid.pctl->isSendingAllNotesOff=true; - DeviceManager *_midi=new DeviceManager(); - _midi->initManager(); - _midi->openDev(); - _midi->allNotesOff(); - _midi->closeDev(); - delete _midi; - done=true; - m_kMid.pctl->isSendingAllNotesOff=false; -} - -void kmidClient::kmidOutput(void) -{ -// Should do nothing - /* - Midi_event *ev=pctl->ev; - - timeval tv; - gettimeofday(&tv, NULL); - ulong currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; - - if ((ev->command==MIDI_SYSTEM_PREFIX)&&((ev->command|ev->chn)==META_EVENT)) - { - if ((ev->d1==5)||(ev->d1==1)) - { - char *text=new char[ev->length+1]; - strncpy(text,(char *)ev->data,ev->length); - text[ev->length]=0; -#ifdef KMidDEBUG - printf("%s , played at: %ld\n",text,currentmillisec-beginmillisec); -#endif - } - else if (ev->d1==ME_SET_TEMPO) - { - int tempo=(ev->data[0]<<16)|(ev->data[1]<<8)|(ev->data[2]); - // printf("Change tempo: %d , %g, played at:%ld\n",tempo,tempoToMetronomeTempo(tempo),currentmillisec-beginmillisec); - } - - } - */ -} - - -void kmidClient::processSpecialEvent() -{ -/* - if (spev==NULL) - { - printf("SPEV == NULL !!!!!\n"); - return; - } -*/ - -//#ifdef KMidDEBUG -// printf(":::: %ld",passcount++); -// printf("%d %s %ld",spev->type,spev->text,spev->absmilliseconds); -//#endif - - int processNext=1; - int type; - ulong x; - - long delaymillisec=~0; - - while (processNext) - { - /* - timeval tv; - gettimeofday(&tv, NULL); - ulong currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; - */ - - x=timeOfNextEvent(&type); - - if (type==0) return; - if (type==1) - { - if ((spev->type==1) || (spev->type==5)) - { - kdispt->PaintIn(spev->type); - } - else if (spev->type==3) - { - tempoLCD->display(tempoToMetronomeTempo(spev->tempo)); -#ifdef KMidDEBUG - printf("Changing lcd tempo: spev->tempo: %d , ratio: %.9g\n",spev->tempo,m_kMid.pctl->ratioTempo); - printf("Result: %g %.9g %d\n",tempoToMetronomeTempo(spev->tempo),tempoToMetronomeTempo(spev->tempo),(int)tempoToMetronomeTempo(spev->tempo)); -#endif - currentTempo=tempoLCD->getValue(); - tempoLCD->setDefaultValue(tempoToMetronomeTempo(spev->tempo)*m_kMid.pctl->ratioTempo); - } - else if (spev->type==6) - { - rhythmview->setRhythm(spev->num,spev->den); - } - else if (spev->type==7) - { -#ifdef KMidDEBUG - printf("Beat: %d/%d\n",spev->num,spev->den); -#endif - rhythmview->Beat(spev->num); - } - m_kMid.pctl->SPEVprocessed++; - spev=spev->next; - } - if (type==2) - { - NoteArray::noteCmd *ncmd=noteArray->get(); - if (ncmd==NULL) {printf("ncmd is NULL !!!");return;} - if (channelView!=NULL) - { - if (ncmd->cmd==1) channelView->noteOn(ncmd->chn,ncmd->note); - else if (ncmd->cmd==0) channelView->noteOff(ncmd->chn,ncmd->note); - else if (ncmd->cmd==2) - if (!m_kMid.pctl->forcepgm[ncmd->chn]) channelView->changeInstrument(ncmd->chn,(m_kMid.pctl->gm==1)?(ncmd->note):(MT32toGM[ncmd->note])); - else channelView->changeInstrument(ncmd->chn,(m_kMid.pctl->pgm[ncmd->chn])); - - noteArray->next(); - } - } - processNext=0; - - x=timeOfNextEvent(&type); - - if (type==0) return; - - timeval tv; - ulong currentmillisec; - gettimeofday(&tv, NULL); - currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; - delaymillisec=x-(currentmillisec-beginmillisec); - if (delaymillisec<10) processNext=1; - } - - if (delaymillisec!=~(long)0) timer4events->start(delaymillisec,TRUE); - -} - -void kmidClient::repaintText(int type) -{ - kdispt->ChangeTypeOfTextEvents(type); - typeoftextevents=type; - kdispt->repaint(TRUE); -} - -int kmidClient::ChooseTypeOfTextEvents(void) -{ - return kdispt->ChooseTypeOfTextEvents(); -} - -void kmidClient::setSongType(int i) -{ - int autochangetype=0; - if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autochangetype=1; - - if (autochangetype) - { - pause(); - } - m_kMid.pctl->gm=i; - - if (autochangetype) - { - pause(); - } - -} - - -TQFont * kmidClient::getFont(void) -{ -return kdispt->getFont(); -} - -void kmidClient::fontChanged(void) -{ - kdispt->fontChanged(); -} - -void kmidClient::setMidiDevice(int i) -{ - midi->setDefaultDevice(i); -} - -void kmidClient::setMidiMapFilename(const char *mapfilename) -{ - MidiMapper *map=new MidiMapper(mapfilename); - if (map->ok()==-1) - { - TQString tmp = locate("appdata", TQString("maps/") + mapfilename); - delete map; - map=new MidiMapper(tmp.local8Bit()); - if (map->ok()!=1) - { - delete map; - map=new MidiMapper(NULL); - } - } - int autochangemap=0; - if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autochangemap=1; - - if (autochangemap) - { - pause(); - } - midi->setMidiMap(map); - if (autochangemap) - { - pause(); - } -} - -void kmidClient::setSLManager(SLManager *slm) -{ - if (slman!=NULL) delete slman; - slman=slm; -} - -void kmidClient::setActiveCollection(int i) -{ - activecollection=i; - TDEConfig *kconf=TDEGlobal::instance()->config(); - - kconf->setGroup("KMid"); - kconf->writeEntry("ActiveCollection",activecollection); - currentsl=slman->getCollection(activecollection); - generateCPL(); - initializing_songs=1; - fillInComboSongs(); - initializing_songs=0; -} - -void kmidClient::fillInComboSongs(void) -{ - //int oldselected=comboSongs->currentItem(); - comboSongs->clear(); - //comboSongs->setCurrentItem(-1); - if (currentsl==NULL) return; - currentsl->iteratorStart(); - char temp[FILENAME_MAX]; - char temp2[FILENAME_MAX]; - TQString qs; - while (!currentsl->iteratorAtEnd()) - { - qs=currentsl->getIteratorName(); - //KURL::decode(qs); - sprintf(temp,"%d - %s",currentsl->getIteratorID(), - extractFilename(KURL::decode_string(qs).ascii(),temp2)); - comboSongs->insertItem(temp); - currentsl->iteratorNext(); - } - if (currentsl->getActiveSongID()==-1) return; - comboSongs->setCurrentItem(currentsl->getActiveSongID()-1); - /* - if (oldselected==currentsl->getActiveSongID()-1) - { - slotSelectSong(currentsl->getActiveSongID()-1); - } - */ - slotSelectSong(currentsl->getActiveSongID()-1); -} - -void kmidClient::slotSelectSong(int i) -{ - if (currentsl==NULL) return; - i++; - if ((i<=0)) // The collection may be empty, or it may be just a bug :-) - { -#ifdef KMidDEBUG - printf("Empty\n"); -#endif - emit stopPause(); - if (m_kMid.pctl->playing) stop(); - if (midifile_opened!=NULL) delete midifile_opened; - midifile_opened=NULL; - player->removeSong(); - timebar->setRange(0,240000); - timebar->setValue(0); - timetags->repaint(TRUE); - kdispt->ClearEv(); - kdispt->repaint(TRUE); - comboSongs->clear(); - comboSongs->repaint(TRUE); - topLevelWidget()->setCaption("KMid"); - return; - } - - if ((i==currentsl->getActiveSongID())&&(!initializing_songs)) return; - int pl=0; - if (m_kMid.pctl->playing==1) pl=1; - - if (m_kMid.pctl->paused) emit stopPause(); - if (/*(i!=currentsl->getActiveSongID())&&*/(pl==1)) stop(); - currentsl->setActiveSong(i); - if (openURL(currentsl->getActiveSongName())==-1) return; - if (pl) play(); - -} - - -int kmidClient::getSelectedSong(void) -{ - if (currentsl==NULL) return -1; - return currentsl->getActiveSongID(); -} - - -void kmidClient::setSongLoop(int i) -{ - loopsong=i; -} - - -void kmidClient::generateCPL(void) -{ - delete [] collectionplaylist; - collectionplaylist=0; - - if (currentsl==NULL) return; - - if (collectionplaymode==0) - collectionplaylist=generate_list(currentsl->NumberOfSongs()); - else - collectionplaylist=generate_random_list(currentsl->NumberOfSongs()); -} - - -void kmidClient::setCollectionPlayMode(int i) -{ - collectionplaymode=i; - generateCPL(); -} - -void kmidClient::saveCollections(void) -{ - if (slman==NULL) return; -#ifdef KMidDEBUG - printf("Saving collections in: %s\n",collectionsfile.ascii()); -#endif - slman->saveConfig(TQFile::encodeName(collectionsfile)); -} - -void kmidClient::saveLyrics(FILE *fh) -{ - if (kdispt!=NULL) kdispt->saveLyrics(fh); -} - -int kmidClient::searchInCPL(int song) -{ - if (currentsl==NULL) return -1; - int i=0; - int n=currentsl->NumberOfSongs(); - while ((ishow(); - else - volumebar->hide(); -#endif -} - -void kmidClient::visibleChannelView(int i) -{ - if ((channelView==NULL)&&(i==1)) - { - channelView=new ChannelView(); - if (noteArray!=NULL) - { - int pgm[16],j; - noteArray->moveIteratorTo((ulong)m_kMid.pctl->millisecsPlayed,pgm); - for (j=0;j<16;j++) - { - if (!m_kMid.pctl->forcepgm[j]) channelView->changeInstrument(j,(m_kMid.pctl->gm==1)?(pgm[j]):(MT32toGM[pgm[j]])); - else channelView->changeInstrument(j,(m_kMid.pctl->pgm[j])); - channelView->changeForceState(j,m_kMid.pctl->forcepgm[j]); - } - } - channelView->show(); - connect(channelView,TQT_SIGNAL(signalToKMidClient(int *)),this,TQT_SLOT(communicationFromChannelView(int *))); - connect(kapp,TQT_SIGNAL(shutDown()),parentWidget(),TQT_SLOT(shuttingDown())); - - } - else if ((channelView!=NULL)&&(i==0)) - { - delete channelView; - channelView=NULL; - - } - rethinkNextEvent(); -} - -void kmidClient::channelViewDestroyed() -{ - channelView=NULL; - rethinkNextEvent(); -} - - -void kmidClient::rethinkNextEvent(void) -{ - if (m_kMid.pctl->playing==0) return; - timer4events->stop(); - - int type; - ulong delaymillisec; - ulong x=timeOfNextEvent(&type); - - if (type==0) return; - - timeval tv; - ulong currentmillisec; - gettimeofday(&tv, NULL); - currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; - delaymillisec=x-(currentmillisec-beginmillisec); - - timer4events->start(delaymillisec,TRUE); -} - -void kmidClient::communicationFromChannelView(int *i) -{ - if (i==NULL) return; - int autocontplaying=0; - if ((i[0]==CHN_CHANGE_PGM)||((i[0]==CHN_CHANGE_FORCED_STATE)&&(i[3]==1))) - { - if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autocontplaying=1; - - if (autocontplaying) - { - pause(); - } - } - if (i[0]==CHN_CHANGE_PGM) - m_kMid.pctl->pgm[i[1]-1]=i[2]; - else if (i[0]==CHN_CHANGE_FORCED_STATE) - m_kMid.pctl->forcepgm[i[1]-1]=i[2]; - if ((i[0]==CHN_CHANGE_PGM)||((i[0]==CHN_CHANGE_FORCED_STATE)&&(i[3]==1))) - { - if (autocontplaying) - { - pause(); - } - } - -} - -void kmidClient::slotSetTempo(double value) -{ - if (!player->isSongLoaded()) - { - tempoLCD->display(120); - currentTempo=120; - tempoLCD->setDefaultValue(120); - return; - } - -#ifdef KMidDEBUG - printf("Change tempo to %g\n",value); -#endif - int autocontplaying=0; - - if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autocontplaying=1; - - - if (autocontplaying) - { - pause(); - } - -// double ratio=(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo)/(value); -// double ratio=(tempoLCD->getOldValue()*m_kMid.pctl->ratioTempo)/(value); - double ratio=(currentTempo*m_kMid.pctl->ratioTempo)/value; - - char s[20]; - sprintf(s,"%g",ratio); - if (strcmp(s,"1")!=0) tempoLCD->setLCDColor (255,100,100); - else tempoLCD->setLCDColor (100,255,100); -#ifdef KMidDEBUG - printf("ratio: (%.9g = %g ) tempo now: %g , new tempo %g\n",ratio,ratio,tempoToMetronomeTempo(m_kMid.pctl->tempo),value); - printf("OldValue: %g , value %g\n",tempoLCD->getOldValue(),value); -#endif - - if (m_kMid.pctl->paused==1) - { - pausedatmillisec=(long)(((double)pausedatmillisec/m_kMid.pctl->ratioTempo)*ratio); -#ifdef KMidDEBUG - printf("pausedat: %ld\n",pausedatmillisec); -#endif - } - player->setTempoRatio(ratio); - - timebar->setRange(0,(int)(player->information()->millisecsTotal)); - timebar->setValue(pausedatmillisec); - timetags->repaint(TRUE); - - kdispt->ClearEv(false); - - noteArray=player->noteArray(); - spev=player->specialEvents(); - currentTempo=value; - - while (spev!=NULL) - { - if ((spev->type==1) || (spev->type==5)) - { - kdispt->AddEv(spev); - } - spev=spev->next; - } - - kdispt->calculatePositions(); - kdispt->CursorToHome(); - if (m_kMid.pctl->paused==1) - moveEventPointersTo(pausedatmillisec); - - if (autocontplaying) - { - pause(); - } - -} - -void kmidClient::downloadFinished(TDEIO::Job *) -{ - downloaded=true; - kapp->exit_loop(); -} - -TQSize kmidClient::sizeHint() const -{ - TQSize sh = TQWidget::sizeHint(); - return sh.expandedTo(TQSize(560,420)); -} - -TQSizePolicy kmidClient::sizePolicy() -{ - return TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); -} - - -void kmidClient::play() -{ - slotPlay(); -} -void kmidClient::pause() -{ - slotPause(); -} -void kmidClient::stop() -{ - slotStop(); -} -void kmidClient::rewind() -{ - slotRewind(); -} -void kmidClient::forward() -{ - slotForward(); -} -void kmidClient::seek(int ms) -{ - slotSeek(ms); -} -void kmidClient::prevSong() -{ - slotPrevSong(); -} -void kmidClient::nextSong() -{ - slotNextSong(); -} -void kmidClient::setVolume(int i) -{ - slotSetVolume(200-i); -} -void kmidClient::setTempo(int i) -{ - slotSetTempo(i); -} -void kmidClient::setSongEncoding( int i ) -{ - KListAction *tmplistaction= - ((KListAction*)actionCollection->action("file_type")); - - tmplistaction->setCurrentItem(i); -} -void kmidClient::setLyricEvents( int i ) -{ - KListAction *tmplistaction= - ((KListAction*)actionCollection->action("display_events")); - tmplistaction->setCurrentItem(i); -} -void kmidClient::setCurrentSong(int i) -{ - getComboSongs()->setCurrentItem(i-1); - slotSelectSong(i-1); -} -void kmidClient::setPlayListMode(int i) -{ - ((KListAction*)actionCollection->action("play_order"))->setCurrentItem(i); -} -void kmidClient::slotSelectEncoding(int i) -{ - if (i == 0) - kdispt->setLyricsEncoding(TQString()); // Default - else - kdispt->setLyricsEncoding(TDEGlobal::charsets()->encodingForName(comboEncodings->text(i))); -} -#include "kmidclient.moc" diff --git a/kmid/kmidclient.h b/kmid/kmidclient.h deleted file mode 100644 index 18bef039..00000000 --- a/kmid/kmidclient.h +++ /dev/null @@ -1,241 +0,0 @@ -/************************************************************************** - - kmidclient.h - The main client widget of KMid - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _KMIDCLIENT_H -#define _KMIDCLIENT_H - -#include "qslidertime.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "kdisptext.h" -#include "slman.h" -#include "version.h" -#include "kmidIface.h" - -#include - -class DeviceManager; - - -class TDEApplication; -class TDEConfig; -class KLCDNumber; -class TQLabel; -class TQComboBox; -class RhythmView; -class ChannelView; -class TQString; - -class kmidClient : public TQWidget, virtual public KMidIface -{ - Q_OBJECT - -private: -#ifdef KMidDEBUG - long passcount; -#endif - - DeviceManager *midi; - MidiPlayer *player; - - struct kMidData m_kMid; - - TQTimer *timer4timebar; - TQTimer *timer4events; - - ulong beginmillisec; - ulong pausedatmillisec; - double currentTempo; - SpecialEvent *spev; - NoteArray *noteArray; - - bool downloaded; - - int itsme; - bool shuttingdown; - int visiblevolumebar; - - char *midifile_opened; - int hasbeenopened; - - int typeoftextevents; - - SLManager *slman; - int activecollection; - TQString collectionsfile; - SongList *currentsl; - int initializing_songs; - int loopsong; - int collectionplaymode; - int *collectionplaylist; // the list of songs ordered in the - // user selected mode - - class KActionCollection *actionCollection; - - void generateCPL(void); - int searchInCPL(int song); // Returns the index of song - - void fillInComboSongs(void); - - int openFile(const char *filename); - void allNotesOff(void); -public: - kmidClient(TQWidget *parent, KActionCollection *ac, const char *name=0); - ~kmidClient(); - - char *midiFileName(void) {return midifile_opened;}; - // If it returns NULL then there isn't any file opened - - int isPlaying(void) {return m_kMid.pctl->playing;}; - int isPaused(void) {return (m_kMid.pctl->playing)&&(m_kMid.pctl->paused);}; - - int openURL(const TQString s); - - void repaintText(int typeoftextevents); - static void kmidOutput(void); - - int ChooseTypeOfTextEvents(void); - - TQFont *getFont(void); - void fontChanged(void); // The new font is already in TDEConfig - - SLManager *getSLManager(void) {return slman;}; - void setSLManager(SLManager *slm); - // setSLManager only change the pointer, so DO NOT DELETE - // the objectr you pass to it - int getActiveCollection(void) {return activecollection;}; - void setActiveCollection(int i); - int getSelectedSong(void); - void saveCollections(void); - - void setSongType(int i); - void setSongLoop(int i); - void setCollectionPlayMode(int i); - - void visibleVolumeBar(int i); // 1 shows it, and 0 hides it - // int isVisibleVolumeBar(void) {return visiblevolumebar;}; - void visibleChannelView(int i); - - void shuttingDown(void); - - ulong timeOfNextEvent(int *type=NULL); - void rethinkNextEvent(void); - // Recalculates time of next event and updates the timer4events according to it - - - void moveEventPointersTo(ulong ms); - -protected: -// void resizeEvent(TQResizeEvent *qre); - - -public slots: -// void help_Help(); -// void help_About(); - void slotPlay(); - void slotPause(); - void slotStop(); - void slotRewind(); - void slotForward(); - void slotPrevSong(); - void slotNextSong(); - - void timebarUpdate(); - void slotSeek(int i); - void slotSetVolume(int i); - void slotSelectSong(int i); - void slotSelectEncoding(int i); - - void downloadFinished( TDEIO::Job * ); - - void processSpecialEvent(); - - void channelViewDestroyed(); - - void communicationFromChannelView(int *); - - void slotSetTempo(double value); - -signals: - void mustRechooseTextEvent(); - void stopPause(); -// void channelView_Destroyed(); - -public: - void saveLyrics(FILE *fh); - - DeviceManager *devman(void) {return midi;}; - void setMidiDevice(int i); - void setMidiMapFilename(const char *mapfilename); - - ChannelView *getChannelView(void) { return channelView; }; - KDisplayText *getKDisplayText(void) { return kdispt; }; - - TQSizePolicy sizePolicy(); - - TQComboBox *getComboSongs() { return comboSongs; }; - - - void play(); - void pause(); - void stop(); - void rewind(); - void forward(); - void seek(int ms); - void prevSong(); - void nextSong(); - void setVolume(int i); - void setTempo(int i); - void setSongEncoding( int i ); - void setLyricEvents( int i ); - void setCurrentSong(int i); - void setPlayListMode(int i); - - TQSize sizeHint() const; -private: - TQSlider *timebar; - QSliderTime *timetags; - TQSlider *volumebar; - - KLCDNumber *tempoLCD; - KDisplayText *kdispt; - TQLabel *qlabelTempo; - TQComboBox *comboSongs; - TQComboBox *comboEncodings; - RhythmView *rhythmview; - - - ChannelView *channelView; - -}; - -char *extractFilename(const char *in,char *out); // returns a pointer to out - -#endif - diff --git a/kmid/kmidframe.cpp b/kmid/kmidframe.cpp deleted file mode 100644 index 44a7157d..00000000 --- a/kmid/kmidframe.cpp +++ /dev/null @@ -1,728 +0,0 @@ -/************************************************************************** - - kmidframe.cpp - The main widget of KMid - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "kmidframe.h" -#include "kmidclient.h" -#include "midicfgdlg.h" -#include "collectdlg.h" -#include "channelcfgdlg.h" -#include "channelview.h" -#include "version.h" - -kmidFrame::kmidFrame(const char *name) - :KMainWindow(0, name) -{ - kmidclient=new kmidClient(this,actionCollection(), "KMidClient"); - kmidclient->setSongType(1); - kmidclient->show(); - setCentralWidget( kmidclient ); -/* - kKeysAccel=new KAccel(this); - kKeysAccel->insertItem(i18n("Play/Pause"),"Play/Pause", Key_Space); - kKeysAccel->connectItem("Play/Pause", TQT_TQOBJECT(this), TQT_SLOT(spacePressed())); - kKeysAccel->insertItem(i18n("Stop"),"Stop", Key_Backspace); - kKeysAccel->connectItem("Stop",kmidclient,TQT_SLOT(song_Stop())); - kKeysAccel->insertItem(i18n("Previous Song"),"Previous Song", Key_Left); - kKeysAccel->connectItem("Previous Song",kmidclient,TQT_SLOT(song_PlayPrevSong())); - kKeysAccel->insertItem(i18n("Next Song"),"Next Song", Key_Right); - kKeysAccel->connectItem("Next Song",kmidclient,TQT_SLOT(song_PlayNextSong())); - kKeysAccel->insertItem(i18n("Scroll Down Karaoke"),"Scroll down karaoke",Key_Down); - kKeysAccel->connectItem("Scroll Down karaoke",kmidclient->getKDisplayText(),TQT_SLOT(ScrollDown())); - kKeysAccel->insertItem(i18n("Scroll Up Karaoke"),"Scroll up karaoke",Key_Up); - kKeysAccel->connectItem("Scroll Up Karaoke",kmidclient->getKDisplayText(),TQT_SLOT(ScrollUp())); - kKeysAccel->insertItem(i18n("Scroll Page Down Karaoke"),"Scroll page down karaoke",Key_PageDown); - kKeysAccel->connectItem("Scroll Page Down Karaoke",kmidclient->getKDisplayText(),TQT_SLOT(ScrollPageDown())); - kKeysAccel->insertItem(i18n("Scroll Page Up Karaoke"),"Scroll page up karaoke",Key_PageUp); - kKeysAccel->connectItem("Scroll Page Up Karaoke",kmidclient->getKDisplayText(),TQT_SLOT(ScrollPageUp())); - - kKeysAccel->readSettings(); -*/ - KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(file_Open()), actionCollection()); - (void)new KAction(i18n("&Save Lyrics..."), 0, TQT_TQOBJECT(this), - TQT_SLOT(file_SaveLyrics()), actionCollection(), "file_save_lyrics"); - KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection()); - - (void)new KAction(i18n("&Play"), "player_play", TQt::Key_Space, - TQT_TQOBJECT(kmidclient), TQT_SLOT(slotPlay()), actionCollection(), "song_play"); - (void)new KAction(i18n("P&ause"), "player_pause", TQt::Key_P, TQT_TQOBJECT(kmidclient), - TQT_SLOT(slotPause()), actionCollection(), "song_pause"); - (void)new KAction(i18n("&Stop"), "player_stop", TQt::Key_Backspace, - TQT_TQOBJECT(kmidclient), TQT_SLOT(slotStop()), actionCollection(), "song_stop"); - - (void)new KAction(i18n("P&revious Song"), "player_start", Key_Left, - TQT_TQOBJECT(kmidclient), TQT_SLOT(slotPrevSong()), actionCollection(), - "song_previous"); - (void)new KAction(i18n("&Next Song"), "player_end", Key_Right, - TQT_TQOBJECT(kmidclient), TQT_SLOT(slotNextSong()), actionCollection(), - "song_next"); - (void)new KToggleAction(i18n("&Loop"), 0, TQT_TQOBJECT(this), TQT_SLOT(song_Loop()), - actionCollection(), "song_loop"); - - (void)new KAction(i18n("Rewind"), "2leftarrow", 0, TQT_TQOBJECT(kmidclient), - TQT_SLOT(slotRewind()), actionCollection(), "song_rewind"); - - (void)new KAction(i18n("Forward"), "2rightarrow", 0, TQT_TQOBJECT(kmidclient), - TQT_SLOT(slotForward()), actionCollection(), "song_forward"); - - (void)new KAction(i18n("&Organize..."), 0, TQT_TQOBJECT(this), TQT_SLOT(collect_organize()), - actionCollection(), "collect_organize"); - - TQStringList playmodes; - playmodes.append(i18n("In Order")); - playmodes.append(i18n("Shuffle")); - - KSelectAction *act=new KSelectAction(i18n("Play Order"), 0, /*this, TQT_SLOT(collect_PlayOrder(int)),*/ - actionCollection(), "play_order"); - connect(act,TQT_SIGNAL(activated(int)),this, TQT_SLOT(collect_PlayOrder(int))); - act->setItems(playmodes); - - (void)new KToggleAction(i18n("Auto-Add to Collection"), 0, TQT_TQOBJECT(this), - TQT_SLOT(collect_AutoAdd()), actionCollection(), "collect_autoadd"); - - playmodes.clear(); - playmodes.append(i18n("&General MIDI")); - playmodes.append(i18n("&MT-32")); - - act=new KSelectAction(i18n("File Type"), 0,/* this, TQT_SLOT(options_FileType(int)),*/ - actionCollection(), "file_type"); - connect(act,TQT_SIGNAL(activated(int)),this, TQT_SLOT(options_FileType(int))); - act->setItems(playmodes); - - playmodes.clear(); - playmodes.append(i18n("&Text Events")); - playmodes.append(i18n("&Lyric Events")); - - act=new KSelectAction(i18n("Display Events"), Key_T, /*this, - TQT_SLOT(options_DisplayEvents(int)),*/ actionCollection(), - "display_events"); - connect(act,TQT_SIGNAL(activated(int)),this, TQT_SLOT(options_DisplayEvents(int))); - act->setItems(playmodes); - - (void)new KToggleAction(i18n("Automatic Text Chooser"), 0, TQT_TQOBJECT(this), - TQT_SLOT(options_AutomaticText()), actionCollection(), - "option_automatictext"); - - KToggleAction* togact = new KToggleAction(i18n("Show &Volume Bar"), "volume", - 0, TQT_TQOBJECT(this), TQT_SLOT(options_ShowVolumeBar()), actionCollection(), - "toggle_volumebar"); - togact->setCheckedState(i18n("Hide &Volume Bar")); - - togact = new KToggleAction(i18n("Show &Channel View"), "piano", - 0, TQT_TQOBJECT(this), TQT_SLOT(options_ShowChannelView()), actionCollection(), - "toggle_channelview"); - togact->setCheckedState(i18n("Hide &Channel View")); - - (void)new KAction(i18n("Channel View &Options..."), 0, TQT_TQOBJECT(this), - TQT_SLOT(options_ChannelViewOptions()), actionCollection(), - "channelview_options"); - - (void)new KAction(i18n("&Font Change..."), 0, TQT_TQOBJECT(this), - TQT_SLOT(options_FontChange()), actionCollection(), - "change_font"); - - (void)new KAction(i18n("MIDI &Setup..."), 0, TQT_TQOBJECT(this), - TQT_SLOT(options_MidiSetup()), actionCollection(), "midi_setup"); - - - setupGUI((ToolBar | Keys | StatusBar | Save | Create ), "kmidui.rc" ); - - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - KSelectAction *tmplistaction= - ((KSelectAction*)actionCollection()->action("display_events")); - - if (cfg->readNumEntry("TypeOfTextEvents",5)==5) - tmplistaction->setCurrentItem(1); - else - tmplistaction->setCurrentItem(0); - - tmplistaction=((KSelectAction*)actionCollection()->action("file_type")); - if (cfg->readNumEntry("TypeOfMidiFile",0)==0) - tmplistaction->setCurrentItem(0); - else - tmplistaction->setCurrentItem(1); - - if (cfg->readNumEntry("Loop",0)==1) - ((KToggleAction*)actionCollection()->action("song_loop"))->setChecked(true); - - if (cfg->readNumEntry("ShowVolumeBar",0)==1) - ((KToggleAction*)actionCollection()->action("toggle_volumebar"))->setChecked(true); - - - tmplistaction=((KSelectAction*)actionCollection()->action("play_order")); - if (cfg->readNumEntry("CollectionPlayMode",0)==0) - tmplistaction->setCurrentItem(0); - else - tmplistaction->setCurrentItem(1); - - if ((cfg->readNumEntry("AutoAddToCollection",0))==1) - ((KToggleAction*)actionCollection()->action("collect_autoadd"))->setChecked(true); - - if ((cfg->readNumEntry("AutomaticTextEventChooser",1))==1) - ((KToggleAction*)actionCollection()->action("option_automatictext"))->setChecked(true); - - setAcceptDrops(true); - - connect( kmidclient, TQT_SIGNAL( mustRechooseTextEvent() ), - this, TQT_SLOT( rechooseTextEvent() ) ); - - connect( kmidclient, TQT_SIGNAL( stopPause() ), - this, TQT_SLOT( song_stopPause() ) ); - -// connect( kmidclient, TQT_SIGNAL( channelView_Destroyed() ), -// this, TQT_SLOT( channelViewDestroyed() ) ); - - TDECmdLineArgs * args = TDECmdLineArgs::parsedArgs(); - - if ( args->count() > 0 ) - { -// printf("Opening command line file...\n"); - int backautoadd=cfg->readNumEntry("AutoAddToCollection",0); - cfg->writeEntry("AutoAddToCollection",0); - - char ttt[40]; - sprintf(ttt,"%d",kapp->argc()); - int i=0; - int c=autoAddSongToCollection( args->url( 0 ).path() , 1 ); - i++; - while (icount()) - { - autoAddSongToCollection( args->url( i ).path() , 0 ); - i++; - } - - kmidclient->setActiveCollection(c); - - /// kmidclient->openURL((kapp->argv())[1]); - /* if ((cfg->readNumEntry("AutomaticTextEventChooser",1))==1) - { - if (kmidclient->ChooseTypeOfTextEvents()==1) - options_Text(); - else - options_Lyrics(); - }*/ - if (kmidclient->midiFileName()!=NULL) kmidclient->play(); - cfg->writeEntry("AutoAddToCollection",backautoadd); - } - - args->clear(); - /* - kKeys->addKey("Play/Pause",Key_Space); - kKeys->registerWidget("KMidFrame",this); - kKeys->connectFunction("KMidFrame","Play/Pause",this,TQT_SLOT(spacePressed())); - */ -// kKeysAccel->writeSettings(cfg); - - DCOPClient *client = kapp->dcopClient(); - if (!client->isRegistered()) // just in case we're embeeded - { - client->attach(); - client->registerAs("kmid"); - } -} - -kmidFrame::~kmidFrame() -{ -} - -void kmidFrame::file_Open() -{ - KURL url = KFileDialog::getOpenURL(TQString(), "*.kar *.mid *.kar.gz *.mid.gz\n*.kar *.kar.gz\n*.mid *.mid.gz\n*",this); - - if( url.isEmpty() ) - return; - - if( !url.isLocalFile() ) - { - KMessageBox::sorry( 0L, i18n( "Only local files are currently supported." ) ); - return; - } - - openURL(url.path()); -} - - - -void kmidFrame::song_stopPause() -{ - if (kmidclient->isPaused()) - { - // song_Pause(); - ((KToggleAction*)actionCollection()->action("song_pause"))->setChecked(false); - kmidclient->pause(); - } -} - -void kmidFrame::options_FileType(int i) -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - cfg->writeEntry("TypeOfMidiFile",i); - kmidclient->setSongType(1-i); -} - -void kmidFrame::options_DisplayEvents(int i) -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - cfg->writeEntry("TypeOfTextEvents",(i==0)?1:5); - cfg->sync(); - kmidclient->repaintText((i==0)?1:5); -} - -void kmidFrame::options_AutomaticText() -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - cfg->writeEntry("AutomaticTextEventChooser",1-cfg->readNumEntry("AutomaticTextEventChooser",1)); -} - -void kmidFrame::options_FontChange() -{ - KFontDialog *kfd=new KFontDialog(this); - TQFont font; - font=*kmidclient->getFont(); - kfd->getFont(font); - delete kfd; - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - cfg->writeEntry("KaraokeFont",font); - cfg->sync(); - kmidclient->fontChanged(); -} - -int kmidFrame::autoAddSongToCollection(const TQString& filename,int setactive) -{ - int r; - SLManager *slman; - SongList *sl; - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - if (cfg->readNumEntry("AutoAddToCollection",0)==0) - { - r=0; - slman=kmidclient->getSLManager(); - if (setactive) slman->createTemporaryCollection(); - sl=slman->getCollection(0); - if (filename==NULL) sl->AddSong(kmidclient->midiFileName()); - else sl->AddSong(TQFile::encodeName(filename)); - } - else - { - slman=kmidclient->getSLManager(); - sl=slman->getCollection(kmidclient->getActiveCollection()); - r=kmidclient->getActiveCollection(); - if (sl==NULL) return 0; - int id; - if (filename==NULL) id=sl->AddSong(kmidclient->midiFileName()); - else id=sl->AddSong(TQFile::encodeName(filename)); - if (setactive) - { - sl->setActiveSong(id); - } - } - return r; -} - -void kmidFrame::urlDrop_slot(TQDropEvent* e) -{ - dropEvent(e); -} - -void kmidFrame::dragEnterEvent(TQDragEnterEvent* e) -{ - e->accept(KURLDrag::canDecode(e)); -} - -void kmidFrame::dropEvent( TQDropEvent * event ) -{ - KURL::List list; - KURLDrag::decode(event, list); - - if (list.count()==0) return; - - bool first = true; - int c = true; - - for (KURL::List::ConstIterator it = list.begin(); - it != list.end(); ++it) - { - if (!(*it).isLocalFile()) - continue; - - if (first) - { - c = autoAddSongToCollection((*it).path(),1); - first = false; - } - else - { - autoAddSongToCollection((*it).path(),0); - } - } - - if (!first) - { - kmidclient->setActiveCollection(c); - - if ((!kmidclient->isPlaying())&&(kmidclient->midiFileName()!=NULL)) - kmidclient->play(); - } -} - -void kmidFrame::shuttingDown() -{ - if (kmidclient->isPlaying()==1) - { -// kmidclient->stop(); - kmidclient->shuttingDown(); - } - kmidclient->saveCollections(); -} - -void kmidFrame::saveProperties(TDEConfig *cfg) -{ - kmidclient->saveCollections(); - int play=kmidclient->isPlaying(); - cfg->writeEntry("File",kmidclient->midiFileName()); - cfg->writeEntry("ActiveCollection",kmidclient->getActiveCollection()); - cfg->writeEntry("ActiveSong",kmidclient->getSelectedSong()); - cfg->writeEntry("Playing",play); -} - -void kmidFrame::readProperties(TDEConfig *cfg) -{ - int activecol=cfg->readNumEntry("ActiveCollection",0); - int activesong=cfg->readNumEntry("ActiveSong",0); - int wasplaying=cfg->readNumEntry("Playing",0); - SLManager *slman=kmidclient->getSLManager(); - SongList *sl=slman->getCollection(activecol); - sl->setActiveSong(activesong); - kmidclient->setActiveCollection(activecol); - kmidclient->slotSelectSong(activesong-1); - - if ((activecol==0)&&(wasplaying)) // It was the temporary collection, - { // surely the user would like to continue - // hearing the song - TQString s = cfg->readPathEntry("File"); - int c=autoAddSongToCollection(s,1); - kmidclient->setActiveCollection(c); - } - - if ((wasplaying)&&(kmidclient->midiFileName()!=NULL)) kmidclient->play(); -} - -void kmidFrame::options_MidiSetup() -{ - if (kmidclient->devman()->checkInit()<0) - { - KMessageBox::error(this, - i18n("Could not open /dev/sequencer to get some info.\nProbably there is another program using it.")); - return; - } - MidiConfigDialog *dlg; - - dlg=new MidiConfigDialog(kmidclient->devman(),NULL,"MidiDialog"); - if (dlg->exec() == TQDialog::Accepted) - { - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - cfg->writeEntry("MidiPortNumber",MidiConfigDialog::selecteddevice); - kmidclient->setMidiDevice(MidiConfigDialog::selecteddevice); - cfg->setGroup("Midimapper"); - cfg->writePathEntry("LoadFile", - (MidiConfigDialog::selectedmap==NULL)? TQString():MidiConfigDialog::selectedmap); - kmidclient->setMidiMapFilename(MidiConfigDialog::selectedmap); - } - delete dlg; -} - -void kmidFrame::collect_organize() -{ - CollectionDialog *dlg; - SLManager *slman=new SLManager(*kmidclient->getSLManager()); - int idx=kmidclient->getActiveCollection(); - - dlg=new CollectionDialog(slman,idx,NULL,"MidiDialog"); - if (dlg->exec() == TQDialog::Accepted) - { - kmidclient->setSLManager(slman); - kmidclient->setActiveCollection(CollectionDialog::selectedC); - kmidclient->slotSelectSong( - (slman->getCollection(CollectionDialog::selectedC))->getActiveSongID()-1); - } - else - { - delete slman; - } -delete dlg; -} - -void kmidFrame::rechooseTextEvent() -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - if ((cfg->readNumEntry("AutomaticTextEventChooser",1))==1) - { - int t=kmidclient->ChooseTypeOfTextEvents(); - kmidclient->repaintText(t); - if (t==1) - ((KSelectAction*)actionCollection()->action("display_events"))->setCurrentItem(0); - else - ((KSelectAction*)actionCollection()->action("display_events"))->setCurrentItem(1); - } -} - -void kmidFrame::song_Loop() -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - int i=1-cfg->readNumEntry("Loop",0); - cfg->writeEntry("Loop",i); - cfg->sync(); - kmidclient->setSongLoop(i); -} - -void kmidFrame::collect_PlayOrder(int i) -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - cfg->writeEntry("CollectionPlayMode", i); - cfg->sync(); - kmidclient->setCollectionPlayMode(i); -} - -void kmidFrame::collect_AutoAdd() -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - cfg->writeEntry("AutoAddToCollection",1-cfg->readNumEntry("AutoAddToCollection",0)); - cfg->sync(); -} - -void kmidFrame::file_SaveLyrics() -{ - KURL url = KFileDialog::getSaveURL(TQString(),"*",this); - - if( url.isEmpty() ) - return; - - if( !url.isLocalFile() ) - { - KMessageBox::sorry( 0L, i18n( "Only local files are currently supported." ) ); - return; - } - - TQString filename = url.path(); - struct stat statbuf; - - if (stat(TQFile::encodeName(filename), &statbuf)!=-1) - { - TQString s = i18n("File %1 already exists\nDo you want to overwrite it?").arg(filename); - if (KMessageBox::warningYesNo(this,s,TQString(),i18n("Overwrite"),KStdGuiItem::cancel())==1) - return; - } - - FILE *fh=fopen(TQFile::encodeName(filename),"wt"); - kmidclient->saveLyrics(fh); - fclose(fh); -} - -void kmidFrame::spacePressed() -{ - if (!kmidclient->isPlaying()) kmidclient->play(); - else pause(); -} -void kmidFrame::options_ShowVolumeBar() -{ - TDEConfig *cfg=kapp->config(); - cfg->setGroup("KMid"); - int i=1-cfg->readNumEntry("ShowVolumeBar",0); - cfg->writeEntry("ShowVolumeBar",i); - kmidclient->visibleVolumeBar(i); -} - -void kmidFrame::options_ShowChannelView() -{ - if (!((KToggleAction*)actionCollection()->action("toggle_channelview"))->isChecked()) - { - kmidclient->visibleChannelView(0); - } else - { - kmidclient->visibleChannelView(1); - connect (kmidclient->getChannelView(),TQT_SIGNAL(destroyMe()),this,TQT_SLOT(channelViewDestroyed())); - } - -} - -void kmidFrame::channelViewDestroyed() -{ - kmidclient->channelViewDestroyed(); - ((KToggleAction*)actionCollection()->action("toggle_channelview"))->setChecked(false); -} - -void kmidFrame::options_ChannelViewOptions() -{ - ChannelViewConfigDialog *dlg; - - dlg=new ChannelViewConfigDialog(NULL,"ChannelViewConfigDialog"); - if (dlg->exec() == TQDialog::Accepted) - { - if (kmidclient->getChannelView()) - kmidclient->getChannelView()->lookMode( - ChannelViewConfigDialog::selectedmode ); - } - delete dlg; -} - -void kmidFrame::openURL( const TQString url ) -{ - int c=autoAddSongToCollection(url,1); - kmidclient->setActiveCollection(c); -} - -/*void kmidFrame::play() -{ - kmidclient->play(); -} - -void kmidFrame::pause() -{ -// kmidclient->pause(); - ((KAction*)actionCollection()->action("pause"))->activate(); -} - -void kmidFrame::stop() -{ - kmidclient->stop(); -} - -void kmidFrame::rewind() -{ - kmidclient->rewind(); -} - -void kmidFrame::forward() -{ - kmidclient->forward(); -} - -void kmidFrame::seek(int ms) -{ - kmidclient->timebarChange(ms); -} - -void kmidFrame::prevSong() -{ - kmidclient->prevSong(); -} - -void kmidFrame::nextSong() -{ - kmidclient->nextSong(); -} - -void kmidFrame::setSongLoop(int i) -{ - ((KToggleAction*)actionCollection()->action("song_loop"))->setChecked(i!=0); -} - -void kmidFrame::setVolume(int i) -{ - kmidclient->volumebarChange(200-i); -} - -void kmidFrame::setTempo(int i) -{ - kmidclient->changeTempo(i); -} - -void kmidFrame::setSongType( int i ) -{ - KSelectAction *tmplistaction= - ((KSelectAction*)actionCollection()->action("file_type")); - - tmplistaction->setCurrentItem(i); -} - -void kmidFrame::setLyricEvents( int i ) -{ - KSelectAction *tmplistaction= - ((KSelectAction*)actionCollection()->action("display_events")); - tmplistaction->setCurrentItem(i); -} - -void kmidFrame::selectSong(int i) -{ - kmidclient->getComboSongs()->setCurrentItem(i-1); - kmidclient->selectSong(i-1); -} - -void kmidFrame::setActiveCollection( int i ) -{ - kmidclient->setActiveCollection(i); -} - -void kmidFrame::setCollectionPlayMode(int i) -{ - ((KSelectAction*)actionCollection()->action("play_order"))->setCurrentItem(i); -} - -void kmidFrame::setMidiDevice(int i) -{ - - -} -*/ - - -#include "kmidframe.moc" diff --git a/kmid/kmidframe.h b/kmid/kmidframe.h deleted file mode 100644 index f028c749..00000000 --- a/kmid/kmidframe.h +++ /dev/null @@ -1,134 +0,0 @@ -/************************************************************************** - - kmidframe.h - The main widget of KMid - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _KMIDFRAME_H -#define _KMIDFRAME_H - -#include -#include -#include -#include -#include -#include -#include - -class TDEApplication; -class TDEConfig; -class kmidClient; -class KToolBar; -class TQDragEvent; -class KAccel; - -class KDE_EXPORT kmidFrame : public KMainWindow -{ - Q_OBJECT - -private: -#ifdef KMidDEBUG - long passcount; -#endif - - MidiOut *Midi; - MidiPlayer *Player; -/* - int playerProcessID; - PlayerController *pctl; - - int donttoggle; - - TQPopupMenu *m_file; - TQPopupMenu *m_song; - TQPopupMenu *m_collections; - TQPopupMenu *m_options; - TQPopupMenu *m_help; -*/ - KAccel *kKeysAccel; -protected: - int autoAddSongToCollection(const TQString& filename=TQString(),int setactive=1); - - - virtual void saveProperties(TDEConfig *kcfg); - virtual void readProperties(TDEConfig *kcfg); - -// virtual void closeEvent(TQCloseEvent *e); - - void dragEnterEvent(TQDragEnterEvent* e); - void dropEvent ( TQDropEvent * event ); - - -public: - kmidFrame(const char *name=0); - virtual ~kmidFrame(); - -public slots: - - void file_Open(); - void file_SaveLyrics(); - void song_stopPause(); // release the pause button and quit the pause mode - void song_Loop(); - void collect_organize(); - void collect_PlayOrder(int i); - void collect_AutoAdd(); - void options_FileType(int i); - void options_DisplayEvents(int i); - void options_AutomaticText(); - void options_ShowVolumeBar(); - void options_ShowChannelView(); - void options_ChannelViewOptions(); - void options_FontChange(); - - void options_MidiSetup(); - void spacePressed(); - - - virtual void openURL( const TQString s ); -/* virtual void play(); - virtual void pause(); - virtual void stop(); - virtual void rewind(); - virtual void forward(); - virtual void seek(int ms); - virtual void prevSong(); - virtual void nextSong(); - virtual void setSongLoop(int i); - virtual void setVolume(int i); - virtual void setTempo(int i); - virtual void setSongType( int i ); - virtual void setLyricEvents( int i ); - virtual void selectSong(int i); - virtual void setActiveCollection( int i ); - virtual void setCollectionPlayMode(int i); - virtual void setMidiDevice(int i); -*/ - void urlDrop_slot(class TQDropEvent *); - - void rechooseTextEvent(); - - void channelViewDestroyed(); - void shuttingDown(); - -private: - kmidClient *kmidclient; -}; - -#endif diff --git a/kmid/kmidui.rc b/kmid/kmidui.rc deleted file mode 100644 index 8553ad2e..00000000 --- a/kmid/kmidui.rc +++ /dev/null @@ -1,44 +0,0 @@ - - - - &File - - - &Song - - - - - - - - &Collections - - - - - - - - - - - - - - - - -Main Toolbar - - - - - - - - - - - - diff --git a/kmid/ktrianglebutton.cpp b/kmid/ktrianglebutton.cpp deleted file mode 100644 index 5bda855f..00000000 --- a/kmid/ktrianglebutton.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/************************************************************************** - - ktrianglebutton.cpp - The KTriangleButton widget (button with an arrow) - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - - Note: This widget was based on KButton as found in the tdelibs/tdeui - KButton was originally copyrighted by Torben Weis (weis@kde.org) - and Matthias Ettrich (ettrich@kde.org) on 1997 - -***************************************************************************/ -#include "ktrianglebutton.h" -#include -#include -#include - -KTriangleButton::KTriangleButton( Direction d,TQWidget *_parent, const char *name ) - : TQButton( _parent , name) -{ - dir=d; - raised = FALSE; - setFocusPolicy( TQ_NoFocus ); -} - -KTriangleButton::~KTriangleButton() -{ -} - -void KTriangleButton::enterEvent( TQEvent* ) -{ - if ( isEnabled() ) - { - raised = TRUE; - repaint(FALSE); - } -} - -void KTriangleButton::leaveEvent( TQEvent * ) -{ - if( raised != FALSE ) - { - raised = FALSE; - repaint(); - } -} - - -void KTriangleButton::drawButton( TQPainter *_painter ) -{ - paint( _painter ); -} - -void KTriangleButton::drawButtonLabel( TQPainter *_painter ) -{ - paint( _painter ); -} - -void KTriangleButton::paint( TQPainter *painter ) -{ - if ( isDown() || isOn() ) - { - if ( style().styleHint(TQStyle::SH_GUIStyle) == WindowsStyle ) - qDrawWinButton( painter, 0, 0, width(), - height(), colorGroup(), TRUE ); - else - qDrawShadePanel( painter, 0, 0, width(), - height(), colorGroup(), TRUE, 2, 0L ); - } - else if ( raised ) - { - if ( style().styleHint(TQStyle::SH_GUIStyle) == WindowsStyle ) - qDrawWinButton( painter, 0, 0, width(), height(), - colorGroup(), FALSE ); - else - qDrawShadePanel( painter, 0, 0, width(), height(), - colorGroup(), FALSE, 2, 0L ); - } - - if (dir==Right) - { - int x=width()/4; - int y=height()/6; - int l=height()-y*2; - int i=0; - int maxi=width()-2*x; - double m=(double)(l/2)/maxi; - while (i<=maxi) - { - painter->drawLine(x,y+(int)(i*m),x,y+l-(int)(i*m)); - x++; - i++; - }; - } - else if (dir==Left) - { - int x=width()/4; - int y=height()/6; - int l=height()-y*2; - int i=0; - int maxi=width()-2*x; - x=width()-x; - double m=(double)(l/2)/maxi; - while (i<=maxi) - { - painter->drawLine(x,y+(int)(i*m),x,y+l-(int)(i*m)); - x--; - i++; - }; - - }; - -} - -void KTriangleButton::mousePressEvent(TQMouseEvent *e) -{ - TQButton::mousePressEvent(e); - usingTimer=true; - startTimer(500); - timeCount=0; - -} - -void KTriangleButton::mouseReleaseEvent(TQMouseEvent *e) -{ - usingTimer=false; - TQButton::mouseReleaseEvent(e); -} - -void KTriangleButton::timerEvent(TQTimerEvent *) -{ - if (!usingTimer) {TQT_TQOBJECT(this)->killTimers();return;}; - if (timeCount==0) - { - timeCount++; - TQT_TQOBJECT(this)->killTimers(); - startTimer(120); - } else - if (timeCount==30) - { - timeCount=-1; - TQT_TQOBJECT(this)->killTimers(); - startTimer(80); - } - else if (timeCount>0) timeCount++; - emit clickedQuickly(); - -} -#include "ktrianglebutton.moc" diff --git a/kmid/ktrianglebutton.h b/kmid/ktrianglebutton.h deleted file mode 100644 index 5013b8d8..00000000 --- a/kmid/ktrianglebutton.h +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************** - - ktrianglebutton.h - The KTriangleButton widget (button with an arrow) - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - - Note: This widget was copied from KButton as found in the tdelibs/tdeui - KButton was originally copyrighted by Torben Weis (weis@kde.org) - and Matthias Ettrich (ettrich@kde.org) on 1997 - -***************************************************************************/ -#ifndef _ktrianglebutton_h_ -#define _ktrianglebutton_h_ - -#include - -class KTriangleButton : public TQButton -{ - Q_OBJECT - - -public: - enum Direction {Left , Right, Up, Down}; - /* - Up and Down are not implemented, feel free to implement them yourself - if you need them :-) - */ -protected: - - Direction dir; - bool usingTimer; - int timeCount; - -public: - KTriangleButton( Direction d,TQWidget *_parent = 0L, const char *name = 0L ); - ~KTriangleButton(); - - virtual void leaveEvent( TQEvent *_ev ); - virtual void enterEvent( TQEvent *_ev ); - - virtual void drawButton( TQPainter *_painter ); - virtual void drawButtonLabel( TQPainter *_painter ); - - void paint( TQPainter *_painter ); - -signals: - void clickedQuickly(); - -protected: - bool raised; - - virtual void mousePressEvent(TQMouseEvent *e); - virtual void mouseReleaseEvent(TQMouseEvent *e); - virtual void timerEvent(TQTimerEvent *); - -}; - -#endif diff --git a/kmid/main.cpp b/kmid/main.cpp deleted file mode 100644 index 21b0198a..00000000 --- a/kmid/main.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************** - - main.cpp - The main function for KMid - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "kmidframe.h" -#include "kmid_part.h" -#include "version.h" - -int main(int argc, char **argv) -{ - printf("%s Copyright (C) 1997,98,99,2000,01 Antonio Larrosa Jimenez. Malaga (Spain)\n",VERSION_TXT); - printf("KMid comes with ABSOLUTELY NO WARRANTY; for details view file COPYING\n"); - printf("This is free software, and you are welcome to redistribute it\n"); - printf("under certain conditions\n\n"); - - TQTextCodec::setCodecForCStrings(TQTextCodec::codecForLocale()); -/* - struct sigaction act; - act.sa_handler = SIG_DFL; - sigemptyset(&(act.sa_mask)); - act.sa_flags=0; - - sigaction(SIGINT, &act, NULL); - sigaction(SIGTERM, &act, NULL); -*/ - - TDECmdLineArgs::init(argc, argv, KMidFactory::aboutData() ); - - static KCmdLineOptions options[] = - { - { "+file", I18N_NOOP("File to open"), 0 }, - KCmdLineLastOption - }; - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - - kmidFrame *kmidframe=new kmidFrame("KMid"); - - app.setMainWidget ( kmidframe ); - - TQObject::connect(&app,TQT_SIGNAL(shutDown()),kmidframe,TQT_SLOT(shuttingDown())); - - if (app.isRestored()) - { - if (kmidframe->canBeRestored(1)) kmidframe->restore(1); - } - - kmidframe->show(); - - //CT TDEIOJob::initStatic(); - -/* - if (app->isRestored()) - { - RESTORE(kmidFrame); - } - else - { - kmidFrame *kmidframe=new kmidFrame("KMid"); - kmidframe->show(); - }; -*/ - - - - return app.exec(); -} - diff --git a/kmid/maps/Makefile.am b/kmid/maps/Makefile.am deleted file mode 100644 index d276e13e..00000000 --- a/kmid/maps/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -maps_DATA = gm.map YamahaPSS790.map YamahaPSR500.map YamahaQY10.map -mapsdir = $(kde_datadir)/kmid/maps - -EXTRA_DIST = $(maps_DATA) diff --git a/kmid/maps/YamahaPSR500.map b/kmid/maps/YamahaPSR500.map deleted file mode 100644 index 16068c21..00000000 --- a/kmid/maps/YamahaPSR500.map +++ /dev/null @@ -1,293 +0,0 @@ -# Blank lines and lines beginning with # are ignored -# This is a map for a Yamaha PSR-500 keyboard -# This file was done by Dietmar Schnabel (thanks !) - -# If you make a new map, please send it to Antonio, so future releases -# will include them. -# Antonio Larrosa Jimenez, larrosa@kde.org - -# General Midi Map File - -DEFINE PATCHMAP -AcusticPiano =0 -BrightPiano =0 -SynthPiano =3 -HonkyTonky =2 -ElectricPiano1=4 -ElectricPiano2=5 -Harpsichord =6 -Clavinet =8 -Celeste =9 -Glockenspiel =40 -Musicbox =41 -Vibes =40 -Marimba =41 -Xylophon =41 -TubeBell =41 -Santur =42 -HomeOrg =12 -PercussionOrg =13 -RockOrg =14 -ChurchOrg =10 -ReedOrg =11 -Accordion =16 -Harmonica =17 -Concrtna =17 -NylonGuitar =29 -AcusticGuitar =31 -JazzGuitar =24 -CleanGuitar =19 -MuteGuitar =26 -OdGuitar =18 -DistortionGuit=23 -GtrHarm =20 -AcusticBass =88 -FingerBass =89 -PickBass =87 -FretlessBass =84 -SlapBass1 =87 -SlapBass2 =87 -SynthBass1 =90 -SynthBass2 =91 -Violin =32 -Viola =33 -Cello =34 -Contrabajo =33 -Marcato =34 -Pizzicato =38 -Harp =38 -Timpani =33 -Marcato =34 -SlowStrings =35 -SynthStrings1 =36 -SynthStrings2 =75 -Choir =72 -Doo =72 -Voices =72 -OrchestraHit =37 -Trumpet =43 -Trombone =47 -Tuba =50 -MuteTrumpet =44 -FrenchHorn =49 -HitBrass =51 -SynthBrass1 =52 -SynthBrass2 =74 -SopranoSax =60 -AltoSax =61 -TenorSax =62 -BaritoneSax =63 -Oboe =57 -EnglishHorn =58 -Bassoon =59 -Clarinet =55 -Piccolo =53 -Flute =54 -Recorder =66 -WoodFlute =65 -Bottle =55 -Shakazul =55 -Whistle =68 -Ocarina =79 -SquareWave =80 -SawWave =81 -Calliope =82 -Chiflead =83 -Charang =84 -VoxLead =85 -Lead5th =86 -BassLead =87 -Fantasia =88 -WarmPad =89 -Polysyn =90 -Ghostie =91 -BowGlass =92 -MetalPad =93 -HaloPad =94 -Sweeper =95 -Aurora =72 -SoundTrack =72 -Crystal =72 -Atmosphear =72 -FreshAir =100 -Unicorn =101 -Sweeper =102 -StarTrak =103 -Sitar =104 -Banjo =105 -Shamisen =106 -Koto =107 -Kalimba =108 -BagPipes =109 -Fiddle =110 -Shannai =111 -Carillon =112 -Agogo =113 -SteelDrm =114 -WoodBlk =115 -Taiko =116 -Toms =117 -Syntom =118 -RevCymbal =119 -Fx-Fret =120 -Fx-Blow =121 -Seashore =122 -Jungle =123 -Telephon =124 -Helicopter =125 -Applause =126 -Gunshot =127 -END - -DEFINE KEYMAP "Drumset" -C 0 =0 -C#0 =1 -D 0 =2 -D#0 =3 -E 0 =4 -F 0 =5 -F#0 =6 -G 0 =7 -G#0 =8 -A 0 =9 -A#0 =10 -B 0 =11 -C 1 =12 -C#1 =13 -D 1 =14 -D#1 =15 -E 1 =16 -F 1 =17 -F#1 =18 -G 1 =19 -G#1 =20 -A 1 =21 -A#1 =22 -B 1 =23 -C 2 =24 -C#2 =25 -D 2 =26 -D#2 27 Highq =27 -E 2 28 Slap =54 -F 2 29 Scratch1 =62 -F#2 30 Scratch2 =63 -G 2 31 Sticks =22 -G#2 32 SqrClick =87 -A 2 33 MetaClick=57 -A#2 34 MetBell =55 -B 2 35 Kick1 =44 -C 3 36 Kick2 =45 -C#3 37 StickRim =27 -D 3 38 Snare1 =28 -D#3 39 Claps =30 -E 3 40 snare2 =25 -F 3 41 tomlo2 =24 -F#3 42 Hihatclos=72 -G 3 43 Tomlo1 =17 -G#3 44 HihatPd =56 -A 3 45 Tommid2 =26 -A#3 46 Hihatop =35 -B 3 47 Tommid1 =18 -C 4 48 Tomhi2 =29 -C#4 49 Cymbalcrsh1 =36 -D 4 50 Tomhi1 =19 -D#4 51 Cymbalride1 =38 -E 4 52 Cymbalchina =38 -F 4 53 Cymbell =38 -F#4 54 Tamborin =47 -G 4 55 CymbalSplash=37 -G#4 56 Cowbell =31 -A 4 57 Cymbalcrash2=36 -A#4 58 Vibslap =39 -B 4 59 Cymbalride2 =39 -C 5 60 Bongohi =44 -C#5 61 Bongolo =43 -D 5 62 Congahi1 =41 -D#5 63 congahi2 =42 -E 5 64 Congalo =40 -F 5 65 Timbalehi=46 -F#5 66 Timbalelo=45 -G 5 67 Agogohi =51 -G#5 68 Agogolo =50 -A 5 69 Cabasa =32 -A#5 70 Maracas =65 -B 5 71 whistle1 =52 -C 6 72 whistle2 =53 -C#6 73 Guiro1 =74 -D 6 74 Guiro2 =74 -D#6 75 Clave =29 -E 6 76 Woodblock1=73 -F 6 77 Woodblock2=72 -F#6 78 Cuica1 =76 -G 6 79 Cuica2 =77 -G#6 80 Triangle1=13 -A 6 81 Triangle2=15 -A#6 82 Shaker =56 -B 6 83 Jingles =75 -C 7 84 Belltree =71 -C#7 85 Canstinet=85 -D 7 86 Surdo1 =86 -D#7 87 Surdo2 =87 -E 7 =88 -F 7 =89 -F#7 =90 -G 7 =91 -G#7 =92 -A 7 =93 -A#7 =94 -B 7 =95 -C 8 =96 -C#8 =97 -D 8 =98 -D#8 =99 -E 8 =100 -F 8 =101 -F#8 =102 -G 8 =103 -G#8 =104 -A 8 =105 -A#8 =106 -B 8 =107 -C 9 =108 -C#9 =109 -D 9 =110 -D#9 =111 -E 9 =112 -F 9 =113 -F#9 =114 -G 9 =115 -G#9 =116 -A 9 =117 -A#9 =118 -B 9 =119 -C 10=120 -C#10=121 -D 10=122 -D#10=123 -E 10=124 -F 10=125 -F#10=126 -G 10=127 -# This line should be ignored -END - - -DEFINE CHANNELMAP -0 = 0 -1 = 1 -2 = 2 -3 = 3 -4 = 4 -5 = 5 -6 = 6 -7 = 7 -8 = 8 -9 = 9 Keymap "Drumset" ForcePatch 99 -10 = 10 -11 = 11 -12 = 12 -13 = 13 -14 = 14 -15 = 15 -END - diff --git a/kmid/maps/YamahaPSS790.map b/kmid/maps/YamahaPSS790.map deleted file mode 100644 index 5017832e..00000000 --- a/kmid/maps/YamahaPSS790.map +++ /dev/null @@ -1,299 +0,0 @@ -# Blank lines and lines beginning with # are ignored -# This is my a map for the Yamaha PSS-790 keyboard -# it can be used as a template to make any new map for any -# other keyboard. -# If you make a new map, please send it to me, so future releases -# will include it. -# Antonio Larrosa Jimenez, larrosa@kde.org - -# Yamaha PSS-790 Map File - -DEFINE PATCHMAP -AcusticPiano =3 -BrightPiano =3 -SynthPiano =54 -HonkyTonky =25 -ElectricPiano1=25 -ElectricPiano2=25 -Harpsichord =53 -Clavinet =30 -Celeste =6 -Glockenspiel =64 -Musicbox =24 -Vibes =28 -Marimba =8 -Xylophon =24 -TubeBell =95 -Santur =30 -HomeOrg =1 -PercussionOrg =2 -RockOrg =11 -ChurchOrg =29 -ReedOrg =49 -Accordion =31 -Harmonica =22 -Concrtna =3 -NylonGuitar =36 -AcusticGuitar =68 -JazzGuitar =122 -CleanGuitar =68 -MuteGuitar =12 -OdGuitar =123 -DistortionGuit=13 -GtrHarm =72 -AcusticBass =38 -FingerBass =39 -PickBass =79 -FretlessBass =80 -SlapBass1 =14 -SlapBass2 =81 -SynthBass1 =58 -SynthBass2 =86 -Violin =10 -Viola =67 -Cello =67 -Contrabajo =41 -Marcato =41 -Pizzicato =78 -Harp =37 -Timpani =66 -Marcato =41 -SlowStrings =50 -SynthStrings1 =41 -SynthStrings2 =50 -Choir =96 -Doo =94 -Voices =96 -OrchestraHit =90 -Trumpet =15 -Trombone =16 -Tuba =84 -MuteTrumpet =44 -FrenchHorn =17 -HitBrass =92 -SynthBrass1 =0 -SynthBrass2 =82 -SopranoSax =101 -AltoSax =18 -TenorSax =102 -BaritoneSax =101 -Oboe =19 -EnglishHorn =87 -Bassoon =87 -Clarinet =19 -Piccolo =103 -Flute =20 -Recorder =88 -WoodFlute =111 -Bottle =111 -Shakazul =110 -Whistle =88 -Ocarina =93 -SquareWave =54 -SawWave =54 -Calliope =22 -Chiflead =9 -Charang =19 -VoxLead =96 -Lead5th =41 -BassLead =95 -Fantasia =111 -WarmPad =51 -Polysyn =60 -Ghostie =94 -BowGlass =33 -MetalPad =9 -HaloPad =111 -Sweeper =78 -Aurora =60 -SoundTrack =84 -Crystal =60 -Atmosphear =51 -FreshAir =60 -Unicorn =93 -Sweeper =112 -StarTrak =117 -Sitar =73 -Banjo =34 -Shamisen =73 -Koto =70 -Kalimba =73 -BagPipes =11 -Fiddle =67 -Shannai =11 -Carillon =64 -Agogo =91 -SteelDrm =9 -WoodBlk =35 -Taiko =100 AllKeysTo 60 -Toms =66 -Syntom =85 -RevCymbal =100 AllKeysTo 60 -Fx-Fret =121 -Fx-Blow =94 -Seashore =100 AllKeysTo 79 -Jungle =70 -Telephon =91 -Helicopter =111 -Applause =100 AllKeysTo 79 -Gunshot =100 AllKeysTo 38 - -END - -DEFINE KEYMAP "Drumset" -C 0 =0 -C#0 =1 -D 0 =2 -D#0 =3 -E 0 =4 -F 0 =5 -F#0 =6 -G 0 =7 -G#0 =8 -A 0 =9 -A#0 =10 -B 0 =11 -C 1 =12 -C#1 =13 -D 1 =14 -D#1 =15 -E 1 =16 -F 1 =17 -F#1 =18 -G 1 =19 -G#1 =20 -A 1 =21 -A#1 =22 -B 1 =23 -C 2 =24 -C#2 =25 -D 2 =26 -D#2 27 Highq =27 -E 2 28 Slap =54 -F 2 29 Scratch1 =29 -F#2 30 Scratch2 =30 -G 2 31 Sticks =46 -G#2 32 SqrClick =87 -A 2 33 MetaClick=57 -A#2 34 MetBell =55 -B 2 35 AcousticBassDrum=44 -C 3 36 BassDrum1=47 -C#3 37 StickRim =46 -D 3 38 AcSnare =47 -D#3 39 Claps =63 -E 3 40 ElectSnare =49 -F 3 41 LowFloorTom =48 -F#3 42 Hihatclos =57 -G 3 43 HighFloorTom=50 -G#3 44 PedalHihat =80 -A 3 45 LowTom =47 -A#3 46 OpenHihat =59 -B 3 47 LowMidTom =48 -C 4 48 HiMidTom =50 -C#4 49 Cymbalcrsh1 =60 -D 4 50 HiTom =53 -D#4 51 Cymbalride1 =63 -E 4 52 Cymbalchina =60 -F 4 53 RideBell =62 -F#4 54 Tambourin =71 -G 4 55 CymbalSplash=61 -G#4 56 Cowbell =55 -A 4 57 Cymbalcrash2=60 -A#4 58 Vibraslap =79 -B 4 59 Cymbalride2 =62 -C 5 60 Bongohi =68 -C#5 61 Bongolo =67 -D 5 62 MuteHiConga =66 -D#5 63 OpenHiConga =65 -E 5 64 LowConga =64 -F 5 65 HiTimbale =70 -F#5 66 LoTimbale =69 -G 5 67 HiAgogo =75 -G#5 68 LoAgogo =74 -A 5 69 Cabasa =56 -A#5 70 Maracas =56 -B 5 71 ShortWhistle=78 -C 6 72 LongWhistle =78 -C#6 73 ShortGuiro =79 -D 6 74 LongGuiro =71 -D#6 75 Clave =72 -E 6 76 HiWoodBlock =73 -F 6 77 LoWoodBlock =72 -F#6 78 MuteCuica =77 -G 6 79 OpenCuica =76 -G#6 80 MuteTriangle=37 -A 6 81 OpenTriangle=39 -A#6 82 Shaker =56 -B 6 83 Jingles =75 -C 7 84 Belltree =63 -C#7 85 Canstinet=85 -D 7 86 Surdo1 =86 -D#7 87 Surdo2 =87 -E 7 =88 -F 7 =89 -F#7 =90 -G 7 =91 -G#7 =92 -A 7 =93 -A#7 =94 -B 7 =95 -C 8 =96 -C#8 =97 -D 8 =98 -D#8 =99 -E 8 =100 -F 8 =101 -F#8 =102 -G 8 =103 -G#8 =104 -A 8 =105 -A#8 =106 -B 8 =107 -C 9 =108 -C#9 =109 -D 9 =110 -D#9 =111 -E 9 =112 -F 9 =113 -F#9 =114 -G 9 =115 -G#9 =116 -A 9 =117 -A#9 =118 -B 9 =119 -C 10=120 -C#10=121 -D 10=122 -D#10=123 -E 10=124 -F 10=125 -F#10=126 -G 10=127 -# This line should be ignored -END - - -DEFINE CHANNELMAP -0 = 0 -1 = 1 -2 = 2 -3 = 3 -4 = 4 -5 = 5 -6 = 6 -7 = 7 -8 = 8 -9 = 15 Keymap "Drumset" ForcePatch 100 -10 = 10 -11 = 11 -12 = 12 -13 = 13 -14 = 14 -15 = 9 -END - -OPTIONS -PitchBenderRatio = 672 -MapExpressionToVolumeEvents -END - diff --git a/kmid/maps/YamahaQY10.map b/kmid/maps/YamahaQY10.map deleted file mode 100644 index 1a4914b4..00000000 --- a/kmid/maps/YamahaQY10.map +++ /dev/null @@ -1,305 +0,0 @@ -# Midi map file for the Yamaha QY10 "walkstation", a basic sequencer / tone -# module. - -# Provided by Malcolm Tyrrell. If there is a problem with this file, please -# e-mail tyrrelmr@cs.tcd.ie - -# If you make a new map, please send it to Antonio, so future releases -# will include them. -# Antonio Larrosa Jimenez, larrosa@kde.org - -# Yamaha QY10 Map File - -DEFINE PATCHMAP -AcusticPiano =0 -BrightPiano =0 -SynthPiano =1 -HonkyTonky =0 -ElectricPiano1=1 -ElectricPiano2=2 -Harpsichord =3 -Clavinet =3 -Celeste =18 -Glockenspiel =18 -Musicbox =20 -Vibes =19 -Marimba =18 -Xylophon =20 -TubeBell =19 -Santur =12 -HomeOrg =4 -PercussionOrg =4 -RockOrg =4 -ChurchOrg =5 -ReedOrg =5 -Accordion =5 -Harmonica =23 -Concrtna =23 -NylonGuitar =12 -AcusticGuitar =12 -JazzGuitar =9 -CleanGuitar =9 -MuteGuitar =11 -OdGuitar =9 -DistortionGuit=10 -GtrHarm =25 -AcusticBass =13 -FingerBass =14 -PickBass =14 -FretlessBass =13 -SlapBass1 =15 -SlapBass2 =15 -SynthBass1 =16 -SynthBass2 =16 -Violin =23 -Viola =23 -Cello =23 -Contrabajo =23 -Marcato =6 -Pizzicato =16 -Harp =12 -Timpani =20 -Marcato =6 -SlowStrings =6 -SynthStrings1 =22 -SynthStrings2 =22 -Choir =27 -Doo =21 -Voices =21 -OrchestraHit =8 -Trumpet =26 -Trombone =26 -Tuba =21 -MuteTrumpet =8 -FrenchHorn =26 -HitBrass =8 -SynthBrass1 =21 -SynthBrass2 =21 -SopranoSax =26 -AltoSax =26 -TenorSax =26 -BaritoneSax =26 -Oboe =27 -EnglishHorn =26 -Bassoon =27 -Clarinet =27 -Piccolo =27 -Flute =27 -Recorder =27 -WoodFlute =27 -Bottle =27 -Shakazul =27 -Whistle =27 -Ocarina =27 -SquareWave =28 -SawWave =28 -Calliope =29 -Chiflead =29 -Charang =24 -VoxLead =21 -Lead5th =21 -BassLead =21 -Fantasia =24 -WarmPad =21 -Polysyn =22 -Ghostie =27 -BowGlass =26 -MetalPad =21 -HaloPad =27 -Sweeper =24 -Aurora =31 -SoundTrack =21 -Crystal =19 -Atmosphear =24 -FreshAir =21 -Unicorn =24 -Sweeper =24 -StarTrak =21 -Sitar =9 -Banjo =9 -Shamisen =12 -Koto =12 -Kalimba =18 -BagPipes =28 -Fiddle =28 -Shannai =23 -Carillon =19 -Agogo =20 -SteelDrm =18 -WoodBlk =20 -Taiko =20 -Toms =18 -Syntom =18 -RevCymbal =31 -Fx-Fret =31 -Fx-Blow =31 -Seashore =31 -Jungle =31 -Telephon =5 -Helicopter =31 -Applause =31 -Gunshot =31 -END - -DEFINE KEYMAP "Drumset" -C 0 =0 -C#0 =1 -D 0 =2 -D#0 =3 -E 0 =4 -F 0 =5 -F#0 =6 -G 0 =7 -G#0 =8 -A 0 =9 -A#0 =10 -B 0 =11 -C 1 =12 -C#1 =13 -D 1 =14 -D#1 =15 -E 1 =16 -F 1 =17 -F#1 =18 -G 1 =19 -G#1 =20 -A 1 =21 -A#1 =22 -B 1 =23 -C 2 =24 -C#2 =25 -D 2 =26 -# What is a high q? -D#2 27 Highq =40 -E 2 28 Slap =37 -F 2 29 Scratch1 =23 -F#2 30 Scratch2 =48 -G 2 31 Sticks =21 -G#2 32 SqrClick =42 -A 2 33 MetaClick=42 -A#2 34 MetBell =43 -B 2 35 Kick1 =36 -C 3 36 Kick2 =12 -C#3 37 StickRim =21 -D 3 38 Snare1 =15 -D#3 39 Claps =19 -E 3 40 snare2 =14 -F 3 41 tomlo2 =16 -F#3 42 Hihatclos=23 -G 3 43 Tomlo1 =16 -G#3 44 HihatPd =23 -A 3 45 Tommid2 =17 -A#3 46 Hihatop =24 -B 3 47 Tommid1 =17 -C 4 48 Tomhi2 =18 -C#4 49 Cymbalcrsh1 =20 -D 4 50 Tomhi1 =18 -D#4 51 Cymbalride1 =22 -E 4 52 Cymbalchina =22 -F 4 53 Cymbell =22 -F#4 54 Tamborin =21 -G 4 55 CymbalSplash=20 -G#4 56 Cowbell =37 -A 4 57 Cymbalcrash2=20 -A#4 58 Vibslap =0 -B 4 59 Cymbalride2 =22 -C 5 60 Bongohi =41 -C#5 61 Bongolo =40 -D 5 62 Congahi1 =41 -D#5 63 congahi2 =41 -E 5 64 Congalo =40 -F 5 65 Timbalehi=46 -F#5 66 Timbalelo=45 -G 5 67 Agogohi =44 -G#5 68 Agogolo =43 -A 5 69 Cabasa =48 -A#5 70 Maracas =48 -B 5 71 whistle1 =0 -C 6 72 whistle2 =0 -C#6 73 Guiro1 =0 -D 6 74 Guiro2 =0 -D#6 75 Clave =44 -E 6 76 Woodblock1=40 -F 6 77 Woodblock2=41 -# Don't know about the following two -F#6 78 Cuica1 =0 -G 6 79 Cuica2 =0 -G#6 80 Triangle1=44 -A 6 81 Triangle2=44 -A#6 82 Shaker =48 -B 6 83 Jingles =23 -C 7 84 Belltree =0 -C#7 85 Canstinet=21 -D 7 86 Surdo1 =16 -D#7 87 Surdo2 =17 -E 7 =88 -F 7 =89 -F#7 =90 -G 7 =91 -G#7 =92 -A 7 =93 -A#7 =94 -B 7 =95 -C 8 =96 -C#8 =97 -D 8 =98 -D#8 =99 -E 8 =100 -F 8 =101 -F#8 =102 -G 8 =103 -G#8 =104 -A 8 =105 -A#8 =106 -B 8 =107 -C 9 =108 -C#9 =109 -D 9 =110 -D#9 =111 -E 9 =112 -F 9 =113 -F#9 =114 -G 9 =115 -G#9 =116 -A 9 =117 -A#9 =118 -B 9 =119 -C 10=120 -C#10=121 -D 10=122 -D#10=123 -E 10=124 -F 10=125 -F#10=126 -G 10=127 -END - - -DEFINE CHANNELMAP -# The information on channels 7-8 and 11-15 is ignored since the QY10 is only -# 8 part multi-timbral. The polyphony should be okay. -0 = 0 -1 = 1 -2 = 2 -3 = 3 -4 = 4 -5 = 5 -6 = 6 -# The next two channels are ignored -7 = 9 -8 = 8 -# Play GM channel 9 (drums) on QY10 track 7 (rhythm track) -9 = 7 Keymap "Drumset" ForcePatch 30 -# All the following channels are ignored. -10 = 10 -11 = 11 -12 = 12 -13 = 13 -14 = 14 -15 = 15 -END - -# I don't think the QY10 responds to Expression Events, so... -OPTIONS -MapExpressionToVolumeEvents -END diff --git a/kmid/maps/gm.map b/kmid/maps/gm.map deleted file mode 100644 index fd188ec0..00000000 --- a/kmid/maps/gm.map +++ /dev/null @@ -1,290 +0,0 @@ -# Blank lines and lines beginning with # are ignored -# This is a map for any General Midi synthesizer -# If you make a new map, please send it to me, so future releases -# will include them. -# Antonio Larrosa Jimenez, larrosa@kde.org - -# General Midi Map File - -DEFINE PATCHMAP -AcusticPiano =0 -BrightPiano =1 -SynthPiano =2 -HonkyTonky =3 -ElectricPiano1=4 -ElectricPiano2=5 -Harpsichord =6 -Clavinet =7 -Celeste =8 -Glockenspiel =9 -Musicbox =10 -Vibes =11 -Marimba =12 -Xylophon =13 -TubeBell =14 -Santur =15 -HomeOrg =16 -PercussionOrg =17 -RockOrg =18 -ChurchOrg =19 -ReedOrg =20 -Accordion =21 -Harmonica =22 -Concrtna =23 -NylonGuitar =24 -AcusticGuitar =25 -JazzGuitar =26 -CleanGuitar =27 -MuteGuitar =28 -OdGuitar =29 -DistortionGuit=30 -GtrHarm =31 -AcusticBass =32 -FingerBass =33 -PickBass =34 -FretlessBass =35 -SlapBass1 =36 -SlapBass2 =37 -SynthBass1 =38 -SynthBass2 =39 -Violin =40 -Viola =41 -Cello =42 -Contrabajo =43 -Marcato =44 -Pizzicato =45 -Harp =46 -Timpani =47 -Marcato =48 -SlowStrings =49 -SynthStrings1 =50 -SynthStrings2 =51 -Choir =52 -Doo =53 -Voices =54 -OrchestraHit =55 -Trumpet =56 -Trombone =57 -Tuba =58 -MuteTrumpet =59 -FrenchHorn =60 -HitBrass =61 -SynthBrass1 =62 -SynthBrass2 =63 -SopranoSax =64 -AltoSax =65 -TenorSax =66 -BaritoneSax =67 -Oboe =68 -EnglishHorn =69 -Bassoon =70 -Clarinet =71 -Piccolo =72 -Flute =73 -Recorder =74 -WoodFlute =75 -Bottle =76 -Shakazul =77 -Whistle =78 -Ocarina =79 -SquareWave =80 -SawWave =81 -Calliope =82 -Chiflead =83 -Charang =84 -VoxLead =85 -Lead5th =86 -BassLead =87 -Fantasia =88 -WarmPad =89 -Polysyn =90 -Ghostie =91 -BowGlass =92 -MetalPad =93 -HaloPad =94 -Sweeper =95 -Aurora =96 -SoundTrack =97 -Crystal =98 -Atmosphear =99 -FreshAir =100 -Unicorn =101 -Sweeper =102 -StarTrak =103 -Sitar =104 -Banjo =105 -Shamisen =106 -Koto =107 -Kalimba =108 -BagPipes =109 -Fiddle =110 -Shannai =111 -Carillon =112 -Agogo =113 -SteelDrm =114 -WoodBlk =115 -Taiko =116 -Toms =117 -Syntom =118 -RevCymbal =119 -Fx-Fret =120 -Fx-Blow =121 -Seashore =122 -Jungle =123 -Telephon =124 -Helicopter =125 -Applause =126 -Gunshot =127 -END - -DEFINE KEYMAP "Drumset" -C 0 =0 -C#0 =1 -D 0 =2 -D#0 =3 -E 0 =4 -F 0 =5 -F#0 =6 -G 0 =7 -G#0 =8 -A 0 =9 -A#0 =10 -B 0 =11 -C 1 =12 -C#1 =13 -D 1 =14 -D#1 =15 -E 1 =16 -F 1 =17 -F#1 =18 -G 1 =19 -G#1 =20 -A 1 =21 -A#1 =22 -B 1 =23 -C 2 =24 -C#2 =25 -D 2 =26 -D#2 27 Highq =27 -E 2 28 Slap =28 -F 2 29 Scratch1 =29 -F#2 30 Scratch2 =30 -G 2 31 Sticks =31 -G#2 32 SqrClick =32 -A 2 33 MetaClick=33 -A#2 34 MetBell =34 -B 2 35 Kick1 =35 -C 3 36 Kick2 =36 -C#3 37 StickRim =37 -D 3 38 Snare1 =38 -D#3 39 Claps =39 -E 3 40 snare2 =40 -F 3 41 tomlo2 =41 -F#3 42 Hihatclos=42 -G 3 43 Tomlo1 =43 -G#3 44 HihatPd =44 -A 3 45 Tommid2 =45 -A#3 46 Hihatop =46 -B 3 47 Tommid1 =47 -C 4 48 Tomhi2 =48 -C#4 49 Cymbalcrsh1 =49 -D 4 50 Tomhi1 =50 -D#4 51 Cymbalride1 =51 -E 4 52 Cymbalchina =52 -F 4 53 Cymbell =53 -F#4 54 Tamborin =54 -G 4 55 CymbalSplash=55 -G#4 56 Cowbell =56 -A 4 57 Cymbalcrash2=57 -A#4 58 Vibslap =58 -B 4 59 Cymbalride2 =59 -C 5 60 Bongohi =60 -C#5 61 Bongolo =61 -D 5 62 Congahi1 =62 -D#5 63 congahi2 =63 -E 5 64 Congalo =64 -F 5 65 Timbalehi=65 -F#5 66 Timbalelo=66 -G 5 67 Agogohi =67 -G#5 68 Agogolo =68 -A 5 69 Cabasa =69 -A#5 70 Maracas =70 -B 5 71 whistle1 =71 -C 6 72 whistle2 =72 -C#6 73 Guiro1 =73 -D 6 74 Guiro2 =74 -D#6 75 Clave =75 -E 6 76 Woodblock1=76 -F 6 77 Woodblock2=77 -F#6 78 Cuica1 =78 -G 6 79 Cuica2 =79 -G#6 80 Triangle1=80 -A 6 81 Triangle2=81 -A#6 82 Shaker =82 -B 6 83 Jingles =83 -C 7 84 Belltree =84 -C#7 85 Canstinet=85 -D 7 86 Surdo1 =86 -D#7 87 Surdo2 =87 -E 7 =88 -F 7 =89 -F#7 =90 -G 7 =91 -G#7 =92 -A 7 =93 -A#7 =94 -B 7 =95 -C 8 =96 -C#8 =97 -D 8 =98 -D#8 =99 -E 8 =100 -F 8 =101 -F#8 =102 -G 8 =103 -G#8 =104 -A 8 =105 -A#8 =106 -B 8 =107 -C 9 =108 -C#9 =109 -D 9 =110 -D#9 =111 -E 9 =112 -F 9 =113 -F#9 =114 -G 9 =115 -G#9 =116 -A 9 =117 -A#9 =118 -B 9 =119 -C 10=120 -C#10=121 -D 10=122 -D#10=123 -E 10=124 -F 10=125 -F#10=126 -G 10=127 -END - - -DEFINE CHANNELMAP -0 = 0 -1 = 1 -2 = 2 -3 = 3 -4 = 4 -5 = 5 -6 = 6 -7 = 7 -8 = 8 -9 = 9 -10 = 10 -11 = 11 -12 = 12 -13 = 13 -14 = 14 -15 = 15 -END - diff --git a/kmid/midicfgdlg.cpp b/kmid/midicfgdlg.cpp deleted file mode 100644 index 481c4922..00000000 --- a/kmid/midicfgdlg.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/************************************************************************** - - midicfgdlg.cpp - The midi config dialog - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "midicfgdlg.h" -#include "version.h" -#include -#include - -MidiConfigDialog::MidiConfigDialog(DeviceManager *dm, - TQWidget *parent,const char *name) : KDialogBase(parent,name,TRUE, - i18n("Configure MIDI Devices"), KDialogBase::Ok|KDialogBase::Cancel) -{ - setMinimumSize(360,240); - TQWidget *page = new TQWidget( this ); - setMainWidget(page); - - TQVBoxLayout *topLayout=new TQVBoxLayout(page, 0, spacingHint()); - TQLabel *label=new TQLabel(i18n("Select the MIDI device you want to use:"),page); - topLayout->addWidget(label); - mididevices=new TQListBox(page,"midideviceslist"); - topLayout->addWidget(mididevices,3); - connect(mididevices,TQT_SIGNAL(highlighted(int)),TQT_SLOT(deviceselected(int))); - devman=dm; - TQString temp; - for (int i=0;imidiPorts()+devman->synthDevices();i++) - { - if (strcmp(devman->type(i),"")!=0) - temp = TQString("%1 - %2").arg(devman->name(i)).arg(devman->type(i)); - else - temp = devman->name(i); - - mididevices->insertItem(temp,i); - }; - selecteddevice=devman->defaultDevice(); - mididevices->setCurrentItem(selecteddevice); - - TQLabel *label2=new TQLabel(i18n("Use the MIDI map:"),page); - topLayout->addWidget(label2); - - - if (selectedmap!=NULL) delete selectedmap; - if (strcmp(devman->midiMapFilename(),"")==0) - selectedmap=NULL; - else - { - selectedmap=new char[strlen(devman->midiMapFilename())+1]; - strcpy(selectedmap,devman->midiMapFilename()); - } - - if (selectedmap!=NULL) maplabel=new TQLabel(selectedmap,page); - else maplabel=new TQLabel(i18n("None"),page); - - topLayout->addWidget(maplabel); - - TQHBoxLayout *hbox=new TQHBoxLayout(topLayout); - hbox->addStretch(1); - mapbrowse=new TQPushButton(i18n("Browse..."),page); - hbox->addWidget(mapbrowse); - connect(mapbrowse,TQT_SIGNAL(clicked()),TQT_SLOT(browseMap()) ); - - mapnone=new TQPushButton(i18n("None"),page); - hbox->addWidget(mapnone); - connect(mapnone,TQT_SIGNAL(clicked()),TQT_SLOT(noMap()) ); - - topLayout->addStretch(1); - -} - -void MidiConfigDialog::deviceselected(int idx) -{ - selecteddevice=idx; -} - -void MidiConfigDialog::browseMap() -{ - TQString path = TDEGlobal::dirs()->findAllResources("appdata", "maps/*.map").last(); - path.truncate(path.findRev('/')); - - KURL url = KFileDialog::getOpenURL(path,"*.map",this); - - if( url.isEmpty() ) - return; - - if( !url.isLocalFile() ) - { - KMessageBox::sorry( 0L, i18n( "Only local files are currently supported." ) ); - return; - } - - TQString filename = url.path(); - - delete selectedmap; - selectedmap=new char[filename.length()+1]; - strcpy(selectedmap,TQFile::encodeName(filename)); - maplabel->setText(selectedmap); -} - -void MidiConfigDialog::noMap() -{ - if (selectedmap!=NULL) {delete selectedmap;selectedmap=NULL;}; - maplabel->setText(i18n("None")); -} - -int MidiConfigDialog::selecteddevice=0; -char *MidiConfigDialog::selectedmap=NULL; - -#include "midicfgdlg.moc" diff --git a/kmid/midicfgdlg.h b/kmid/midicfgdlg.h deleted file mode 100644 index 98585e6f..00000000 --- a/kmid/midicfgdlg.h +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************** - - midicfgdlg.h - The midi config dialog - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _midicfgdlg_h_ -#define _midicfgdlg_h_ - -#include - -class DeviceManager; - -class TQLabel; -class TQPushButton; -class TQListBox; -class MidiConfigDialog : public KDialogBase -{ - Q_OBJECT - - -public: - - MidiConfigDialog(DeviceManager *dm,TQWidget *parent,const char *name); - -public slots: - void deviceselected(int idx); - void browseMap(); - void noMap(); - -private: - TQLabel *maplabel; - TQListBox *mididevices; - TQPushButton *mapbrowse; - TQPushButton *mapnone; - - DeviceManager *devman; - -public: - static int selecteddevice; - static char *selectedmap; -}; - -#endif diff --git a/kmid/pics/Makefile.am b/kmid/pics/Makefile.am deleted file mode 100644 index 4bf75950..00000000 --- a/kmid/pics/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -kmidicondir = $(kde_datadir)/kmid/icons -kmidicon_ICON = AUTO - diff --git a/kmid/pics/cr16-action-piano.png b/kmid/pics/cr16-action-piano.png deleted file mode 100644 index 29536a0a..00000000 Binary files a/kmid/pics/cr16-action-piano.png and /dev/null differ diff --git a/kmid/pics/cr16-action-volume.png b/kmid/pics/cr16-action-volume.png deleted file mode 100644 index 3b75a38c..00000000 Binary files a/kmid/pics/cr16-action-volume.png and /dev/null differ diff --git a/kmid/pics/cr22-action-piano.png b/kmid/pics/cr22-action-piano.png deleted file mode 100644 index 226e4444..00000000 Binary files a/kmid/pics/cr22-action-piano.png and /dev/null differ diff --git a/kmid/pics/cr22-action-volume.png b/kmid/pics/cr22-action-volume.png deleted file mode 100644 index e87c5147..00000000 Binary files a/kmid/pics/cr22-action-volume.png and /dev/null differ diff --git a/kmid/pics/cr32-action-piano.png b/kmid/pics/cr32-action-piano.png deleted file mode 100644 index 9d75a570..00000000 Binary files a/kmid/pics/cr32-action-piano.png and /dev/null differ diff --git a/kmid/pics/cr32-action-volume.png b/kmid/pics/cr32-action-volume.png deleted file mode 100644 index 0e1f3dec..00000000 Binary files a/kmid/pics/cr32-action-volume.png and /dev/null differ diff --git a/kmid/qslidertime.cpp b/kmid/qslidertime.cpp deleted file mode 100644 index aa879da5..00000000 --- a/kmid/qslidertime.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/************************************************************************** - - kslidertime.cpp - A widget that displays time tags under a KSlider - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include "qslidertime.h" -#include -#include -#include - -#define ARROW_LENGTH 13 - -QSliderTime::QSliderTime( TQSlider *ksl, TQWidget *parent, const char *name) - : TQWidget (parent,name) -{ -kslider=ksl; - -TQPainter painter; -TQFontMetrics qfmt(painter.font()); -fontheight=qfmt.height(); - -} - -char *QSliderTime::formatMillisecs(int ms,char *tmp) -{ - if (ms<60000) - { - sprintf(tmp,"0:%02d",ms/1000); - } - else - sprintf(tmp,"%d:%02d",ms/60000,(ms%60000)/1000); -return tmp; -} - -void QSliderTime::paintEvent( TQPaintEvent * ) -{ - TQPainter painter(this); - -// erase(); - drawTimeMarks(&painter); -} - -int quantizeTimeStep(int t) -{ -if (t<=2000) t=2000; - else if (t<=5000) t=5000; - else if (t<=10000) t=10000; - else if (t<=15000) t=15000; - else if (t<=30000) t=30000; - else if (t<=60000) t=60000; - else if (t<=120000) t=120000; -return t; -} - -void QSliderTime::drawTimeMarks(TQPainter *painter) -{ -if (kslider==NULL) return; - int i; - int maxV = kslider->maxValue(); - TQFontMetrics qfmt(painter->font()); - fontheight=qfmt.height(); - int ntimetags = width()/(qfmt.width("-88:88-")); - int timestep; - if (ntimetags>1) timestep = maxV/(ntimetags); - else timestep=maxV; - timestep = quantizeTimeStep(timestep); - ntimetags = maxV/timestep; - - // draw time tags (only in horizontal !!) - int posy=qfmt.height(); - char *tmp=new char[100]; - int pos=0; - int deltapos=0; - formatMillisecs(0,tmp); - painter->drawText( 0, posy,TQString(tmp)); - for ( i = timestep; i <= maxV - timestep; i += timestep ) - { - pos = (width()-10) * i / maxV + 5; - formatMillisecs(i,tmp); - deltapos=qfmt.width(tmp)/2; - painter->drawText( pos-deltapos, posy,TQString(tmp)); - } - - pos = width()- 5; - formatMillisecs(maxV,tmp); - deltapos=qfmt.width(tmp); - - painter->drawText( pos-deltapos, posy,TQString(tmp)); - -} - - -TQSize QSliderTime::sizeHint() -{ - return TQSize(10,fontheight+2); -} - -TQSizePolicy QSliderTime::sizePolicy() -{ - return TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Fixed); -} -#include "qslidertime.moc" diff --git a/kmid/qslidertime.h b/kmid/qslidertime.h deleted file mode 100644 index 57aa3b18..00000000 --- a/kmid/qslidertime.h +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************** - - kslidertime.h - A widget that displays time tags under a KSlider - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _kslidertime_h_ -#define _kslidertime_h_ - -#include - -class TQWidget; - -class QSliderTime : public TQWidget -{ - Q_OBJECT - -private: - - TQSlider *kslider; - -int fontheight; -public: - - QSliderTime( TQSlider *ksl, TQWidget *parent = NULL, const char *name = NULL ); - - int getFontHeight(void) {return fontheight;}; - - TQSize sizeHint(); - TQSizePolicy sizePolicy(); - -private: - - virtual void paintEvent( TQPaintEvent * ); - void drawTimeMarks(TQPainter *painter); - - char *formatMillisecs(int ms,char *tmp); -}; - -#endif diff --git a/kmid/randomlist.cpp b/kmid/randomlist.cpp deleted file mode 100644 index f26b8cfc..00000000 --- a/kmid/randomlist.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/************************************************************************** - - randomlist.cpp - Some "random functions" :-) - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include "randomlist.h" -#include -#include - -#define RAND_UNIFORM (double)rand()/(double)RAND_MAX - -int random_discrete(double *distrib,int n) -{ - int i=0; - double g=0.0; - double z=0.0; - while ((z==0.0)||(z==1.0)) z=RAND_UNIFORM; - while ((g0) used++; - }; - used--; // k will no longer be used :-) - if (used==0) return; - double piece=distrib[k]/(double)used; - distrib[k]=0.0; - for (i=0;i0) distrib[i]+=piece; -} - -void show_distrib(double *distrib,int n) -{ - printf("("); - for (int j=0;j0) - { - x=random_discrete(distrib,n); - list[x]=i; - i++; - remove_lmn_from_discrete_distrib(x,distrib,n,used); - used--; - }; - delete distrib; - - return list; -} - -int *generate_list(int n) -{ - int *list=new int[n]; - for (int i=0;isetState(KLed::Off); - lamps[i]->setGeometry(x+2,0,w-4,height()); - lamps[i]->show(); - x+=w; - } -// lamps[0]->setState(KLed::On); - -} - -void RhythmView::Beat(int j) -{ - if (j>num) setRhythm(j,4); // This is a preventive case - - for (int i=0;ioff(); - } - lamps[j-1]->on(); -} - -void RhythmView::Beat(void) -{ - -} - -void RhythmView::resizeEvent(TQResizeEvent *) -{ - int w=width()/num; - int x=0; - - for (int i=0;isetGeometry(x+2,0,w-4,height()); - x+=w; - } -} - -TQSize RhythmView::sizeHint() -{ - return TQSize(10,10); -} - -TQSizePolicy RhythmView::sizePolicy() -{ -// return TQWidget::sizePolicy(); - return TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum); -} - diff --git a/kmid/rhythmview.h b/kmid/rhythmview.h deleted file mode 100644 index 8af09613..00000000 --- a/kmid/rhythmview.h +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************** - - rhythmview.h - The RhythmView widget - Copyright (C) 1998 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef _rhythmview_h_ -#define _rhythmview_h_ - -#include -#include - -class RhythmView : public TQWidget -{ - int num,den; - - KLed **lamps; - -public: - RhythmView (TQWidget *parent, const char *name); - ~RhythmView(); - - void setRhythm(int numerator,int denominator); - - void Beat(int i); // Sets the beat number - - void Beat(void); // Just increase the beat - - TQSize sizeHint(); - TQSizePolicy sizePolicy(); - -private: - void resizeEvent(TQResizeEvent *); - -}; - -#endif diff --git a/kmid/slman.cpp b/kmid/slman.cpp deleted file mode 100644 index 39b10ca2..00000000 --- a/kmid/slman.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/************************************************************************** - - slman.cc - SongList Manager, which holds a set of collections (SongLists) - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include "slman.h" -#include -#include -#include -#include "version.h" -#include - -SLManager::SLManager() -{ - list=NULL; - ntotal=0; - tempsl=NULL; - createTemporaryCollection(); -} - -SLManager::SLManager(SLManager &src) -{ - list=NULL; - ntotal=0; - tempsl=NULL; - SongListNode *srcSL=src.list; - SongList *tmpSL; - int i; - while (srcSL!=NULL) - { - i=createCollection(srcSL->name); - tmpSL=getCollection(i); - if (tmpSL!=NULL) - tmpSL->copy(*srcSL->SL); - srcSL=srcSL->next; - } - if (src.tempsl!=NULL) tempsl=new SongList(*src.tempsl); - else tempsl=NULL; -} - -SLManager::~SLManager() -{ - SongListNode *ptr; - ptr=list; - while (ptr!=NULL) - { - list=ptr->next; - if (ptr->SL!=NULL) delete ptr->SL; - if (ptr->name!=NULL) delete ptr->name; - delete ptr; - ptr=list; - } - if (tempsl!=NULL) delete tempsl; - ntotal=0; -} - -int SLManager::createCollection(const char *name) -{ - SongListNode *ptr; - if (nameUsed(name)) - { - printf("Name '%s' is already used\n",name); - return -1; - } - if (list==NULL) - { - list=new SongListNode; - list->id=1; - ntotal=1; - ptr=list; - } - else - { - ptr=list; - while (ptr->next!=NULL) ptr=ptr->next; - ptr->next=new SongListNode; - ptr=ptr->next; - - ptr->id= ++ntotal; - } - ptr->SL=new SongList; - ptr->next=NULL; - if (name!=NULL) - { - ptr->name=new char[strlen(name)+1]; - strcpy(ptr->name,name); - } - else - { - ptr->name=getNotUsedName(); - } -return ptr->id; -} - -char *SLManager::getNotUsedName(void) -{ - char *trythis; - trythis=new char[100]; - strcpy(trythis,"No Name"); - int tries=1; - int success=0; - while (!success) - { - if (nameUsed(trythis)) sprintf(trythis,"No Name - %d",++tries); - else - success=1; - } - return trythis; -} - -int SLManager::nameUsed(const char *name) -{ - /* - SongListNode *ptr=list; - int used=0; - while ((!used)&&(ptr!=NULL)) - { - if (strcmp(ptr->name,name)==0) used=1; - ptr=ptr->next; - }; - return used; - */ - if (getCollection(name)==NULL) return 0; - return 1; -} - -void SLManager::deleteCollection(int id) -{ - if (list==NULL) return; - SongListNode *ptr=list; - SongListNode *ptr2; - if (id==1) list=list->next; - else - { - ptr2=list; - while ((ptr!=NULL)&&(ptr->id!=id)) - { - ptr2=ptr; - ptr=ptr->next; - } - if (ptr==NULL) - { - printf("Trying to delete a not used id\n"); - return; - } - ptr2->next=ptr->next; - } - ptr2=ptr->next; - delete ptr->SL; - delete ptr->name; - delete ptr; - regenerateid(ptr2,id); - -} - -void SLManager::regenerateid(SongListNode *sl,int id) -{ - SongListNode *tmp=sl; - int i=id; - while (tmp!=NULL) - { - tmp->id=i++; - tmp=tmp->next; - } - ntotal=i-1; -} - -void SLManager::changeCollectionName(int id,const char *newname) -{ - if (id<1) return; - if (nameUsed(newname)) - { - printf("Cannot change name, '%s' is already used\n",newname); - return; - } - SongListNode *ptr=list; - while ((ptr!=NULL)&&(ptr->id!=id)) ptr=ptr->next; - if (ptr==NULL) return; - - delete ptr->name; - ptr->name=new char[strlen(newname)+1]; - strcpy(ptr->name,newname); -} - -SongList *SLManager::getCollection(int id) -{ - if (id==0) return tempsl; - - SongListNode *ptr=list; - while ((ptr!=NULL)&&(ptr->id!=id)) ptr=ptr->next; - - if (ptr==NULL) return NULL; - return ptr->SL; -} - -SongList *SLManager::getCollection(const char *name) -{ - SongListNode *ptr=list; - while ((ptr!=NULL)&&(strcmp(ptr->name,name)!=0)) ptr=ptr->next; - - if (ptr==NULL) return NULL; - return ptr->SL; -} - -const char *SLManager::getCollectionName(int id) -{ - if (id==0) return I18N_NOOP("Temporary Collection"); - SongListNode *ptr=list; - while ((ptr!=NULL)&&(ptr->id!=id)) ptr=ptr->next; - - if (ptr==NULL) return NULL; - return ptr->name; -} - -void SLManager::loadConfig(const char *filename) -{ -#ifdef GENERAL_DEBUG_MESSAGES - printf("Loading collections\n"); -#endif - FILE *fh=fopen(filename,"rt"); - if (fh==NULL) - { - printf("Collections cannot be loaded\n(File %s doesn't exist or can't be opened)\n",filename); - return; - } - char s[300]; - SongList *sl=NULL; - int activeid=0; - while (!feof(fh)) - { - s[0] = 0; - fgets(s,299,fh); - if ((strlen(s)>0)&&(s[strlen(s)-1]==10)) s[strlen(s)-1]=0; - switch (s[0]) - { - case (0) : break; - case (10) : break; - case ('=') : - { - if (sl!=NULL) sl->setActiveSong(activeid); - int id=createCollection(&s[1]); - sl=getCollection(id); - fgets(s,299,fh); - activeid=atoi(s); - } - break; - default : - { - if (sl!=NULL) sl->AddSong((const char *)s); - } - } - } - if (sl!=NULL) sl->setActiveSong(activeid); - - fclose(fh); -} - -void SLManager::saveConfig(const char *filename) -{ - SongListNode *ptr=list; - FILE *fh=fopen(filename,"wt"); - if (fh==NULL) - { - printf("Collections couldn't be saved\n"); - return; - } - char s[FILENAME_MAX]; - SongList *sl; - while (ptr!=NULL) - { - sprintf(s,"=%s\n",ptr->name); - fputs(s,fh); - - sl=ptr->SL; - sprintf(s,"%d\n",sl->getActiveSongID()); - fputs(s,fh); - - sl->iteratorStart(); - while (!sl->iteratorAtEnd()) - { - sprintf(s,"%s\n",sl->getIteratorName()); - fputs(s,fh); - sl->iteratorNext(); - } - // ptr->SL->saveList(fh); - fputs("\n",fh); - - ptr=ptr->next; - } - fclose(fh); - -} - -SongList *SLManager::createTemporaryCollection(void) -{ - if (tempsl==NULL) - tempsl=new SongList(); - else - tempsl->clean(); - - return tempsl; -} diff --git a/kmid/slman.h b/kmid/slman.h deleted file mode 100644 index f1da57c0..00000000 --- a/kmid/slman.h +++ /dev/null @@ -1,74 +0,0 @@ -/* slman.h - SongList Manager, which holds a set of collections (SongLists) - Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef SLMAN_H -#define SLMAN_H - -#include "songlist.h" - -class SLManager -{ -protected: -int ntotal; - -struct SongListNode - { - int id; - char *name; - SongList *SL; - - SongListNode *next; - }; -SongListNode *list; -SongList *tempsl; - -char *getNotUsedName(void); -int nameUsed(const char *name); -void regenerateid(SongListNode *sl,int id); - -public: -SLManager(); -SLManager(SLManager &src); // Copy constructor -~SLManager(); - -int createCollection(const char *name=NULL); // Returns the id associated to the - // new collection - // -1 if name already is used and Collection was - // not created - -void deleteCollection(int id); -void changeCollectionName(int id, const char *newname); - -SongList *getCollection(int id); -SongList *getCollection(const char *name); -const char *getCollectionName(int id); - -int numberOfCollections(void) {return ntotal;}; - -void loadConfig(const char *filename); -void saveConfig(const char *filename); - -SongList *createTemporaryCollection(void); -SongList *getTemporaryCollection(void) {return tempsl;}; - -}; - -#endif diff --git a/kmid/songlist.cpp b/kmid/songlist.cpp deleted file mode 100644 index cc2572d8..00000000 --- a/kmid/songlist.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/************************************************************************** - - songlist.cc - class SongList, which holds a list of songs (collection) - Copyright (C) 1997,98 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#include "songlist.h" -#include -#include -#include - -SongList::SongList(void) -{ - list=NULL; - last=NULL; - active=NULL; - ntotal=0; -} - -SongList::SongList(SongList &src) -{ - list=last=active=NULL; - ntotal=0; - src.iteratorStart(); - while (!src.iteratorAtEnd()) - { - AddSong(src.getIteratorName()); - src.iteratorNext(); - } - if (src.active!=NULL) active=getSongid(src.active->id); -} - -SongList::~SongList() -{ - clean(); - Song *ptr=list; - active=last=NULL; - ntotal=0; - - while (ptr!=NULL) - { - list=ptr->next; - delete ptr->name; - delete ptr; - ptr=list; - } - -} - -SongList::Song *SongList::getSongid(int id) -{ - Song *ptr=list; - while ((ptr!=NULL)&&(ptr->id!=id)) - ptr=ptr->next; - - return ptr; -} - -int SongList::AddSong(const char *song) -{ - if (!song) return 0; - - if (last==NULL) - { - last=new Song; - list=last; - } - else - { - last->next=new Song; - last=last->next; - } - last->name=new char[strlen(song)+1]; - strcpy(last->name,song); - last->id= ++ntotal; - last->next=NULL; - if (active==NULL) active=last; - return last->id; -} - -void SongList::DelSong(int id) -{ - Song *ptr; - - if (list==NULL) return; - if (id==1) - { - if (last->id==1) - { - list=last=active=NULL; - ntotal=0; - } - else - { - ptr=list; - if (active->id==1) active=list->next; - list=list->next; - delete ptr->name; - delete ptr; - ntotal--; - - regenerateid(list,1); - } - return; - } - Song *ptr_prev=getSongid(id-1); - ptr=ptr_prev->next; - if (last->id==id) last=ptr_prev; - if (active->id==id) - if (active->next!=NULL) active=active->next; - else active=ptr_prev; - - ntotal--; - ptr_prev->next=ptr->next; - delete ptr->name; - delete ptr; - regenerateid(ptr_prev->next,id); - -} - -void SongList::regenerateid(Song *song,int id) -{ - Song *tmp=song; - int i=id; - while (tmp!=NULL) - { - tmp->id=i++; - tmp=tmp->next; - } - ntotal=i-1; -} - -void SongList::setActiveSong(int id) -{ - Song *tmp=getSongid(id); - if (tmp!=NULL) active=tmp; -} - -char *SongList::getName(int id) -{ - Song *tmp=getSongid(id); - if (tmp!=NULL) return tmp->name; - return NULL; -} - -/* -void SongList::saveList(FILE *fh) -{ - Song *ptr=list; - while (ptr!=NULL) - { - fputs(fh,ptr->name); - ptr=ptr->next; - } -} -*/ - -void SongList::iteratorStart(void) -{ - it=list; -} - -void SongList::iteratorNext(void) -{ - if (it!=NULL) it=it->next; -} - -int SongList::getIteratorID(void) -{ - if (it==NULL) return -1; - return it->id; -} - -char *SongList::getIteratorName(void) -{ - if (it==NULL) return NULL; - return it->name; -} - - -void SongList::clean(void) -{ - Song *tmp=list; - active=last=NULL; - ntotal=0; - - while (tmp!=NULL) - { - list=tmp->next; - delete [] tmp->name; - delete tmp; - tmp=list; - } -} - -void SongList::copy(SongList &src) -{ - clean(); - src.iteratorStart(); - while (!src.iteratorAtEnd()) - { - AddSong(src.getIteratorName()); - src.iteratorNext(); - } - if (src.active!=NULL) active=getSongid(src.active->id); -} - -int SongList::next(void) -{ - if (list==NULL) {active=NULL;return 0;}; - if (active!=NULL) active=active->next; - if (active==NULL) - { - Song *tmp=list; - while (tmp->next!=NULL) tmp=tmp->next; - active=tmp; - return 0; - } - return 1; -} - - -void SongList::previous(void) -{ - if (list==NULL) {active=NULL;return;}; - Song *tmp=list; - while ((tmp->next!=NULL)&&(tmp->next->id!=active->id)) tmp=tmp->next; - if (tmp->next==NULL) {active=list;return;}; - active=tmp; -} diff --git a/kmid/songlist.h b/kmid/songlist.h deleted file mode 100644 index cd95eb47..00000000 --- a/kmid/songlist.h +++ /dev/null @@ -1,84 +0,0 @@ -/* songlist.h - class SongList, which holds a list of songs (collection) - Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Send comments and bug fixes to larrosa@kde.org - or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain - -***************************************************************************/ -#ifndef SONGLIST_H -#define SONGLIST_H - -#include - -class SongList -{ -protected: -int ntotal; - -struct Song -{ - int id; - char *name; // complete path and file name - - Song *next; -}; - -Song *list; -Song *last; -Song *active; - -Song *it; // Iterator, just a helper variable to make easy (and fast) reading - // all the list - -Song *getSongid(int id); - -void regenerateid(Song *song,int id); - -public: -SongList(void); -SongList(SongList &src); // Copy constructor -~SongList(); - -int AddSong(const char *song); // Returns the id number assigned to the song -void DelSong(int id); - -int NumberOfSongs(void) { return ntotal; }; - -void setActiveSong(int id); -int getActiveSongID(void) {return ((active!=NULL)? (active->id ):(-1)); }; -char *getActiveSongName(void) - { - return ((active!=NULL)? (active->name):((char *)NULL)); - }; - -char *getName(int id); // Returns the name of the song with id id - -void previous(void); -int next(void); // returns 1 if evrything is ok, and 0 if it was the last element - // (but leaves active the last element instead of NULL) - -void iteratorStart(void); -void iteratorNext(void); -int iteratorAtEnd (void) {return (it==NULL);}; -int getIteratorID(void); -char *getIteratorName(void); - -void clean(void); // Clean this list -void copy(SongList &src); // Makes this object a copy of src (really copied) -}; - -#endif diff --git a/kmid/std.o3 b/kmid/std.o3 deleted file mode 100644 index e58311da..00000000 Binary files a/kmid/std.o3 and /dev/null differ diff --git a/kmid/std.sb b/kmid/std.sb deleted file mode 100644 index 4fe2d0be..00000000 Binary files a/kmid/std.sb and /dev/null differ diff --git a/kmid/version.h b/kmid/version.h deleted file mode 100644 index be282fff..00000000 --- a/kmid/version.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _VERSION_H - - -#define VERSION_NUM 2.0 -#define VERSION_SHORTTXT "2.0" -#define VERSION_TXT "KMid 2.0" - -// Undefine WORKING for release versions -//#define WORKING - -// I want to keep some special variables defined at home for personal -// adjustments -//#define AT_HOME - - -// The next definition makes kmid display some general debug messages -// that may be helpful to locate any bug, but without making lots of -// messages. Please when reporting a bug, be sure that this is set and -// send me the output. -//#define GENERAL_DEBUG_MESSAGES - -// Define MODE_DEMO_ONLYVISUAL for kmid to work on systems with no soundcard, -// or when it is not well configured. You will only get visual feedback, that -// is, you will see the letter changing of colors, but no music. Really, you -// would get music if it is possible, but by defining this, many synchronization -// routines will be turned off. -//#define MODE_DEMO_ONLYVISUAL - - -// And now, DEBUG messages : -#ifdef WORKING -#define KMidDEBUG -//#define KDISPTEXTDEBUG -//#define COLLECTDLGDEBUG -//#define DEVICEMANDEBUG -//#define FMOUTDEBUG -//#define GUSOUTDEBUG -//#define MIDFILEDEBUG -//#define MIDIOUTDEBUG -//#define MIDISTATDEBUG -//#define MIDIMAPPERDEBUG -//#define SYNTHOUTDEBUG -//#define VOICEMANDEBUG -//#define PLAYERDEBUG -//#define TRACKDEBUG -#endif - -#endif diff --git a/kmid/x-karaoke.desktop b/kmid/x-karaoke.desktop deleted file mode 100644 index 2784f27a..00000000 --- a/kmid/x-karaoke.desktop +++ /dev/null @@ -1,61 +0,0 @@ -[Desktop Entry] -Type=MimeType -MimeType=audio/x-karaoke -Icon=sound -Patterns=*.kar;*.KAR; -Comment=Karaoke File -Comment[ar]=ملف Karaoke -Comment[bg]=Файл на Karaoke -Comment[bn]=কারাওকে ফাইল -Comment[br]=Restr Karaoke -Comment[bs]=Karaoke datoteka -Comment[ca]=Fitxer karaoke -Comment[cs]=Karaoke soubor -Comment[cy]=Ffeil Karaoke -Comment[da]=Karaoke-fil -Comment[de]=Karaoke-Datei -Comment[el]=Αρχείο Karaoke -Comment[eo]=Karaoko-dosiero -Comment[es]=Archivo Karaoke -Comment[et]=Karaoke fail -Comment[eu]=Karaoke fitxategia -Comment[fa]=پروندۀ Karaoke -Comment[fi]=Karaoketiedosto -Comment[fr]=Fichier de karaoké -Comment[ga]=Comhad Karaoke -Comment[gl]=Ficheiro Karaoke -Comment[he]=קובץ קריוקי -Comment[hi]=कराओके फ़ाइल -Comment[hu]=Karaoke-fájl -Comment[is]=Karaoke skrá -Comment[ja]=カラオケファイル -Comment[kk]=Караоке файлы -Comment[km]=ឯកសារ​ខារ៉ាអូខេ -Comment[ko]=노래방 파일 -Comment[lt]=Karaoke byla -Comment[mk]=Karaoke датотека -Comment[nb]=Karaokefil -Comment[nds]=Karaoke-Datei -Comment[ne]=कारावके फाइल -Comment[nl]=Karaoke-bestand -Comment[nn]=Karaokefil -Comment[pl]=Plik Karaoke -Comment[pt]=Ficheiro de Karaoke -Comment[pt_BR]=Arquivo Karaokê -Comment[ro]=Fişier karaoke -Comment[ru]=Файл караоке -Comment[sk]=Karaoke súbor -Comment[sl]=Datoteka Karaoke -Comment[sr]=Караоке фајл -Comment[sr@Latn]=Karaoke fajl -Comment[sv]=Karaoke-fil -Comment[ta]=கரோக்கி கோப்பு -Comment[tg]=Файли Karaoke -Comment[th]=แฟ้มคาราโอเกะ -Comment[tr]=Karaoke Dosyası -Comment[uk]=Файл Karaoke -Comment[uz]=Karaoki fayli -Comment[uz@cyrillic]=Караоки файли -Comment[zh_CN]=卡拉 OK 文件 -Comment[zh_HK]=卡拉OK 檔案 -Comment[zh_TW]=卡拉OK檔案 diff --git a/krec/Makefile.am b/krec/Makefile.am index a8091776..87c36f78 100644 --- a/krec/Makefile.am +++ b/krec/Makefile.am @@ -42,7 +42,7 @@ krec_la_SOURCES = \ main.cpp \ krecord.cpp -krec_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects +krec_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects krec_la_LIBADD = \ lib_krec_common.la \ $(top_builddir)/arts/gui/kde/libartsgui_kde.la \ @@ -50,12 +50,12 @@ krec_la_LIBADD = \ -lartskde $(LIBDL) $(LIB_KIO) $(LIB_TDEUI) $(LIB_KUTILS) kcm_krec_la_SOURCES = krecconfigure.cpp -kcm_krec_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects +kcm_krec_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects kcm_krec_la_LIBADD = lib_krec_common.la $(LIB_KUTILS) kcm_krec_files_la_SOURCES = krecconfig_files.cpp -kcm_krec_files_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects +kcm_krec_files_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects kcm_krec_files_la_LIBADD = lib_krec_common.la $(LIB_KUTILS) @@ -64,12 +64,12 @@ lib_krec_common_la_SOURCES = \ krecexport_template.cpp \ krecconfig_fileswidget.cpp -lib_krec_common_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects +lib_krec_common_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects lib_krec_common_la_LIBADD = $(LIB_TDEUI) $(LIB_KIO) libkrecexport_wave_la_SOURCES = krecexport_wave.cpp -libkrecexport_wave_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects +libkrecexport_wave_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -lmcop -lartsflow_idl -lkmedia2_idl -lsoundserver_idl -L../arts/modules/effects -lartsmoduleseffects libkrecexport_wave_la_LIBADD = lib_krec_common.la diff --git a/krec/krecglobal.cpp b/krec/krecglobal.cpp index 6b55a075..984048d2 100644 --- a/krec/krecglobal.cpp +++ b/krec/krecglobal.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/kscd/Makefile.am b/kscd/Makefile.am index d782683a..952aae9a 100644 --- a/kscd/Makefile.am +++ b/kscd/Makefile.am @@ -23,9 +23,9 @@ libkcompactdisc_la_LDFLAGS = $(all_libraries) -lpthread kde_kcfg_DATA = kscd.kcfg -kscd_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kscd_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kscd_LDADD = $(LIBCDROM) $(LIBCDAUDIO) \ - $(LIBFPE) $(LIB_KIO) -lkutils $(top_builddir)/libkcddb/libkcddb.la \ + $(LIBFPE) $(LIB_KIO) -ltdeutils $(top_builddir)/libkcddb/libkcddb.la \ libkcompactdisc.la -lpthread profiledata_DATA = kscd.profile.xml diff --git a/kscd/kscdmagic/Makefile.am b/kscd/kscdmagic/Makefile.am index 27c9454d..cf24f2bf 100644 --- a/kscd/kscdmagic/Makefile.am +++ b/kscd/kscdmagic/Makefile.am @@ -26,7 +26,7 @@ bin_PROGRAMS = kscdmagic kscdmagic_SOURCES = core.cpp main.cpp sound.cpp xlibwrap.cpp xlib.c # the library search path. -kscdmagic_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kscdmagic_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor # the libraries to link against. Be aware of the order. First the libraries, # that depend on the following ones. diff --git a/noatun/Makefile.am b/noatun/Makefile.am index f64f6d5e..91b80b87 100644 --- a/noatun/Makefile.am +++ b/noatun/Makefile.am @@ -16,7 +16,7 @@ kconfdir = $(libdir)/kconf_update_bin kconf_PROGRAMS = noatun20update noatun20update_SOURCES = noatun20update.cpp -noatun20update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +noatun20update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor noatun20update_LDADD = $(LIB_QT) messages: diff --git a/tdemid/ChangeLog b/tdemid/ChangeLog new file mode 100644 index 00000000..46db02d8 --- /dev/null +++ b/tdemid/ChangeLog @@ -0,0 +1,104 @@ +0.1 30-10-97 +----- -------- +First version + +0.2 9-11-97 +----- ------- +Better syncronization between lyrics and music. +Drag&Drop, better installation, icons, Customizable fonts. + +0.3 16-11-97 +----- -------- +The lyrics handler is very improved. +Option to automagically select lyrics or text. +Better handling for broken files. +Few bug fixes. +Real Session Management. +First rpm version. + +0.4 30-12-97 +----- -------- +Fixed the pthread bug (sorry to everyone that suffered it ;-)) +Added support for AWE and GUS cards +Can modify the midi device without recompiling. +Can play gzipped files + +0.41 22-2-98 +----- ------- +Fixed a problem with GUS cards +Improved midi mapper +Fixed a non-feature :-) related to FM +New icon and toolbar pixmaps which use fewer colors + +0.5 15-3-98 +----- ------- +FM support +Playlists (Collections) +Some small improvements here and there + +0.5.1 15-3-98 +----- ------- +A very small bug fix + +0.5.2 5-4-98 +----- ------ +Save Lyrics +Some bug fixes +More keys binded to functions (arrows, space, backspace, etc.) + +0.5.3 24-4-98 +----- ------- +Improved Synchronization between gui and player +Some bug fixes: + - One which caused tdemid to freeze when playing a collection with only 1 song + in aleatory mode and changing to next song + (reported by Jose Luis Sanchez) + - It was not possible to play a gzipped file that have spaces in its name + - There were some songs that played at a lower volume when moving the + slider, but not if playing from the beginning. +Better support for shuffle mode (now it doesn't repeat songs :-)) + +0.6 7-5-98 +----- ------ +Just thought that everything worked fine and did a major release to +put it in my homepage + +1.0 22-6-98 +----- ------- +Well, I should be studying, but KDE 1.0 good deserves a few minutes +to change the version number everywhere, remove debug printfs, and +clean the latest bugs, isn't it ? :-) + +1.2 14-9-98 +----- ------- +This version includes a new ChannelView to see notes played by each +instrument and a volume bar. +It also has some bug fixes and support for really broken midi files. + +1.6 27-11-98 +----- -------- +This version fix a bug that made tdemid totally unusable to many users +because it played music at different tempos (sometimes faster and +sometimes slower), without any rhythm. Anyway, this isn't a public +version yet, it's only available from CVS. + +1.7 2-4-99 +----- ------- +Modified KMid to work with Linux kernels from the 2.2.x series which +work very different than the ones in 2.0.x . That problem made KMid +continue playing music for a while (up to a few minutes !) after the +user had pressed the stop button. +Fixed a problem with AWE cards that made it play files with the pitch +bender raised. +Fixed a problem that made tdemid not to play the last few milliseconds of +some songs (sometimes up to half a second) +Another usual fixes (better support for kernel modules, workarounds for +compiler bugs, etc.) + +2.0 1-10-2000 +----- --------- +KMid has been ported to KDE 2.0 +Now has a separated ui and engine, it also has native ALSA support +It's a part now, so you can embed KMid in Konqueror and other apps. +Ah, and the scroll is smooth now :) + diff --git a/tdemid/Makefile.am b/tdemid/Makefile.am new file mode 100644 index 00000000..fe582e8b --- /dev/null +++ b/tdemid/Makefile.am @@ -0,0 +1,74 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = libtdemidpart.la +lib_LTLIBRARIES = libtdemidlib.la + +libtdemidlib_la_LDFLAGS = $(all_libraries) +libtdemidlib_la_LIBADD = $(LIB_KFILE) $(LIB_KPARTS) $(LIB_KIO) -ltdemid $(LIB_QT) $(LIB_TDEUI) -lDCOP $(LIB_TDECORE) + +libtdemidpart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +libtdemidpart_la_LIBADD = libtdemidlib.la + +libtdemidlib_la_SOURCES = tdemidframe.cpp tdemidclient.cpp kdisptext.cpp \ + qslidertime.cpp klcdnumber.cpp ktrianglebutton.cpp \ + midicfgdlg.cpp collectdlg.cpp randomlist.cpp \ + channelview.cpp channel.cpp channel3d.cpp channel4d.cpp \ + channelcfgdlg.cpp instrname.cpp rhythmview.cpp \ + songlist.cpp slman.cpp tdemid_part.cpp tdemidIface.skel + +libtdemidpart_la_SOURCES = part_dummy.cpp + +part_dummy.cpp: + touch part_dummy.cpp + +noinst_HEADERS = tdemidframe.h tdemidclient.h kdisptext.h \ + qslidertime.h klcdnumber.h ktrianglebutton.h \ + midicfgdlg.h collectdlg.h randomlist.h \ + channelview.h channel.h channel3d.h channel4d.h \ + channelcfgdlg.h instrname.h rhythmview.h \ + songlist.h slman.h tdemid_part.h + +tdemid_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdemid_SOURCES = main.cpp +tdemid_LDADD = libtdemidlib.la + +bin_PROGRAMS = tdemid +METASOURCES = AUTO + +servicetype_DATA = audiomidi.desktop +servicetypedir = $(kde_servicetypesdir) + +SUBDIRS = maps examples pics + +xdg_apps_DATA = tdemid.desktop + +mime_DATA = x-karaoke.desktop +mimedir = $(kde_mimedir)/audio + +rc_DATA = tdemidui.rc +rcdir = $(kde_datadir)/tdemid + +KDE_ICON = tdemid + +fmpatches_DATA = std.sb drums.sb std.o3 drums.o3 +fmpatchesdir = $(kde_datadir)/tdemid/fm + +partdir = $(kde_datadir)/tdemid +part_DATA = tdemid_partui.rc + +channelview_DATA = keyboard.xpm button1.xpm button2.xpm +channelviewdir = $(kde_datadir)/tdemid/icons + +EXTRA_DIST = $(xdg_apps_DATA) $(mime_DATA) $(fmpatches_DATA) $(part_DATA) + +instrname.i18n: instrname.cpp + echo "/* This is an automatically generated file" > instrname.i18n + echo " * DO NOT EDIT !!!" >> instrname.i18n + echo " * To create this file run : ""make instrname.i18n"" " >> instrname.i18n + echo " */" >> instrname.i18n + echo "" >> instrname.i18n + awk -f instrfilter.awk instrname.cpp >> instrname.i18n + + +messages: instrname.i18n rc.cpp + $(XGETTEXT) *.cpp instrname.i18n -o $(podir)/tdemid.pot diff --git a/tdemid/PEOPLE b/tdemid/PEOPLE new file mode 100644 index 00000000..4cd777c2 --- /dev/null +++ b/tdemid/PEOPLE @@ -0,0 +1,4 @@ +Please take a look at the online help for a list of people who have helped +me in the development of KMid (emotionally or with patches :-) ). + + - Antonio Larrosa diff --git a/tdemid/README b/tdemid/README new file mode 100644 index 00000000..c391c24c --- /dev/null +++ b/tdemid/README @@ -0,0 +1,123 @@ +********************************************************************** + KKK KK MMM MMM IIIIII DDDDD + KKK KK MMMMMMMMMM IIII DDDDDDD + KKKKK MMMMMMMMMM II DDD DD + Console KKKKKK MMM MM MMM IIII DDDDDDD + KKK KKK MMM MMM IIIIII DDDDD + + ConsoleKMID + + + This info is up to date if you have KMid version 1.7 + +________________________________________________ +If you are looking for a KMid README file, then this is NOT the one you are +looking for. Please look the online documentation, that is, the html help + +I've left this file only for help on the small cousin of KMid, ConsoleKMid. + + - Antonio Larrosa +------------------------------------------------ + +Index +------- + 1. What is ConsoleKMid ? + 2. Requirements of consoleKMid + 3. Compiling consoleKMid + 4. Installing + 5. Running + 6. How do I use a Midi Mapper ? + 7. Where can I download KMid and consoleKMid from ? + 8. To do list + +1. What is ConsoleKMid ? +------------------------ + ConsoleKMid is a small program for Unix in console mode, which uses the same + player engine of KMid. Of course it doesn't have the same friendly + interface of KMid but it works to play midi files. + + If you have the rpm distribution, you will not find the consoletdemid program + unless you have compiled it from the src.rpm distribution + + +2. Requirements of consoleKMid +------------------------------- + + A UNIX machine, a soundcard and a /dev/sequencer device well installed. + If you have a GUS, you need a properly installed driver from the Linux + Ultrasound Project, AWE cards are also supported, but you will probably + need to compile consoleKMid in order to get an AWE card to work. + FM devices are also supported. + I have only tested KMid in Linux, but I have had sucessful reports getting + KMid to work on FreeBSD + If you sucessfully run KMid in other unices, please tell me ! + + Currently GUS cards make a little sound when using the oss driver, but are + not supported officially, I'm looking to find people with GUS cards that + want to help me to provide such support (either programming or testing), + as I think that if nobody has worried about it it's because there's no + need for it ;-) + +3. Compiling consoleKMid +----------------- + Do a configure from the parent directory, then go to the player directory, + and do a 'make' . Simple , isn't it ? + + By default it will use the external midi device, if you want to use another + one (fm, awe, or anything else), edit the file main.cc and change the value + of DEFAULT_DEVICE to the one you want, or specify the -d option as in : + + consoletdemid -d 1 mymidifile.mid + +4. Installing +----------------- + No installing of consoleKMid is actually done, just copy the consoleKMid file + yourself to where you want (usually /usr/local/bin ). To use the fm device, + you should specify in fmout.cc the path to where the fm patches are installed + ( /etc by default) + +5. Running +-------------- + Well, it's quite easy, just type "consoletdemid" and it should run :-) + +6. How do I use a Midi Mapper ? +------------------------------- + A Midi Mapper is the feature you have been waiting for in Linux for years, + (at least I have been :-) it makes a non General Midi synth, appear to the + computer as General Midi compliant. Thus, a GM synth is emulated with a + nonGM. + Look the KMid docs for more info on creating/using a midi map. + If you want to use one with consoletdemid, you can use the -M option, + use it like this example : + + consoletdemid -M /opt/kde/share/apps/tdemid/maps/YamahaPSS790.map mymidifile + + You can also edit main.cc in the player directory and change the value of + DEFAULT_MAP to whatever you want, so that you don't need to specify the + -M option each time you run consoletdemid. + + If you want to define a new map for your midi keyboard, I recommend you to + start by copying the file yamaha790.map and modifying it. And remember to + send it to me so that it will be included in future revisions and other + people can use it ! + +7. Where can I download KMid and consoleKMid from ? +--------------------------------------------------- + + KMid's homepage is at : + http://developer.kde.org/~larrosa/tdemid.html + + From there you can download latest versions as well as know the latest + changes and improvements of KMid and consoleKMid + +8. To do list +--------------- + GUS support is nearly done (and also SoftOSS) but still need little + improvements. It should mostly work now. + Better AWE support and use Soundfonts + The KMidServer and make KMid use it. + +------- +30-4-2001 +Antonio Larrosa Jimenez +larrosa@kde.org diff --git a/tdemid/audiomidi.desktop b/tdemid/audiomidi.desktop new file mode 100644 index 00000000..420045bf --- /dev/null +++ b/tdemid/audiomidi.desktop @@ -0,0 +1,3 @@ +# This file used to define audio/x-midi, which is already defined as a mime type! +[Desktop Entry] +Hidden=true diff --git a/tdemid/button1.xpm b/tdemid/button1.xpm new file mode 100644 index 00000000..93d38a73 --- /dev/null +++ b/tdemid/button1.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * button1_xpm[] = { +"16 16 3 1", +" c None", +". c #000000000000", +"X c #FFFF00000000", +" ", +" .... ", +" ........ ", +" .......... ", +" .....XX..... ", +" ...XXXXXX... ", +" ....XXXXXX.... ", +" ...XXXXXXXX... ", +" ...XXXXXXXX... ", +" ....XXXXXX.... ", +" ...XXXXXX... ", +" .....XX..... ", +" .......... ", +" ........ ", +" .... ", +" "}; diff --git a/tdemid/button2.xpm b/tdemid/button2.xpm new file mode 100644 index 00000000..8c8922df --- /dev/null +++ b/tdemid/button2.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * button2_xpm[] = { +"16 16 3 1", +" c None", +". c #000000000000", +"X c #0000FFFF0000", +" ", +" .... ", +" ........ ", +" .......... ", +" .....XX..... ", +" ...XXXXXX... ", +" ....XXXXXX.... ", +" ...XXXXXXXX... ", +" ...XXXXXXXX... ", +" ....XXXXXX.... ", +" ...XXXXXX... ", +" .....XX..... ", +" .......... ", +" ........ ", +" .... ", +" "}; diff --git a/tdemid/channel.cpp b/tdemid/channel.cpp new file mode 100644 index 00000000..97fc5133 --- /dev/null +++ b/tdemid/channel.cpp @@ -0,0 +1,233 @@ +/************************************************************************** + + channel.cpp - The KMidChannel widget (with pure virtual members) + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include "tdemidbutton.h" + +#include "channel.h" +#include "instrname.h" +#include + +KMidChannel::KMidChannel(int chn,TQWidget *parent) : TQWidget (parent) +{ + channel=chn; + replay=TRUE; + int i; + for (i=0;i<128;i++) pressed[i]=0; + keyboard = TQPixmap(locate("appdata","icons/keyboard.xpm")); + penB = new TQPen (black); + penW = new TQPen (white); + penT = new TQPen (colorGroup().background()); + + TDEConfig *kcfg=TDEGlobal::instance()->config(); + kcfg->setGroup("KMid"); + TQFont *qtextfontdefault=new TQFont("lucida",18,TQFont::Bold,TRUE); + qcvfont=new TQFont(kcfg->readFontEntry("ChannelViewFont",qtextfontdefault)); + delete qtextfontdefault; + + instrumentCombo = new TQComboBox(FALSE,this,"instr"); + instrumentCombo->setGeometry(160,2,200,20); + + for (i=0;i<128;i++) + instrumentCombo->insertItem(i18n(instrumentName[i]),i); + + connect(instrumentCombo,TQT_SIGNAL(activated(int)),this,TQT_SLOT(pgmChanged(int))); + + forcepgm=new KMidButton(this,"forcepgm"); + forcepgm->setGeometry(135,4,16,16); + forcepgm->setToggleButton(TRUE); + button1 = TQPixmap(locate("appdata","icons/button1.xpm")); + button2 = TQPixmap(locate("appdata","icons/button2.xpm")); + forcepgm->setPixmaps(button1,button2); + forcepgm->show(); + connect(forcepgm,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(changeForcedState(bool))); + +} + +KMidChannel::~KMidChannel() +{ + delete penB; + delete penW; + delete penT; +} + +void KMidChannel::paintEvent( TQPaintEvent * ) +{ + + TQPainter *qpaint=new TQPainter(this); + + TQString tmp = i18n("Channel %1").arg(channel); + qpaint->setFont(*qcvfont); + qpaint->setPen(*penB); + qpaint->drawText(2,20,tmp); + qpaint->setPen(*penW); + qpaint->drawText(0,18,tmp); + + drawKeyboard(qpaint); + drawPressedKeys(qpaint); + + delete qpaint; +} + +void KMidChannel::drawKeyboard(TQPainter *qpaint) +{ + int x=1; + for (int i=0;(i<12) && (xdrawPixmap(x,KEYBOARDY,keyboard); + }; + qpaint->setPen(*penB); + qpaint->drawLine(0,KEYBOARDY,0,KEYBOARDY+44); + + qpaint->setPen(*penT); + qpaint->drawLine(0,KEYBOARDY+45,x+63,KEYBOARDY+45); + + +} + +void KMidChannel::drawPressedKeys(TQPainter *qpaint) +{ + for (int i=0;i<128;i++) + if (pressed[i]) drawKey(qpaint,i); +} + +void KMidChannel::drawKey(TQPainter *qpaint,int key) +{ + int octave=key/12; + int note=key%12; + int x=octave*63+1; + + switch (note) + { + case (0) : drawDo (qpaint,x,pressed[key]);break; + case (1) : drawDo__ (qpaint,x,pressed[key]);break; + case (2) : drawRe (qpaint,x,pressed[key]);break; + case (3) : drawRe__ (qpaint,x,pressed[key]);break; + case (4) : drawMi (qpaint,x,pressed[key]);break; + case (5) : drawFa (qpaint,x,pressed[key]);break; + case (6) : drawFa__ (qpaint,x,pressed[key]);break; + case (7) : drawSol (qpaint,x,pressed[key]);break; + case (8) : drawSol__(qpaint,x,pressed[key]);break; + case (9) : drawLa (qpaint,x,pressed[key]);break; + case (10) : drawLa__ (qpaint,x,pressed[key]);break; + case (11) : drawSi (qpaint,x,pressed[key]);break; + }; +// qpaint->flush(); +} + +void KMidChannel::noteOn(int key) +{ + pressed[key]=1; + TQPainter *qpaint=new TQPainter(this); + drawKey(qpaint,key); + delete qpaint; +} + +void KMidChannel::noteOff(int key) +{ + pressed[key]=0; + TQPainter *qpaint=new TQPainter(this); + drawKey(qpaint,key); + delete qpaint; +} + +void KMidChannel::changeInstrument(int pgm) +{ + instrumentCombo->setCurrentItem(pgm); +} + +void KMidChannel::changeForceState(bool i) +{ + replay=FALSE; + forcepgm->setOn(i); + replay=TRUE; +} + +void KMidChannel::reset(int level) +{ + for (int i=0;i<128;i++) pressed[i]=0; + if (level>=1) + { + instrumentCombo->setCurrentItem(0); + replay=FALSE; + forcepgm->setOn(FALSE); + replay=TRUE; + }; + + repaint(FALSE); +} + +void KMidChannel::saveState(bool *p,int *pgm) +{ + for (int i=0;i<128;i++) p[i]=pressed[i]; + *pgm=instrumentCombo->currentItem(); +} + +void KMidChannel::loadState(bool *p,int *pgm) +{ + for (int i=0;i<128;i++) pressed[i]=p[i]; + instrumentCombo->setCurrentItem(*pgm); + repaint(FALSE); +} + +void KMidChannel::pgmChanged(int i) +{ + int data[4]; + data[0]=CHN_CHANGE_PGM; + data[1]=channel; + data[2]=i; + data[3]=0; + + replay=FALSE; + forcepgm->setOn(TRUE); + replay=TRUE; + + emit signalToKMidClient(data); + + +} + + +void KMidChannel::changeForcedState(bool i) +{ + int data[4]; + data[0]=CHN_CHANGE_FORCED_STATE; + data[1]=channel; + data[2]=i; + data[3]=(replay)? 1 : 0; + + emit signalToKMidClient(data); + +} +#include "channel.moc" diff --git a/tdemid/channel.h b/tdemid/channel.h new file mode 100644 index 00000000..4f88ae36 --- /dev/null +++ b/tdemid/channel.h @@ -0,0 +1,105 @@ +/************************************************************************** + + channel.h - The KMidChannel widget (with pure virtual members) + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#ifndef KMIDCHANNEL_H +#define KMIDCHANNEL_H +#include +#include + +#define CHANNELHEIGHT 71 +#define KEYBOARDY CHANNELHEIGHT-46 + +#define CHN_CHANGE_PGM 1 +#define CHN_CHANGE_FORCED_STATE 2 + +class TQFont; +class TQComboBox; +class KMidButton; +class KMidChannel : public TQWidget +{ + Q_OBJECT + + +private: + bool pressed[128]; // The 128 keys + int channel; + bool replay; // Indicates if music should restart playing after + // changing the force state + +protected: + TQPixmap keyboard; + TQPixmap button1; + TQPixmap button2; + + TQComboBox *instrumentCombo; + + KMidButton *forcepgm; + TQFont *qcvfont; + + TQPen *penB; // Black + TQPen *penW; // White + TQPen *penT; // "Transparent" for Background + + void paintEvent( TQPaintEvent * ); +public: + KMidChannel(int i,TQWidget *Parent); + virtual ~KMidChannel(); + + void drawKeyboard(TQPainter *qpaint); + void drawPressedKeys(TQPainter *qpaint); + void drawKey(TQPainter *qpaint,int key); + + virtual void drawDo (TQPainter *qpaint,int x,int p) = 0; + virtual void drawDo__ (TQPainter *qpaint,int x,int p) = 0; + virtual void drawRe (TQPainter *qpaint,int x,int p) = 0; + virtual void drawRe__ (TQPainter *qpaint,int x,int p) = 0; + virtual void drawMi (TQPainter *qpaint,int x,int p) = 0; + virtual void drawFa (TQPainter *qpaint,int x,int p) = 0; + virtual void drawFa__ (TQPainter *qpaint,int x,int p) = 0; + virtual void drawSol (TQPainter *qpaint,int x,int p) = 0; + virtual void drawSol__(TQPainter *qpaint,int x,int p) = 0; + virtual void drawLa (TQPainter *qpaint,int x,int p) = 0; + virtual void drawLa__ (TQPainter *qpaint,int x,int p) = 0; + virtual void drawSi (TQPainter *qpaint,int x,int p) = 0; + + void noteOn(int key); + void noteOff(int key); + void changeInstrument(int pgm); + void changeForceState(bool i); + + void reset(int level=1); // 0 only release notes, 1 also set instr to 0 ... + + void saveState(bool *p,int *pgm); + void loadState(bool *p,int *pgm); + +public slots: + void pgmChanged(int i); + void changeForcedState(bool); + +signals: + void signalToKMidClient(int *data); + +}; + +#endif diff --git a/tdemid/channel3d.cpp b/tdemid/channel3d.cpp new file mode 100644 index 00000000..d3bef7fd --- /dev/null +++ b/tdemid/channel3d.cpp @@ -0,0 +1,149 @@ +/************************************************************************** + + channel3d.cpp - KMidChannel3D widget, a Channel widget with 3D look + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#include "channel3d.h" +#include + +KMidChannel3D::KMidChannel3D (int chn,TQWidget *parent) : KMidChannel(chn,parent) +{ +} + +void KMidChannel3D::drawDo(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x,KEYBOARDY+43,x+6,KEYBOARDY+43); + qpaint->drawLine(x,KEYBOARDY+44,x+6,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x-1,KEYBOARDY+45,x+8,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+7,KEYBOARDY+28,x+7,KEYBOARDY+42); +} +void KMidChannel3D::drawDo__(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+6,KEYBOARDY+2,x+6,KEYBOARDY+25); + qpaint->drawLine(x+7,KEYBOARDY+25,x+11,KEYBOARDY+25); + + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+11,KEYBOARDY+1,x+11,KEYBOARDY+27); + qpaint->drawPoint(x+10,KEYBOARDY+27); + +} +void KMidChannel3D::drawRe(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+9,KEYBOARDY+43,x+15,KEYBOARDY+43); + qpaint->drawLine(x+9,KEYBOARDY+44,x+15,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+8,KEYBOARDY+45,x+17,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+16,KEYBOARDY+28,x+16,KEYBOARDY+42); +} +void KMidChannel3D::drawRe__(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+15,KEYBOARDY+2,x+15,KEYBOARDY+25); + qpaint->drawLine(x+16,KEYBOARDY+25,x+20,KEYBOARDY+25); + + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+20,KEYBOARDY+1,x+20,KEYBOARDY+27); + qpaint->drawPoint(x+19,KEYBOARDY+27); +} +void KMidChannel3D::drawMi(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+18,KEYBOARDY+43,x+24,KEYBOARDY+43); + qpaint->drawLine(x+18,KEYBOARDY+44,x+24,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+17,KEYBOARDY+45,x+26,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+25,KEYBOARDY+1,x+25,KEYBOARDY+42); +} +void KMidChannel3D::drawFa(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+27,KEYBOARDY+43,x+33,KEYBOARDY+43); + qpaint->drawLine(x+27,KEYBOARDY+44,x+33,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+26,KEYBOARDY+45,x+35,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+34,KEYBOARDY+28,x+34,KEYBOARDY+42); +} +void KMidChannel3D::drawFa__(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+33,KEYBOARDY+2,x+33,KEYBOARDY+25); + qpaint->drawLine(x+34,KEYBOARDY+25,x+38,KEYBOARDY+25); + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+38,KEYBOARDY+1,x+38,KEYBOARDY+27); + qpaint->drawPoint(x+37,KEYBOARDY+27); +} +void KMidChannel3D::drawSol(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+36,KEYBOARDY+43,x+42,KEYBOARDY+43); + qpaint->drawLine(x+36,KEYBOARDY+44,x+42,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+35,KEYBOARDY+45,x+44,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+43,KEYBOARDY+28,x+43,KEYBOARDY+42); +} +void KMidChannel3D::drawSol__(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+42,KEYBOARDY+2,x+42,KEYBOARDY+25); + qpaint->drawLine(x+43,KEYBOARDY+25,x+47,KEYBOARDY+25); + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+47,KEYBOARDY+1,x+47,KEYBOARDY+27); + qpaint->drawPoint(x+46,KEYBOARDY+27); +} +void KMidChannel3D::drawLa(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+45,KEYBOARDY+43,x+51,KEYBOARDY+43); + qpaint->drawLine(x+45,KEYBOARDY+44,x+51,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+44,KEYBOARDY+45,x+53,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+52,KEYBOARDY+28,x+52,KEYBOARDY+42); +} +void KMidChannel3D::drawLa__(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+51,KEYBOARDY+2,x+51,KEYBOARDY+25); + qpaint->drawLine(x+52,KEYBOARDY+25,x+56,KEYBOARDY+25); + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+56,KEYBOARDY+1,x+56,KEYBOARDY+27); + qpaint->drawPoint(x+55,KEYBOARDY+27); +} +void KMidChannel3D::drawSi(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+54,KEYBOARDY+43,x+60,KEYBOARDY+43); + qpaint->drawLine(x+54,KEYBOARDY+44,x+60,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+53,KEYBOARDY+45,x+62,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+61,KEYBOARDY+1,x+61,KEYBOARDY+42); +} diff --git a/tdemid/channel3d.h b/tdemid/channel3d.h new file mode 100644 index 00000000..a8c81da0 --- /dev/null +++ b/tdemid/channel3d.h @@ -0,0 +1,52 @@ +/************************************************************************** + + channel3d.h - KMidChannel3D widget, a Channel widget with 3D look + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#ifndef KMIDCHANNEL3D_H +#define KMIDCHANNEL3D_H + +#include "channel.h" + +class KMidChannel3D : public KMidChannel +{ +public: + KMidChannel3D(int chn,TQWidget *parent); + + + virtual void drawDo (TQPainter *qpaint,int x,int p); + virtual void drawDo__ (TQPainter *qpaint,int x,int p); + virtual void drawRe (TQPainter *qpaint,int x,int p); + virtual void drawRe__ (TQPainter *qpaint,int x,int p); + virtual void drawMi (TQPainter *qpaint,int x,int p); + virtual void drawFa (TQPainter *qpaint,int x,int p); + virtual void drawFa__ (TQPainter *qpaint,int x,int p); + virtual void drawSol (TQPainter *qpaint,int x,int p); + virtual void drawSol__(TQPainter *qpaint,int x,int p); + virtual void drawLa (TQPainter *qpaint,int x,int p); + virtual void drawLa__ (TQPainter *qpaint,int x,int p); + virtual void drawSi (TQPainter *qpaint,int x,int p); + + +}; + +#endif diff --git a/tdemid/channel4d.cpp b/tdemid/channel4d.cpp new file mode 100644 index 00000000..4f47c3ae --- /dev/null +++ b/tdemid/channel4d.cpp @@ -0,0 +1,232 @@ +/************************************************************************** + + channel4d.cpp - KMidChannel4D widget, with 3D look and filled + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#include "channel4d.h" +#include + +KMidChannel4D::KMidChannel4D (int chn,TQWidget *parent) : KMidChannel(chn,parent) +{ + brushR = new TQBrush (red); + brushW = new TQBrush (white); + brushB = new TQBrush (black); + penR = new TQPen (red); +} + + +void KMidChannel4D::drawDo(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penR):(*penB)); + + qpaint->drawLine(x,KEYBOARDY+43,x+6,KEYBOARDY+43); + qpaint->drawLine(x,KEYBOARDY+44,x+6,KEYBOARDY+44); + + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x-1,KEYBOARDY+45,x+8,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+7,KEYBOARDY+28,x+7,KEYBOARDY+42); + + qpaint->fillRect(x,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); + qpaint->fillRect(x,KEYBOARDY+1,5,27,((p)?*brushR:*brushW)); + qpaint->setPen(p?(*penR):(*penW)); + qpaint->drawPoint(x+5,KEYBOARDY+27); +} +void KMidChannel4D::drawDo__(TQPainter *qpaint,int x,int p) +{ + qpaint->fillRect(x+6,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); + + if (!p) + { + qpaint->setPen(*penW); + qpaint->drawLine(x+6,KEYBOARDY+2,x+6,KEYBOARDY+25); + qpaint->drawLine(x+7,KEYBOARDY+25,x+11,KEYBOARDY+25); + }; + + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+11,KEYBOARDY+1,x+11,KEYBOARDY+27); + qpaint->drawPoint(x+10,KEYBOARDY+27); + + +} +void KMidChannel4D::drawRe(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penR):(*penB)); + qpaint->drawLine(x+9,KEYBOARDY+43,x+15,KEYBOARDY+43); + qpaint->drawLine(x+9,KEYBOARDY+44,x+15,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+8,KEYBOARDY+45,x+17,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+16,KEYBOARDY+28,x+16,KEYBOARDY+42); + + qpaint->fillRect(x+9,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); + qpaint->fillRect(x+12,KEYBOARDY+1,2,27,((p)?*brushR:*brushW)); + qpaint->setPen(p?(*penR):(*penW)); + qpaint->drawPoint(x+11,KEYBOARDY+27); + qpaint->drawPoint(x+14,KEYBOARDY+27); + +} + +void KMidChannel4D::drawRe__(TQPainter *qpaint,int x,int p) +{ + qpaint->fillRect(x+15,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); + + if (!p) + { + qpaint->setPen(*penW); + qpaint->drawLine(x+15,KEYBOARDY+2,x+15,KEYBOARDY+25); + qpaint->drawLine(x+16,KEYBOARDY+25,x+20,KEYBOARDY+25); + }; + + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+20,KEYBOARDY+1,x+20,KEYBOARDY+27); + qpaint->drawPoint(x+19,KEYBOARDY+27); + + +} +void KMidChannel4D::drawMi(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penR):(*penB)); + qpaint->drawLine(x+18,KEYBOARDY+43,x+24,KEYBOARDY+43); + qpaint->drawLine(x+18,KEYBOARDY+44,x+24,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+17,KEYBOARDY+45,x+26,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+25,KEYBOARDY+1,x+25,KEYBOARDY+42); + + qpaint->fillRect(x+18,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); + qpaint->fillRect(x+21,KEYBOARDY+1,4,27,((p)?*brushR:*brushW)); + qpaint->setPen(p?(*penR):(*penW)); + qpaint->drawPoint(x+20,KEYBOARDY+27); + +} +void KMidChannel4D::drawFa(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penR):(*penB)); + qpaint->drawLine(x+27,KEYBOARDY+43,x+33,KEYBOARDY+43); + qpaint->drawLine(x+27,KEYBOARDY+44,x+33,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+26,KEYBOARDY+45,x+35,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+34,KEYBOARDY+28,x+34,KEYBOARDY+42); + + qpaint->fillRect(x+27,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); + qpaint->fillRect(x+27,KEYBOARDY+1,5,27,((p)?*brushR:*brushW)); + qpaint->setPen(p?(*penR):(*penW)); + qpaint->drawPoint(x+32,KEYBOARDY+27); + +} +void KMidChannel4D::drawFa__(TQPainter *qpaint,int x,int p) +{ + qpaint->fillRect(x+33,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); + if (!p) + { + qpaint->setPen(*penW); + qpaint->drawLine(x+33,KEYBOARDY+2,x+33,KEYBOARDY+25); + qpaint->drawLine(x+34,KEYBOARDY+25,x+38,KEYBOARDY+25); + }; + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+38,KEYBOARDY+1,x+38,KEYBOARDY+27); + qpaint->drawPoint(x+37,KEYBOARDY+27); + +} + +void KMidChannel4D::drawSol(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penR):(*penB)); + qpaint->drawLine(x+36,KEYBOARDY+43,x+42,KEYBOARDY+43); + qpaint->drawLine(x+36,KEYBOARDY+44,x+42,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+35,KEYBOARDY+45,x+44,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+43,KEYBOARDY+28,x+43,KEYBOARDY+42); + + qpaint->fillRect(x+36,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); + qpaint->fillRect(x+39,KEYBOARDY+1,2,27,((p)?*brushR:*brushW)); + qpaint->setPen(p?(*penR):(*penW)); + qpaint->drawPoint(x+38,KEYBOARDY+27); + qpaint->drawPoint(x+41,KEYBOARDY+27); + +} + +void KMidChannel4D::drawSol__(TQPainter *qpaint,int x,int p) +{ + qpaint->fillRect(x+42,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); + + if (!p) + { + qpaint->setPen(*penW); + qpaint->drawLine(x+42,KEYBOARDY+2,x+42,KEYBOARDY+25); + qpaint->drawLine(x+43,KEYBOARDY+25,x+47,KEYBOARDY+25); + }; + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+47,KEYBOARDY+1,x+47,KEYBOARDY+27); + qpaint->drawPoint(x+46,KEYBOARDY+27); + + +} +void KMidChannel4D::drawLa(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penR):(*penB)); + qpaint->drawLine(x+45,KEYBOARDY+43,x+51,KEYBOARDY+43); + qpaint->drawLine(x+45,KEYBOARDY+44,x+51,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+44,KEYBOARDY+45,x+53,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+52,KEYBOARDY+28,x+52,KEYBOARDY+42); + + qpaint->fillRect(x+45,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); + qpaint->fillRect(x+48,KEYBOARDY+1,2,27,((p)?*brushR:*brushW)); + qpaint->setPen(p?(*penR):(*penW)); + qpaint->drawPoint(x+47,KEYBOARDY+27); + qpaint->drawPoint(x+50,KEYBOARDY+27); +} +void KMidChannel4D::drawLa__(TQPainter *qpaint,int x,int p) +{ + qpaint->fillRect(x+51,KEYBOARDY+1,5,26,((p)?*brushR:*brushB)); + + if (!p) + { + qpaint->setPen(*penW); + qpaint->drawLine(x+51,KEYBOARDY+2,x+51,KEYBOARDY+25); + qpaint->drawLine(x+52,KEYBOARDY+25,x+56,KEYBOARDY+25); + }; + qpaint->setPen(p?(*penW):(*penB)); + qpaint->drawLine(x+56,KEYBOARDY+1,x+56,KEYBOARDY+27); + qpaint->drawPoint(x+55,KEYBOARDY+27); + +} +void KMidChannel4D::drawSi(TQPainter *qpaint,int x,int p) +{ + qpaint->setPen(p?(*penR):(*penB)); + qpaint->drawLine(x+54,KEYBOARDY+43,x+60,KEYBOARDY+43); + qpaint->drawLine(x+54,KEYBOARDY+44,x+60,KEYBOARDY+44); + qpaint->setPen(p?(*penB):(*penT)); + qpaint->drawLine(x+53,KEYBOARDY+45,x+62,KEYBOARDY+45); + qpaint->setPen(p?(*penB):(*penW)); + qpaint->drawLine(x+61,KEYBOARDY+1,x+61,KEYBOARDY+42); + + qpaint->fillRect(x+54,KEYBOARDY+28,7,15,((p)?*brushR:*brushW)); + qpaint->fillRect(x+57,KEYBOARDY+1,4,27,((p)?*brushR:*brushW)); + qpaint->setPen(p?(*penR):(*penW)); + qpaint->drawPoint(x+56,KEYBOARDY+27); +} diff --git a/tdemid/channel4d.h b/tdemid/channel4d.h new file mode 100644 index 00000000..e6326f4a --- /dev/null +++ b/tdemid/channel4d.h @@ -0,0 +1,58 @@ +/************************************************************************** + + channel4d.h - KMidChannel4D widget, with 3D look and filled + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#ifndef KMIDCHANNEL4D_H +#define KMIDCHANNEL4D_H + +#include "channel.h" + +class KMidChannel4D : public KMidChannel +{ +private: + TQBrush *brushR; + TQBrush *brushW; + TQBrush *brushB; + TQPen *penR; + +public: + KMidChannel4D(int chn,TQWidget *parent); + + + virtual void drawDo (TQPainter *qpaint,int x,int p); + virtual void drawDo__ (TQPainter *qpaint,int x,int p); + virtual void drawRe (TQPainter *qpaint,int x,int p); + virtual void drawRe__ (TQPainter *qpaint,int x,int p); + virtual void drawMi (TQPainter *qpaint,int x,int p); + virtual void drawFa (TQPainter *qpaint,int x,int p); + virtual void drawFa__ (TQPainter *qpaint,int x,int p); + virtual void drawSol (TQPainter *qpaint,int x,int p); + virtual void drawSol__(TQPainter *qpaint,int x,int p); + virtual void drawLa (TQPainter *qpaint,int x,int p); + virtual void drawLa__ (TQPainter *qpaint,int x,int p); + virtual void drawSi (TQPainter *qpaint,int x,int p); + + +}; + +#endif diff --git a/tdemid/channelcfgdlg.cpp b/tdemid/channelcfgdlg.cpp new file mode 100644 index 00000000..db320a28 --- /dev/null +++ b/tdemid/channelcfgdlg.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include + +#include +#include + +#include "channelview.h" +#include "channelcfgdlg.h" +#include "version.h" +#include +#include + +ChannelViewConfigDialog::ChannelViewConfigDialog(TQWidget *parent,const char *name) : KDialogBase(parent,name,TRUE,i18n("Configure Channel View"),Ok|Cancel, Ok) +{ + TQWidget *page = new TQWidget( this ); + setMainWidget(page); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); + qbg = new TQVButtonGroup(i18n("Choose Look Mode"),page,"qbg"); + + rb0=new TQRadioButton(i18n("3D look"),qbg,"3d"); + rb1=new TQRadioButton(i18n("3D - filled"),qbg,"4d"); + + qbg->setExclusive(TRUE); + + topLayout->addWidget( qbg ); + ((ChannelView::lookMode()==0)?rb0:rb1)->setChecked(TRUE); + + connect (qbg, TQT_SIGNAL(pressed(int)),this,TQT_SLOT(modeselected(int))); +} + +void ChannelViewConfigDialog::modeselected(int idx) +{ +selectedmode=idx; +} + +int ChannelViewConfigDialog::selectedmode; +#include "channelcfgdlg.moc" diff --git a/tdemid/channelcfgdlg.h b/tdemid/channelcfgdlg.h new file mode 100644 index 00000000..c4378e4e --- /dev/null +++ b/tdemid/channelcfgdlg.h @@ -0,0 +1,52 @@ +/************************************************************************** + + channelcfgdlg.h - The channel view config dialog + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _channelcfgdlg_h_ +#define _channelcfgdlg_h_ + +#include + +class TQVButtonGroup; +class TQRadioButton; +class ChannelViewConfigDialog : public KDialogBase +{ + Q_OBJECT + + +public: + + ChannelViewConfigDialog(TQWidget *parent,const char *name); + +private: + TQVButtonGroup *qbg; + TQRadioButton *rb0; + TQRadioButton *rb1; + +public slots: + void modeselected(int idx); + +public: + static int selectedmode; +}; + +#endif diff --git a/tdemid/channelview.cpp b/tdemid/channelview.cpp new file mode 100644 index 00000000..bf1ebf55 --- /dev/null +++ b/tdemid/channelview.cpp @@ -0,0 +1,165 @@ +/************************************************************************** + + channelview.cpp - The ChannelView dialog + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#include +#include + +#include "channelview.h" +#include "channel3d.h" +#include "channel4d.h" +#include + + +ChannelView::ChannelView(void) : KMainWindow(0, "ChannelView") +{ + setCaption(i18n("Channel View")); + for (int i=0;i<16;i++) + { + if (lookMode()==0) + Channel[i]=new KMidChannel3D(i+1,this); + else + Channel[i]=new KMidChannel4D(i+1,this); + connect(Channel[i],TQT_SIGNAL(signalToKMidClient(int *)),this,TQT_SLOT(slottotdemidclient(int *))); + Channel[i]->setGeometry(5,5+i*CHANNELHEIGHT,width()-20,CHANNELHEIGHT); + Channel[i]->show(); + } + scrollbar=new TQScrollBar(1,16,1,1,1,Qt::Vertical,this,"Channelscrollbar"); + connect(scrollbar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(ScrollChn(int))); + setScrollBarRange(); +} + +ChannelView::~ChannelView() +{ + +} + +void ChannelView::closeEvent(TQCloseEvent *e) +{ + emit destroyMe(); + e->accept(); +} + +void ChannelView::resizeEvent(TQResizeEvent *) +{ + scrollbar->setGeometry(width()-16,0,16,height()); + for (int i=0;i<16;i++) + { + Channel[i]->setGeometry(5,5+(i-(scrollbar->value()-1))*CHANNELHEIGHT,width()-20,CHANNELHEIGHT); + } + setScrollBarRange(); + +} + +void ChannelView::setScrollBarRange(void) +{ + nvisiblechannels=height()/CHANNELHEIGHT; + if (nvisiblechannels<16) + scrollbar->setRange(1,16-nvisiblechannels+1); + else + scrollbar->setRange(1,1); +} + +void ChannelView::ScrollChn(int v) +{ + for (int i=0;i<16;i++) + { + Channel[i]->move(5,5+(i-(v-1))*CHANNELHEIGHT); + } +} + +void ChannelView::noteOn(int chn,int note) +{ + Channel[chn]->noteOn(note); +} + +void ChannelView::noteOff(int chn,int note) +{ + Channel[chn]->noteOff(note); +} + +void ChannelView::changeInstrument(int chn,int pgm) +{ + Channel[chn]->changeInstrument(pgm); +} + +void ChannelView::changeForceState(int chn,bool i) +{ + Channel[chn]->changeForceState(i); +} + + +void ChannelView::reset(int level) +{ + for (int i=0;i<16;i++) + { + Channel[i]->reset(level); + } +} + +int ChannelView::lookmode=0; + +int ChannelView::lookMode(void) +{ + TDEConfig *kcfg=(TDEApplication::kApplication())->config(); + + kcfg->setGroup("KMid"); + lookmode=kcfg->readNumEntry("ChannelViewLookMode",0); + + return lookmode; +} + +void ChannelView::lookMode(int i) +{ + TDEConfig *kcfg=(TDEApplication::kApplication())->config(); + + lookmode=i; + + kcfg->setGroup("KMid"); + kcfg->writeEntry("ChannelViewLookMode",lookmode); + + bool tmp[128]; + int pgm; + for (int i=0;i<16;i++) + { + Channel[i]->saveState(tmp,&pgm); + delete Channel[i]; + + if (lookmode==0) + Channel[i]=new KMidChannel3D(i+1,this); + else + Channel[i]=new KMidChannel4D(i+1,this); + + connect(Channel[i],TQT_SIGNAL(signalToKMidClient(int *)),this,TQT_SLOT(slottotdemidclient(int *))); + Channel[i]->setGeometry(5,5+(i-(scrollbar->value()-1))*CHANNELHEIGHT,width()-20,CHANNELHEIGHT); + Channel[i]->loadState(tmp,&pgm); + Channel[i]->show(); + } + +} + +void ChannelView::slottotdemidclient(int *data) +{ + emit signalToKMidClient(data); +} +#include "channelview.moc" diff --git a/tdemid/channelview.h b/tdemid/channelview.h new file mode 100644 index 00000000..9ef7301e --- /dev/null +++ b/tdemid/channelview.h @@ -0,0 +1,77 @@ +/************************************************************************** + + channelview.h - The ChannelView dialog + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#ifndef CHANNELVIEW_H +#define CHANNELVIEW_H + +#include +#include +#include "channel.h" + + +class ChannelView : public KMainWindow +{ + Q_OBJECT + +private: + KMidChannel *Channel[16]; + int nvisiblechannels; + + virtual void resizeEvent(TQResizeEvent *); + virtual void closeEvent(TQCloseEvent *e); + +public: + ChannelView(void); + virtual ~ChannelView(); + + void setScrollBarRange(void); + + void noteOn(int chn,int note); + void noteOff(int chn,int note); + void changeInstrument(int chn,int pgm); + void changeForceState(int chn,bool i); + + void reset(int level=1); + + static int lookMode(void); + + void lookMode(int i); + +public slots: + void ScrollChn(int i); + void slottotdemidclient(int *data); + +signals: + void destroyMe(); + void signalToKMidClient(int *data); + +private: + TQScrollBar *scrollbar; + + + static int lookmode; + + +}; +#endif diff --git a/tdemid/collectdlg.cpp b/tdemid/collectdlg.cpp new file mode 100644 index 00000000..20ac8def --- /dev/null +++ b/tdemid/collectdlg.cpp @@ -0,0 +1,307 @@ +/************************************************************************** + + collectdlg.cpp - The collections manager dialog + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "collectdlg.h" +#include "version.h" +#include "songlist.h" +#include "slman.h" + +CollectionDialog::CollectionDialog(SLManager *slm,int selC,TQWidget *parent,const char *name) : TQDialog(parent,name,TRUE) +{ +setCaption(i18n("Collections Manager")); +ok=new KPushButton(KStdGuiItem::ok(),this); +ok->setGeometry(140,200,100,30); +connect(ok,TQT_SIGNAL(clicked()),TQT_SLOT(accept()) ); +cancel=new KPushButton(KStdGuiItem::cancel(),this); +cancel->setGeometry(250,200,100,30); +connect(cancel,TQT_SIGNAL(clicked()),TQT_SLOT(reject()) ); + +label=new TQLabel(i18n("Available collections:"),this); +label->adjustSize(); +label->move(10,10); +collections=new TQListBox(this,"collectionlist"); +collections->setGeometry(10,20+label->height(),340,90); +connect(collections,TQT_SIGNAL(highlighted(int)),TQT_SLOT(collectionselected(int))); +connect(collections,TQT_SIGNAL(selected(int)),TQT_SLOT(changeCollectionName(int))); +slman=slm; +for (int i=0;i<=slman->numberOfCollections();i++) + { + collections->insertItem(i18n( slman->getCollectionName(i) ),i); +#ifdef COLLECTDLGDEBUG + printf("Name : %s\n",slman->getCollectionName(i)); +#endif + }; +selectedC=selC; +#ifdef COLLECTDLGDEBUG +printf("selectedC : %d\n",selectedC); +#endif + +label2=new TQLabel(i18n("Songs in selected collection:"),this); +label2->adjustSize(); +label2->move(10,collections->y()+collections->height()+10); + +songs=new TQListBox(this,"songlist"); +songs->setGeometry(10,label2->y()+label2->height()+10,340,120); +connect(songs,TQT_SIGNAL(highlighted(int)),TQT_SLOT(songselected(int))); +currentsl=slman->getCollection(selectedC); +if (slman->numberOfCollections()>0) + { + collections->setCurrentItem(selectedC); + collections->centerCurrentItem(); + }; +//fillInSongList(); +newC=new TQPushButton(i18n("&New..."),this); +newC->adjustSize(); +newC->move(360,collections->y()+5); +connect(newC,TQT_SIGNAL(clicked()),TQT_SLOT(newCollection()) ); +copyC=new TQPushButton(i18n("&Copy..."),this); +copyC->adjustSize(); +copyC->move(360,newC->y()+newC->height()+5); +connect(copyC,TQT_SIGNAL(clicked()),TQT_SLOT(copyCollection()) ); +deleteC=new TQPushButton(i18n("Delete"),this); +deleteC->adjustSize(); +deleteC->move(360,copyC->y()+copyC->height()+5); +connect(deleteC,TQT_SIGNAL(clicked()),TQT_SLOT(deleteCollection()) ); + +addS=new TQPushButton(i18n("&Add..."),this); +addS->adjustSize(); +addS->move(360,songs->y()+5); +connect(addS,TQT_SIGNAL(clicked()),TQT_SLOT(addSong()) ); +delS=new TQPushButton(i18n("&Remove"),this); +delS->adjustSize(); +delS->move(360,addS->y()+addS->height()+5); +connect(delS,TQT_SIGNAL(clicked()),TQT_SLOT(removeSong()) ); + +ok->move(ok->x(),songs->y()+songs->height()+10); +cancel->move(ok->x()+ok->width()+5,ok->y()); + +setMinimumSize(400,ok->y()+ok->height()+5); +//setMaximumSize(360,240); +} + +void CollectionDialog::collectionselected(int idx) +{ +selectedC=idx; +#ifdef COLLECTDLGDEBUG +printf("Selected collection: %d\n",selectedC); +#endif +currentsl=slman->getCollection(selectedC); +fillInSongList(); +} + +void CollectionDialog::fillInSongList(void) +{ +TQString qs; +songs->clear(); +if (currentsl!=NULL) + { + currentsl->iteratorStart(); + int i=0; + while (!currentsl->iteratorAtEnd()) + { + qs=TQString(currentsl->getIteratorName()); + //KURL::decode(qs); + songs->insertItem(qs,i); + currentsl->iteratorNext(); + i++; + }; + songs->setCurrentItem(currentsl->getActiveSongID()-1); + songs->centerCurrentItem(); + }; +} + +void CollectionDialog::songselected(int idx) +{ +selectedS=idx; +currentsl->setActiveSong(idx+1); + +#ifdef COLLECTDLGDEBUG +printf("Selected song: %d\n",selectedS); +#endif +} + +void CollectionDialog::newCollection() +{ + bool ok; + TQString name = KInputDialog::getText( i18n( "New Collection" ), + i18n( "Enter the name of the new collection:" ), TQString(), + &ok, this ); + + if (ok) + { + int i=slman->createCollection(name.ascii()); + if (i==-1) + { + TQString s = i18n("The name '%1' is already used").arg(name); + KMessageBox::sorry(this, s); + } + else + { + collections->insertItem(name,i); + collections->setCurrentItem(i); + collections->centerCurrentItem(); + }; + }; +} + +void CollectionDialog::copyCollection() +{ +SongList *src=currentsl; +int i; + bool ok; + TQString name = KInputDialog::getText( i18n( "Copy Collection" ), + i18n( "Enter the name of the copy collection:" ), TQString(), + &ok, this ); + + if (ok) + { + i=slman->createCollection(name.ascii()); + if (i==-1) + { + TQString s = i18n("The name '%1' is already used").arg(name); + KMessageBox::sorry(this, s); + } + else + { + collections->insertItem(name,i); + SongList *tgt=slman->getCollection(i); + src->iteratorStart(); + while (!src->iteratorAtEnd()) + { + tgt->AddSong(src->getIteratorName()); + src->iteratorNext(); + }; + collections->setCurrentItem(i); + collections->centerCurrentItem(); + }; + }; +} + +void CollectionDialog::deleteCollection() +{ +if (selectedC==0) return; +slman->deleteCollection(selectedC); +int i=selectedC; +collections->removeItem(selectedC); +collections->setCurrentItem(i); +collections->centerCurrentItem(); +} + +void CollectionDialog::changeCollectionName(int idx) +{ +if (idx==0) return; + bool ok; + + TQString name = KInputDialog::getText( i18n( "Change Collection Name" ), + i18n( "Enter the name of the selected collection:" ), TQString(), + &ok, this ); + + if (ok) + { + if (slman->getCollection(name.ascii())!=NULL) + { + TQString s = i18n("The name '%1' is already used").arg(name); + KMessageBox::sorry(this, s); + } + else + { + slman->changeCollectionName(idx,name.ascii()); + collections->changeItem(name,idx); + }; + }; +} + +void CollectionDialog::addSong(const KURL &url) +{ + if (currentsl==NULL) return; + if( url.isEmpty()) return; + + int id=currentsl->AddSong(TQFile::encodeName(url.path())); + + if (id==-1) + { + printf("Couldn't add song to collection\n"); + return; + }; + + songs->insertItem(url.fileName(),id-1); +} + + +void CollectionDialog::addSong() +{ + KURL::List urls = KFileDialog::getOpenURLs(":MidiFiles", + "*.kar *.mid *.kar.gz *.mid.gz\n*.kar *.kar.gz\n*.mid *.mid.gz\n*",this); + + KURL::List::Iterator it; + for( it = urls.begin(); it != urls.end(); ++it ) + addSong(*it); + +} + +void CollectionDialog::removeSong() +{ +if (currentsl==NULL) return; +currentsl->DelSong(selectedS+1); +int i=selectedS; +songs->removeItem(selectedS); +songs->setCurrentItem(i); +} + +void CollectionDialog::resizeEvent(TQResizeEvent *) +{ +int maxw=newC->width(); +if (copyC->width()>maxw) maxw=copyC->width(); +if (deleteC->width()>maxw) maxw=deleteC->width(); +if (addS->width()>maxw) maxw=addS->width(); +if (delS->width()>maxw) maxw=delS->width(); + +newC->setGeometry(width()-maxw-5,newC->y(),maxw,newC->height()); +copyC->setGeometry(width()-maxw-5,copyC->y(),maxw,copyC->height()); +deleteC->setGeometry(width()-maxw-5,deleteC->y(),maxw,deleteC->height()); + +collections->resize(width()-maxw-20,(height()*35)/100); +label2->move(10,collections->y()+collections->height()+10); +songs->setGeometry(10,label2->y()+label2->height()+10,width()-maxw-20,height()-(label2->y()+label2->height()+10+ok->height()+10)); +addS->setGeometry(width()-maxw-5,songs->y()+5,maxw,addS->height()); +delS->setGeometry(width()-maxw-5,addS->y()+addS->height()+5,maxw,delS->height()); + +cancel->move(width()-cancel->width()-5,height()-cancel->height()-5); +ok->move(cancel->x()-5-ok->width(),height()-ok->height()-5); +} + +int CollectionDialog::selectedC=0; +int CollectionDialog::selectedS=0; +#include "collectdlg.moc" diff --git a/tdemid/collectdlg.h b/tdemid/collectdlg.h new file mode 100644 index 00000000..262a6227 --- /dev/null +++ b/tdemid/collectdlg.h @@ -0,0 +1,84 @@ +/************************************************************************** + + collectdlg.h - The collection manager dialog + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _collectdlg_h_ +#define _collectdlg_h_ + +#include +#include "songlist.h" +#include "slman.h" + +class TQLabel; +class KPushButton; +class TQPushButton; +class TQListBox; +class KURL; +class CollectionDialog : public TQDialog +{ + Q_OBJECT + +private: + SLManager *slman; + SongList *currentsl; + +protected: + + virtual void resizeEvent(TQResizeEvent *qre); + void fillInSongList(void); //clear the songs list and insert in it + // the songs in currentsl + void addSong(const KURL &); +public: + + CollectionDialog(SLManager *slm,int selc,TQWidget *parent,const char *name); + +public slots: + void collectionselected(int idx); + void songselected(int idx); + void newCollection(); + void copyCollection(); + void deleteCollection(); + void changeCollectionName(int idx); + void addSong(); + void removeSong(); + +private: +TQLabel *label; +TQLabel *label2; +KPushButton *ok; +KPushButton *cancel; +TQListBox *collections; +TQListBox *songs; +TQPushButton *newC; +TQPushButton *copyC; +TQPushButton *deleteC; +TQPushButton *addS; +TQPushButton *delS; + + +public: +static int selectedC; +static int selectedS; + +}; + +#endif diff --git a/tdemid/configure.in.in b/tdemid/configure.in.in new file mode 100644 index 00000000..af6e24d2 --- /dev/null +++ b/tdemid/configure.in.in @@ -0,0 +1,5 @@ +KDE_CHECK_HEADER([libtdemid/libtdemid.h], [kde_mid_compiles=yes], [kde_mid_compiles=no]) +if test $kde_mid_compiles = no; then + DO_NOT_COMPILE="$DO_NOT_COMPILE tdemid" +fi + diff --git a/tdemid/drums.o3 b/tdemid/drums.o3 new file mode 100644 index 00000000..01d9b9c5 Binary files /dev/null and b/tdemid/drums.o3 differ diff --git a/tdemid/drums.sb b/tdemid/drums.sb new file mode 100644 index 00000000..4bfaf8a3 Binary files /dev/null and b/tdemid/drums.sb differ diff --git a/tdemid/examples/DiesIrae.kar b/tdemid/examples/DiesIrae.kar new file mode 100644 index 00000000..c54c6fb6 Binary files /dev/null and b/tdemid/examples/DiesIrae.kar differ diff --git a/tdemid/examples/Guantanamera.kar b/tdemid/examples/Guantanamera.kar new file mode 100644 index 00000000..7fee4b1a Binary files /dev/null and b/tdemid/examples/Guantanamera.kar differ diff --git a/tdemid/examples/Makefile.am b/tdemid/examples/Makefile.am new file mode 100644 index 00000000..637f39ea --- /dev/null +++ b/tdemid/examples/Makefile.am @@ -0,0 +1,6 @@ + +example_DATA = OFortuna.kar DiesIrae.kar Guantanamera.kar \ + MariaDeLasMercedes.kar +exampledir = $(kde_datadir)/tdemid + +EXTRA_DIST = $(example_DATA) diff --git a/tdemid/examples/MariaDeLasMercedes.kar b/tdemid/examples/MariaDeLasMercedes.kar new file mode 100644 index 00000000..7a2e305e Binary files /dev/null and b/tdemid/examples/MariaDeLasMercedes.kar differ diff --git a/tdemid/examples/OFortuna.kar b/tdemid/examples/OFortuna.kar new file mode 100644 index 00000000..cc59960e Binary files /dev/null and b/tdemid/examples/OFortuna.kar differ diff --git a/tdemid/hi16-app-tdemid.png b/tdemid/hi16-app-tdemid.png new file mode 100644 index 00000000..dcad9f23 Binary files /dev/null and b/tdemid/hi16-app-tdemid.png differ diff --git a/tdemid/hi32-app-tdemid.png b/tdemid/hi32-app-tdemid.png new file mode 100644 index 00000000..4538ad78 Binary files /dev/null and b/tdemid/hi32-app-tdemid.png differ diff --git a/tdemid/hi48-app-tdemid.png b/tdemid/hi48-app-tdemid.png new file mode 100644 index 00000000..928cebca Binary files /dev/null and b/tdemid/hi48-app-tdemid.png differ diff --git a/tdemid/history.txt b/tdemid/history.txt new file mode 100644 index 00000000..896bdeb1 --- /dev/null +++ b/tdemid/history.txt @@ -0,0 +1,567 @@ +Thursday 11-9-97 +- I have started with some tries to make the midi work and due to the + success I have even made an object to manage the midi : midiOut + +Friday 12-9-97 +- Waking up at 7:00am, working from 8:20 to 11:20 and doing some fixes + at 14:20, I have been able to play a midi file through the /dev/sequencer + using the class midiOut and writing some new classes like : midfile + track and some more. + +Saturday 13-9-97 +- Today I have made a midi mapper (object mapper) which read a map config file + and is used to support older synths without general midi compliance. + +Sunday 14-9-97 +- I have made a window, with a KMenuBar, and a KSilder, which reads a mid file + and play it (using a fork) + +Monday 15-9-97 +- fork copy the memory and thus, I cannot tell the player to pause, I have read + much about the subject, and about threads + +Tuesday 16-9-97 +- I have made a small program to test the threads and forks, threads apparently +are faster, but it seems to have a problem with libqt or anyone, and I get +core dumpes what I run tdemid even if I only link libpthread but don't use it. +So I've decided to make a fork, in the other way, I've learned to share memory + +Wednesday 17-9-97 +- Christian Esken has told me to use mediatool, but I don't have the +documentation, so I cannot continue work until I get it. + +Thursday 18-9-97 +- Well, I'll continue even without the docs, and when I have them, I will +make the neccesary changes to the code. I have made a few details in windows + +Friday 19-9-97 +- Today I have made the Pause and Stop buttons work. Also, I have made the +slide bar move. And also, I have made a parser of the midi file, which tells +how long the song is, in seconds. If this was little, I have made the interface +between the ui and the player. + +Saturday 20-9-97 +- The interface between the ui and the player doesn't work well, I have to +redesign it because it's difficult to be accurate writing the karaoke at the same that the note plays + +Sunday 21-9-97 +- I have redesigned twice the interface between ui and player and it still +doesn't work well, the first method was creating a list of the karaoke events +and using a timer to process the next event at the right time, but that doesn't +work perfectly, because the text appears a moment after or before the note is +played. The second method is a while loop, which calls processEvents, but +that isn't a very good option, because, though text appears just at the same +time of the note is played, top tells me that tdemid is consuming up to 98% of +CPU time, and I don't want to make such a monster. + +Monday 22-9-97 +- Another failed method, and another passed day + +Tuesday 23-9-97 +- Some small changes beautifying the monster to send it to Christian + +Wednesday 24-9-97 +- More debugging and no result. I have uploaded current version to arrakis for +Christian to see it. + +Thursday 25-9-97 +- Eureka ! , at last, I have made the player and the ui run at the same time +with PERFECT syncronisation :-) (at 10:30 pm) + +Friday,Saturday,Sunday 26,27,28-9-97 +- I've been looking at the birds flying freely from tree to tree in all this +weekend, also, I've studied for the test drive. + +Monday 29-9-97 +- I have passed the exam and also, I have (almost) done the karaoke widget +and it works very well ! + +Tuesday 30-9-97 +- The karaoke widget is finished, it also have a scrollbar to see all the +lyrics. By the way, StarTrek : First Contact is a very recommended film + +Wednesday 1-10-97 +- I have fixed pause and stop, which were broken during the karaoke syncro +By the way, tdemid consumes 0.0% CPU and 00:00 time while playing a 6 minute song +(and I think that even in longer songs !) + +Thursday 2-10-97 +- I have started classes, so I think I will have less time :-( + +Wednesday 8-10-97 +- The player now recognizes the SETPOS message, but the ui is not syncronized +yet + +Thursday 9-10-97 +- S. R. has "show"ed me the way to initialize the menu, toolbar and client of a +KTopLevelWidget, without the need to resize the window. + +Sunday 12-10-97 +- I have made that all time variables are expressed in milliseconds, so no +more change units !! + +Sunday 19-10-97 +- I have programmed very little this week, but today I have kill a big bug, +now all the songs play well. Some songs were played with some parts faster and +some parts slower than they should (thanks to Christian Esken for reporting + the bug!) + +Tuesday 21-10-97 +- WOE, KDE-Beta-ONE is even better than before. But now tdemid doesn't compile (?) + +Wednesday 22-10-97 +- After compiling the kde libs, tdemid compiles ok. KSlider has changed and its +behaviour (Arrrgh!), so I have trickered a little the code. + +Thursday 23-10-97 +- I have cleaned a little the code. + +Friday 24-10-97 +- I started to "rewrite" the track class to make the slider work well + +Saturday 25-10-97 +- I have passed the day working in the time. + +Sunday 26-10-97 +- Eureka !!!, KMid works great! with good timings and syncronization between + O ~ music and lyrics. + U + \_/ + +Monday 27-10-97 +- After 10 hours in the university, I have made the final touches to send +tdemid 0.1 to the internet. + +??? 7-11-97 +- Finally, there's an impossible-better syncro between the program +and the user !!!. I mean, that when you press the pause button, the music +is inmediatly paused !!! + +Saturday 8-11-97 +- So I suppose yesterday was Friday, but I should demostrate it :-) +I have added drag & drop support in tdemid to load files by dropping them from kfm +Also made the slider show the time played at resizeable steps + +Sunday 9-11-97 +- Today I have made possible to change the font and I have made an icon. +Prepare a version to upload tomorrow to the internet. + +Thursday 13-11-97 +- I have nearly rewritten (made lots of changes to) the lyrics display widget +Also fixed that old "bug" that let in black the last word of a phrase in some +songs. + +Friday 14-11-97 +- Automatic text event chooser is done ! +- Fixed a bug that could freeze tdemid under very rare circunstances. +- Added more support for incomplete/broken files + +Saturday 15-11-97 +- I have changed the exit-behaviour for a messagebox-behaviour +- Fixed a bug that could leave the children running when closing tdemid + +Sunday 16-11-97 +- KMid adds a mime entry for karaoke files in audio/x-karaoke +- Real Session Management. +- Made the first rpm of tdemid. + +Monday 17-11-97 +- Release version 0.3 in tgz and rpm + +Friday 28-11-97 +- I've been quite busy this week, but I have had reports and patches :-) on +how to make tdemid to work with an AWE, a GUS, and in FreeBSD :-)))) + +Monday 8-12-97 +- I have fixed a small bug with which the time that a song longs was not well +reported. +- Also a tiny bug in consoletdemid + +Tuesday 9-12-97 +- I've made the first feature that I've been asked for. Another thing to map +with the midi mapper for Dietmar's PSR500 + +Friday 12-12-97 +- Nearly done the map chooser so that there will no be needed to edit the tdemidrc +for anything. +Now when you choose a new map or change GM/MT32 mode, the music is automatically +changed while playing !. + +...... **-12-97 +- I have been the rest of the month implementing a midi server that I will +call KMidServer and that will provide any application with easy control over +midi functions. + +30-12-97 +- KMid now can play gzipped midi files just as any other normal file. + +.... **-1-98 +- I have improved the midi mapper by allowing to factor the pitch bender. + Now pitch benders works OK !! (at last I have improved the windows mapper :-) + I have also added support to convert expression events to volume events. +* I have been doing the kfourier this month and studying (little time to do more) + + +Thursday 5-2-98 +- After doing my first exam this year, I have decided to calm things a little + by programming something. I have made the options added to the mapper available +through the config map file. + +Monday 9-2-98 +- 2nd exam done and a bug that I introduced last thrusday fixed. + +Friday 20-2-98 +- I've finished exams, have installed the yesterday snapshots and have +updated the configure scripts to add rpath and all that stuff to my copy +of tdemid (thanks to Kulow, who added it to tdemid in tdemultimedia) + +Saturday 21-2-98 +- Fixed the not-a-feature problem with FM, next time I will not let the +option for the user to select something that doesn't work. +Final touches to release tdemid 0.41 tomorrow morning. + +Monday 23-2-98 +- I've started working on FM support (and it goes very fast) + +Tuesday 24-2-98 +- fm already works, but notes are shifted to a higher key !!! +Also pitch bender seems not to be accurate. + +Wednesday 25-2-98 +- pitch bender is now fixed, and also the shift of notes, now the problem + is that some notes are lost (always from the same track/channel/patch?!?!) + +Friday 27-2-98 +- The problem with the lost notes is fixed :-/, the problem was that some +notes are played through the left speaker and some thru the right speaker, +and my wires for the right speaker were broken, but it wasn't noted with +the surround activated :-))))))) (Sometimes I feel real shame). Three days +lost in that !! + +Saturday 28-2-98 +- I've gone to the country and I've done the internals of the playlists in a +486/50 without linux, so I'll compile the Monday. + +Sunday 1-3-98 +- Some test with multiple toolbars. + +Monday 2-3-98 +- Started to do the collections manager dialog + +Tuesday 3-3-98 +- The collections manager dialog is done. + +Wednesday 4-3-98 +- KKeyConfig is a really good class, easy to use to make the karaoke scroll +when arrow keys are pressed. + +Thursday 5-3-98 +- I've done the playlist hardest part, now it works and there's only left + some final touches to do + +Tuesday 10-3-98 +- Playlists are finally working ok. + +Wednesday 11-3-98 +- Fixed the session management (in fact, I've changed it a little to support +collections) + +Thursday 12-3-98 +- Fixed some small bugs. + +Friday 13-3-98 +- I have replaced my new Makefiles.am (just two days old) with the one +of Stephan Kulow which look much better. + +Saturday 14-3-98 +- Finished deleting printf's to upload tdemid tomorrow :-) + +Sunday 15-3-98 +- Upload it, but as I forgot to delete some printf messages :-( , I had +to quickly do a fix and send also 0.5.1 + +**** **-3-98 +- I've passed many days configuring the modem, the internet connection, +sendmail, kppp, cvs and all those programs :-) + +Monday 30-3-98 +- I've implemented the save-Lyrics feature that Adrian Knoth suggested (thanks!) + +Tuesday 31-3-98 +- I've done some changes to support the new KFileDialog and the new +changes in tdelibs done by Matthias. + +Thursday 2-4-98 +- Some bug fixes + +Monday 6-4-98 +- I've found and fixed a memory leakage bug, I forgot to delete the +SpecialEvents from each song, so tdemid was using more and more memory with +each opened song. + +Tuesday 7-4-98 +- Aaaargh !, I have to remove the changes that I did last tuesday because it +seems that the changes in the tdelibs have been removed. + +Monday 13-4-98 +- Added support for midi files with strange headers not related to midi files. + (suggested by Adrian Knoth, thanks !) + +Friday 24-4-98 +- At last, I have had some free time and have done some things: + 1. Finally fixed the synchronization between gui and player (hopefully forever) + 2. Fixed a problem openning a gzipped file with spaces in its name + 3. Fixed a bug which caused tdemid to freeze if collection has only 1 song, and + trying to play next song in aleatory mode. + 4. Fixed the problem which made some songs to play at a lower volume when + moving the slider, but no if playing from the beginning + That's all for now :-) , there have been so many changes that I've call + this version 0.5.3 + +Thursday 7-5-98 +- Released version 0.6 to update my homepage which was getting very outdated + +Saturday 9-5-98 +- After fixing my midi cable, I've noticed that fm is (as Gyula Kerekes + reported), playing in mono, and I've fixed it. + +Sunday 10-5-98 +- I've fixed a small bug with which midi files without text events (nor lyrics) +got the time slider very desynchronized after pausing for a long time. + +Monday 25-5-98 +- Applied a patch submitted by Kevin Street, to compile tdemid on FreeBSD 3.0 +systems with awe support (directory settings has changed since 2.2) + +Saturday 20-6-98 +- I'm on exams, but just to relax a few minutes I've been hunting for bugs :-) + +Sunday 21-6-98 +- Wow, KDE-1.0 is finally here, and it is REAL, so I will prepare very quickly +KMid 1.0 before the freeze of tdemultimedia. + +Saturday 4-7-98 +- Just finished exams :-), and I've implemented the (long awaited feature of a) +volume bar. + +Sunday 5-7-98 +- I'm doing a channel view in which you can see the keys being pressed +and released, it's very nice :-) + +Monday 6-7-98 +- Using the (still hot) shutDown signal (the most awaited thing for +tdemid) + +Monday 13-7-98 +- I've restructured the Channel view, it's much nicer and allows for easier +expansion. It also shows the used instrument + +Saturday 15-8-98 +- Wow, I haven't updated this file for so long ... + I've finished the changing instrument feature and so the channel view. + I've also improved speed a little by supressing some parses to the midi file. + I have improved consoletdemid, now it is much more usuable. + Finally, I've changed the sources to use the KAccel class. + +Monday 31-8-98 +- I've fixed some bugs, the most important one being that tdemid left its player + processes as zombies after stopping playing (it worked ok, but now it doesn't, + dunno why). That problem made to appear some weird dialogs telling "song is already + playing" at each moment +- I left a color hardcoded in button*.xpm when it should be Transparent (not + everybody has a window background color of #5D5D8F8FA0A0 :-) ) +- I created a Motif 1.0 combo box in the channelview, but it should be Motif 2.0 + because 1.0 has a "feature" for large como boxes (as this one) + + +Wednesday 9-9-98 +- Fixed the last bug for leaving zombies around. + +Monday 14-9-98 +- Released Version 1.2 + +Tuesday 15-9-98 +- Added the change tempo widget and the KTriangleButton widget + +Wednesday 16-9-98 +- It's possible now to change the tempo of a song. + +Thursday 1-10-98 +- Fixed some problems + +Thursday 15-10-98 +- FIXED !!! + The long awaited fix has arrived for songs keeping playing after X11' logout + when channelview was actived. + Now also the ChannelView change its colors when the user change the + global colors, kdisptext paints a frame over the karaoke text, + KLCDNumber only accepts a range of values (from 3 to 999) + +Friday 16-10-98 +- Improved support for really broken files. +- Added some translations to Spanish + +Friday 23-10-98 +- I've started writing the internals of a rhythm view + +Saturday 24-10-98 +- Now KMid shows a new widget to make easier follow the rhythm of songs. + I've also fixed a small bug by which the tempo (and rhythm) changed its + state before the event actually happening if you moved the timebar near + before the event time. The problem was caused by volatile shared variables. + +Sunday 25-10-98 +- Fixed a serious bug I introduced in the previous commitment + +Monday 2-11-98 +- Fixed some problems + +Sunday 8-11-98 +- Some small changes + +Wednesday 25-11-98 +- I've finally fixed the bug that made tdemid play music sometimes +faster and sometimes slower on some machines (i.e. mine, since I installed +kernel 2.0.36) +This bug was there since the real beginning, and now, it is FIXED. +This deserves a new 2.0 version, probably next week. + +Friday 27-11-98 +- Fixed a broken link in the .kdelnk file (DocPath) and raised version +number to 1.6 + +Thursday 10-12-98 +- Added new sgml documentation, updated up to KMid 1.6 + +Friday 11-12-98 +- Fixed a shared memory leackage bug (hopefully the last bug in KMid :) ). + +Thursday 17-12-98 +- Initial support for SoftOSS (this is making some sound now :)) +- Indentified the player directory sources and beautified them a little + +Friday 18-12-98 +- Fixed a geometry layout bug + +Sunday 20-12-98 +- Fixed a problem when [un]installing midi devices (not such a mad idea if you +use kernel modules) that made tdemid segfault because it couldn't found +the device. + +Saturday 16-1-99 +- Decode URL before showing it on the screen. + +Thursday 21-1-99 +- Fixed a null pointer access while generating beats, because I didn't +checked for songs which didn't contain any spev (songs which use absolute 0 spev +are extremely rare to find, as any song must include at least a tempo event) + +Tuesday 26-1-99 +- Removed ; after QOBJECT and fixed default midi map in consoletdemid (not tdemid) + +Sunday 21-2-99 +- Made a quick hack (no more than 15 lines) and tdemid uses TDEIOJob to be +net transparent (now it can download files using an http or ftp protocol just +using dnd from a kfm window or using the open file dialog) + +Saturday 6-3-99 +- The sound driver in Linux kernels from the 2.2.x series work very different +than the ones in 2.0.x so tdemid was severely damaged. After several days of +hacking (and after getting from A.Cox that this wasn't going to be fixed in the +kernel) I've found a fix that even works in the 2.0.x kernels. + +Sunday 21-3-99 +- Fixed the high pitch of AWE cards (thanks to Joseph H. Buehler and Takashi Iwai for + the indications) +- Raised version number to 1.7 + +Friday 2-4-99 +- Did a workaround for a bug in egcs which doesn't seem to optimize simple +return-a-value function as an inline function when using -O2 and it made tdemid +freeze under certain conditions when parsing some midi files. + +- Removed a comparison of double variables which is very dangerous (_even_ after +storing in one of them the value of the other one) +- Fixed a problem by which tdemid didn't play the last half second or so of some songs. + +Thursday 8-4-99 +- Fixed a problem that made Kmid consume 99% of CPU since a month ago. Now it's back +to the usual 0.00% of CPU use :-) + +Monday 12-4-99 +- Fixed a bug that made KMid freeze when trying to open a directory + +Thursday 15-4-99 +- Better support for broken karaoke files which has duplicated lyrics + +Thursday 11-11-99 +- Fixed a problem with corrupt files that suddenly doesn't work (but KMid + from the 1.1 branch works ok (?) ). Anyway, I've got it to work even + better with broken files +- Fixed the KLed usage, which was broken since the KLedLamp -> KLed transition. +- Fixed a repaint bug with the time tags that has been here for too long. + +Friday 12-11-99 +- Instead of using manual layout, let's use QLayouts (there are still some + problems with this ) +- Added xdnd support (finally !) + +Thursday 25-11-99 +- Changed a lot of code to look much better +- Fixed many problems when painting lyrics in different colors + +Friday 26-11-99 +- The lyrics display doesn't flicker anymore (finally :-) ) +- Reworked the scrolling code, it's smooth now instead of line-by-line (but also + makes consumes a bit of CPU, so I'll make it configurable for people who don't + want to waste resources) +- note: don't call resizeContents from drawContents, or you'll have some + problems (QScrollView bug ?, anyway, this note should be on the docs) + +Tuesday 11-1-2000 +- SoftOSS is working now ! +- Added LOTS of documentation to the MIDI library. Anyway, there's a lot more +to come. +- Also fixed a few problems in the lyrics display, and added a new option +to consoletdemid + +Sunday 27-2-2000 +- Ported KMid to use the "official" LibKMid and KXMLGUI, with the following + result : + # wc tdemidframe.cpp + Before: 769 1450 24820 tdemidframe.cpp + After : 622 1171 19045 tdemidframe.cpp + +Monday 28-2-2000 +- Added ALSA support to libtdemid + +Tuesday 29-2-2000 +- I'm making KMid a part + +It took me : exactly 13 minutes to port the app + 30 seconds to do /LD/LIB/ in Makefile.am + 5:14 to compile it and see that kbrowser.h doesn't exist now :( + +Sunday 5-3-2000 +- Now libtdemid does build and run on systems where OSS is not installed. +- Updated the code to simplify it a bit due to libtdemid changes. +- I still have to search for a bug that makes KMid (and the part!) to crash + when destroying KDisplayText (the curious thing is that it crashes on + QScrollView) + +Sunday 2-4-2000 +- Now Libtdemid links with tdecore and qt in order to use a TDEConfig object to +read the default settings as saved by the user with the midi kcontrol module. +- It creates a "dummy" TDEInstance in case of the application being a non-KDE +application. +- Fixed compilation of KMid, as 1) someone renamed klinedit.h to klineedit.h +and 2) now we have to include qiconset.h when creating an action with pictures +as in tdemid_part.cpp +- Now I just have to find why KMid doesn't show any interface except the +standard actions + +Saturday 30-9-2000 +- Hmm, it's been a long time since I don't update this file. In summer + I've fixed ALSA support and many related bugs. +- Today, I've finally added the accelerators. +- Raised version to 2.0 diff --git a/tdemid/instrfilter.awk b/tdemid/instrfilter.awk new file mode 100644 index 00000000..078169aa --- /dev/null +++ b/tdemid/instrfilter.awk @@ -0,0 +1,2 @@ +{ match ($0,"\".*\"") } +{ if (RSTART>0) print "i18n("substr($0,RSTART,RLENGTH)");" }; diff --git a/tdemid/instrname.cpp b/tdemid/instrname.cpp new file mode 100644 index 00000000..551b85c9 --- /dev/null +++ b/tdemid/instrname.cpp @@ -0,0 +1,132 @@ +const char *instrumentName[128]={ + "Acoustic Grand Piano", + "Bright Acoustic Piano", + "Electric Grand Piano", + "Honky-Tonk", + "Rhodes Piano", + "Chorused Piano", + "Harpsichord", + "Clavinet", + "Celesta", + "Glockenspiel", + "Music Box", + "Vibraphone", + "Marimba", + "Xylophone", + "Tubular Bells", + "Dulcimer", + "Hammond Organ", + "Percussive Organ", + "Rock Organ", + "Church Organ", + "Reed Organ", + "Accordion", + "Harmonica", + "Tango Accordion", + "Acoustic Guitar (Nylon)", + "Acoustic Guitar (Steel)", + "Electric Guitar (Jazz)", + "Electric Guitar (Clean)", + "Electric Guitar (Muted)", + "Overdriven Guitar", + "Distortion Guitar", + "Guitar Harmonics", + "Acoustic Bass", + "Electric Bass (Finger)", + "Electric Bass (Pick)", + "Fretless Bass", + "Slap Bass 1", + "Slap Bass 2", + "Synth Bass 1", + "Synth Bass 2", + "Violin", + "Viola", + "Cello", + "Contrabass", + "Tremolo Strings", + "Pizzicato Strings", + "Orchestral Harp", + "Timpani", + "String Ensemble 1", + "String Ensemble 2", + "Synth Strings 1", + "Synth Strings 2", + "Choir Aahs", + "Voice Oohs", + "Synth Voice", + "Orchestra Hit", + "Trumpet", + "Trombone", + "Tuba", + "Muted Trumpet", + "French Horn", + "Brass Section", + "Synth Brass 1", + "Synth Brass 2", + "Soprano Sax", + "Alto Sax", + "Tenor Sax", + "Baritone Sax", + "Oboe", + "English Horn", + "Bassoon", + "Clarinet", + "Piccolo", + "Flute", + "Recorder", + "Pan Flute", + "Blown Bottle", + "Shakuhachi", + "Whistle", + "Ocarina", + "Lead 1 - Square Wave", + "Lead 2 - Saw Tooth", + "Lead 3 - Calliope", + "Lead 4 - Chiflead", + "Lead 5 - Charang", + "Lead 6 - Voice", + "Lead 7 - Fifths", + "Lead 8 - Bass+Lead", + "Pad 1 - New Age", + "Pad 2 - Warm", + "Pad 3 - Polysynth", + "Pad 4 - Choir", + "Pad 5 - Bow", + "Pad 6 - Metallic", + "Pad 7 - Halo", + "Pad 8 - Sweep", + "FX 1 - Rain", + "FX 2 - Soundtrack", + "FX 3 - Crystal", + "FX 4 - Atmosphere", + "FX 5 - Brightness", + "FX 6 - Goblins", + "FX 7 - Echoes", + "FX 8 - Sci-fi", + "Sitar", + "Banjo", + "Shamisen", + "Koto", + "Kalimba", + "Bagpipe", + "Fiddle", + "Shannai", + "Tinkle Bell", + "Agogo", + "Steel Drum", + "Wook Block", + "Taiko Drum", + "Melodic Tom", + "Synth Drum", + "Reverse Cymbal", + "Guitar Fret Noise", + "Breath Noise", + "Seashore", + "Bird Tweet", + "Telephone", + "Helicopter", + "Applause", + "Gunshot" +}; + + diff --git a/tdemid/instrname.h b/tdemid/instrname.h new file mode 100644 index 00000000..80e199c4 --- /dev/null +++ b/tdemid/instrname.h @@ -0,0 +1,6 @@ +#ifndef _INSTRNAME_H +#define _INSTRNAME_H + +extern const char *instrumentName[128]; + +#endif diff --git a/tdemid/instrname.i18n b/tdemid/instrname.i18n new file mode 100644 index 00000000..08ec0938 --- /dev/null +++ b/tdemid/instrname.i18n @@ -0,0 +1,133 @@ +/* This is an automatically generated file + * DO NOT EDIT !!! + * To create this file run : make instrname.i18n + */ + +i18n("Acoustic Grand Piano"); +i18n("Bright Acoustic Piano"); +i18n("Electric Grand Piano"); +i18n("Honky-Tonk"); +i18n("Rhodes Piano"); +i18n("Chorused Piano"); +i18n("Harpsichord"); +i18n("Clavinet"); +i18n("Celesta"); +i18n("Glockenspiel"); +i18n("Music Box"); +i18n("Vibraphone"); +i18n("Marimba"); +i18n("Xylophone"); +i18n("Tubular Bells"); +i18n("Dulcimer"); +i18n("Hammond Organ"); +i18n("Percussive Organ"); +i18n("Rock Organ"); +i18n("Church Organ"); +i18n("Reed Organ"); +i18n("Accordion"); +i18n("Harmonica"); +i18n("Tango Accordion"); +i18n("Acoustic Guitar (Nylon)"); +i18n("Acoustic Guitar (Steel)"); +i18n("Electric Guitar (Jazz)"); +i18n("Electric Guitar (Clean)"); +i18n("Electric Guitar (Muted)"); +i18n("Overdriven Guitar"); +i18n("Distortion Guitar"); +i18n("Guitar Harmonics"); +i18n("Acoustic Bass"); +i18n("Electric Bass (Finger)"); +i18n("Electric Bass (Pick)"); +i18n("Fretless Bass"); +i18n("Slap Bass 1"); +i18n("Slap Bass 2"); +i18n("Synth Bass 1"); +i18n("Synth Bass 2"); +i18n("Violin"); +i18n("Viola"); +i18n("Cello"); +i18n("Contrabass"); +i18n("Tremolo Strings"); +i18n("Pizzicato Strings"); +i18n("Orchestral Harp"); +i18n("Timpani"); +i18n("String Ensemble 1"); +i18n("String Ensemble 2"); +i18n("Synth Strings 1"); +i18n("Synth Strings 2"); +i18n("Choir Aahs"); +i18n("Voice Oohs"); +i18n("Synth Voice"); +i18n("Orchestra Hit"); +i18n("Trumpet"); +i18n("Trombone"); +i18n("Tuba"); +i18n("Muted Trumpet"); +i18n("French Horn"); +i18n("Brass Section"); +i18n("Synth Brass 1"); +i18n("Synth Brass 2"); +i18n("Soprano Sax"); +i18n("Alto Sax"); +i18n("Tenor Sax"); +i18n("Baritone Sax"); +i18n("Oboe"); +i18n("English Horn"); +i18n("Bassoon"); +i18n("Clarinet"); +i18n("Piccolo"); +i18n("Flute"); +i18n("Recorder"); +i18n("Pan Flute"); +i18n("Blown Bottle"); +i18n("Shakuhachi"); +i18n("Whistle"); +i18n("Ocarina"); +i18n("Lead 1 - Square Wave"); +i18n("Lead 2 - Saw Tooth"); +i18n("Lead 3 - Calliope"); +i18n("Lead 4 - Chiflead"); +i18n("Lead 5 - Charang"); +i18n("Lead 6 - Voice"); +i18n("Lead 7 - Fifths"); +i18n("Lead 8 - Bass+Lead"); +i18n("Pad 1 - New Age"); +i18n("Pad 2 - Warm"); +i18n("Pad 3 - Polysynth"); +i18n("Pad 4 - Choir"); +i18n("Pad 5 - Bow"); +i18n("Pad 6 - Metallic"); +i18n("Pad 7 - Halo"); +i18n("Pad 8 - Sweep"); +i18n("FX 1 - Rain"); +i18n("FX 2 - Soundtrack"); +i18n("FX 3 - Crystal"); +i18n("FX 4 - Atmosphere"); +i18n("FX 5 - Brightness"); +i18n("FX 6 - Goblins"); +i18n("FX 7 - Echoes"); +i18n("FX 8 - Sci-fi"); +i18n("Sitar"); +i18n("Banjo"); +i18n("Shamisen"); +i18n("Koto"); +i18n("Kalimba"); +i18n("Bagpipe"); +i18n("Fiddle"); +i18n("Shannai"); +i18n("Tinkle Bell"); +i18n("Agogo"); +i18n("Steel Drum"); +i18n("Wook Block"); +i18n("Taiko Drum"); +i18n("Melodic Tom"); +i18n("Synth Drum"); +i18n("Reverse Cymbal"); +i18n("Guitar Fret Noise"); +i18n("Breath Noise"); +i18n("Seashore"); +i18n("Bird Tweet"); +i18n("Telephone"); +i18n("Helicopter"); +i18n("Applause"); +i18n("Gunshot"); diff --git a/tdemid/kdisptext.cpp b/tdemid/kdisptext.cpp new file mode 100644 index 00000000..edaede4a --- /dev/null +++ b/tdemid/kdisptext.cpp @@ -0,0 +1,640 @@ +/************************************************************************** + + kdisptext.cpp - The widget that displays the karaoke/lyrics text + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include "kdisptext.h" +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "version.h" + + +#define NUMPREVLINES 2 +//#define DRAW_BOUNDING_RECTS + + +KDisplayText::KDisplayText(TQWidget *parent,const char *name) : TQScrollView(parent,name) +{ + first_line_[0]=first_line_[1]=NULL; + linked_list_[0]=linked_list_[1]=NULL; + cursor_line_[0]=cursor_line_[1]=NULL; + cursor_[0]=cursor_[1]=NULL; + nlines_[0]=nlines_[1]=0; + linked_list=NULL; + cursor_line=NULL; + first_line=NULL; + cursor=NULL; + nlines=0; + lyrics_codec=TDEGlobal::locale()->codecForEncoding(); + + viewport()->setBackgroundColor(TQColor (110,110,110)); +// setBackgroundMode(NoBackground); + TDEConfig *kcfg=TDEGlobal::instance()->config(); + kcfg->setGroup("KMid"); + typeoftextevents=kcfg->readNumEntry("TypeOfTextEvents",1); + TQFont *qtextfontdefault=new TQFont(TDEGlobalSettings::fixedFont().family(),22); + qtextfont=new TQFont(kcfg->readFontEntry("KaraokeFont",qtextfontdefault)); + delete qtextfontdefault; + qfmetr=new TQFontMetrics(*qtextfont); + nvisiblelines=height()/qfmetr->lineSpacing(); + autoscrollv=0; +} + +KDisplayText::~KDisplayText() +{ + RemoveLinkedList(); +} + +/*void KDisplayText::PreDestroyer(void) +{ + delete qfmetr; + delete qtextfont; +} +*/ + +void KDisplayText::RemoveLine(kdispt_line *tmpl) +{ + kdispt_ev *tmpe; + while (tmpl->ev!=NULL) + { + tmpe=tmpl->ev; + tmpl->ev=tmpe->next; + // delete tmpe->spev; Remember that the Special Events that this pointer + // points to is the same that the Player object has instantiated + delete tmpe; + } +} + +void KDisplayText::RemoveLinkedList(void) +{ + cursor=NULL; + cursor_line=NULL; + first_line=NULL; + linked_list=NULL; + nlines=0; + nlines_[0]=nlines_[1]=0; + first_line_[0]=first_line_[1]=NULL; + cursor_line_[0]=cursor_line_[1]=NULL; + cursor_[0]=cursor_[1]=NULL; + + kdispt_line *tmpl; + for (int i=0;i<2;i++) + { + while (linked_list_[i]!=NULL) + { + RemoveLine(linked_list_[i]); + tmpl=linked_list_[i]; + linked_list_[i]=linked_list_[i]->next; + delete tmpl; + } + } +} + +void KDisplayText::ClearEv(bool totally) +{ + RemoveLinkedList(); + if (totally) + { + TQT_TQOBJECT(this)->killTimers(); + autoscrollv=0; + resizeContents(0,0); + viewport()->repaint(TRUE); + } +} + +int KDisplayText::IsLineFeed(char c,int type) +{ + switch (type) + { + case (1) : if (/*(c==0)||*/(c=='\\')||(c=='/')||(c=='@')) return 1;break; + case (5) : if (/*(c==0)||*/(c==10)||(c==13)) return 1;break; + default : if ((c==0)||(c==10)||(c==13)||(c=='\\')||(c=='/')||(c=='@')) return 1;break; + } + return 0; +} + +void KDisplayText::AddEv(SpecialEvent *ev) +{ + if ((ev->type==1) || (ev->type==5)) + { + int idx=(ev->type==1)? 0 : 1; + if (linked_list_[idx]==NULL) + { + linked_list_[idx]=new kdispt_line; + linked_list_[idx]->next=NULL; + linked_list_[idx]->num=1; + linked_list_[idx]->ev=new kdispt_ev; + cursor_line_[idx]=linked_list_[idx]; + cursor_[idx]=cursor_line_[idx]->ev; + cursor_[idx]->spev=ev; + cursor_[idx]->next=NULL; + first_line_[idx]=linked_list_[idx]; + first_line=first_line_[idx]; + nlines_[idx]=1; + } + else + { + if (IsLineFeed(ev->text[0],ev->type)) + { + nlines_[idx]++; + cursor_line_[idx]->next=new kdispt_line; + cursor_line_[idx]=cursor_line_[idx]->next; + cursor_line_[idx]->num=nlines_[idx]; + cursor_line_[idx]->ev=new kdispt_ev; + cursor_line_[idx]->next=NULL; + cursor_[idx]=cursor_line_[idx]->ev; + } + else + { + cursor_[idx]->next=new kdispt_ev; + cursor_[idx]=cursor_[idx]->next; + } + cursor_[idx]->spev=ev; + cursor_[idx]->next=NULL; + } + } +} + +void KDisplayText::calculatePositions(void) +{ + int typeoftextevents=1; + int fin=0; + kdispt_line *tmpl; + kdispt_ev *tmp; + int tmpx=0; + int tmpy=0; + int tmpw=0; + int maxx=0; + nlines=nlines_[(typeoftextevents==1)? 0:1]; + int lineSpacing=qfmetr->lineSpacing(); + int descent=qfmetr->descent(); + while (!fin) + { + tmpl=linked_list_[(typeoftextevents==1)?0:1]; + tmpy=lineSpacing; + maxx=0; + while (tmpl!=NULL) + { + tmp=tmpl->ev; + tmpx=5; + while (tmp!=NULL) + { + if (tmp->spev->type==typeoftextevents) + { + if (IsLineFeed(tmp->spev->text[0],typeoftextevents)) + { + tmpy+=lineSpacing; + tmpx=5; + + tmp->xpos=tmpx; + if (tmp->spev->text[0]!=0) tmpw=qfmetr->width(lyrics_codec->toUnicode(&tmp->spev->text[1])); + else tmpw=0; + tmp->r=qfmetr->boundingRect(lyrics_codec->toUnicode(&tmp->spev->text[1])); + } + else + { + tmp->xpos=tmpx; + tmpw=qfmetr->width(lyrics_codec->toUnicode(tmp->spev->text)); + tmp->r=qfmetr->boundingRect(lyrics_codec->toUnicode(tmp->spev->text)); + } + // We add 5 pixels above, below and to the right because of a + // problem with latest released Xft + tmp->r.moveBy(tmpx,tmpy-tmp->r.height()-tmp->r.y()-5); + tmp->r.setHeight(tmp->r.height()+descent+10); + tmp->r.setWidth(tmp->r.width()+5); + tmpx+=tmpw; + if (tmpx>maxx) maxx=tmpx; + } + tmp=tmp->next; + } + tmpl->ypos=tmpl->num*lineSpacing; + tmpy=tmpl->ypos; + tmpl=tmpl->next; + } + maxX[(typeoftextevents==1)?0:1]=maxx+10; + maxY[(typeoftextevents==1)?0:1]= + nlines_[(typeoftextevents==1)?0:1]*lineSpacing+descent+10; + + if (typeoftextevents==1) typeoftextevents=5; + else fin=1; + } + +} + +kdispt_line *KDisplayText::searchYOffset(int y, kdispt_line *start) +{ +kdispt_line *t=start; +while (t!=NULL) + { +// if (t->ypos+qfmetr->descent()>y) return start; + if (t->ypos+qfmetr->descent()+20>y) return start; + start=t; + t=t->next; + }; +return start; +} + +void KDisplayText::drawContents(TQPainter *p, int /*clipx*/, int clipy, int /*clipw*/, int cliph) +{ + p->setFont(*qtextfont); + if (linked_list==NULL) return; + int i=0; + p->setPen(yellow); + int colorplayed=1; + if (cursor==NULL) colorplayed=0; // Thus, the program doesn't change the color + kdispt_line *tmpl=linked_list; + kdispt_ev *tmp; + +#ifdef KDISPTEXTDEBUG + printf("events displayed %d\n",typeoftextevents); +#endif + + tmpl=searchYOffset(clipy,linked_list); + int nlinestodraw=1; + kdispt_line *t=tmpl; + while ((t!=NULL)&&(t->ypos+qfmetr->descent()next; + } + + i=0; + while ((iev; + while ((tmp!=NULL)&&(tmp->spev->type!=typeoftextevents)) tmp=tmp->next; + while (tmp!=NULL) + { + if ( colorplayed && + // (tmp->spev->absmilliseconds>=cursor->spev->absmilliseconds)) + (tmp->spev->id>=cursor->spev->id)) + { + p->setPen(black); + colorplayed=0; + } + + if (IsLineFeed(tmp->spev->text[0],tmp->spev->type)) + p->drawText(tmp->xpos,tmpl->ypos,lyrics_codec->toUnicode(&tmp->spev->text[1])); + else + p->drawText(tmp->xpos,tmpl->ypos,lyrics_codec->toUnicode(tmp->spev->text)); + +#ifdef DRAW_BOUNDING_RECTS + p->setPen(red); + p->drawRect(tmp->r); + p->setPen((colorplayed)?yellow:black); +#endif + tmp=tmp->next; + while ((tmp!=NULL)&&(tmp->spev->type!=typeoftextevents)) tmp=tmp->next; + } + i++; + tmpl=tmpl->next; + } + +} + + +void KDisplayText::resizeEvent(TQResizeEvent *e) +{ + TQScrollView::resizeEvent(e); + nvisiblelines=visibleHeight()/qfmetr->lineSpacing(); + if ( (nlines>nvisiblelines) || (nvisiblelines==0) ) + resizeContents(maxX[(typeoftextevents==1)?0:1],maxY[(typeoftextevents==1)?0:1]); + else + resizeContents(0,0); + +} + +void KDisplayText::CursorToHome(void) +{ +/* TDEConfig *kcfg=TDEGlobal::instance()->config(); + kcfg->setGroup("KMid"); + typeoftextevents=kcfg->readNumEntry("TypeOfTextEvents",1); +*/ + linked_list=linked_list_[(typeoftextevents==1)? 0:1]; + nlines=nlines_[(typeoftextevents==1)? 0:1]; + cursor_line_[0]=linked_list_[0]; + first_line_[0]=cursor_line_[0]; + if (cursor_line_[0]!=NULL) cursor_[0]=cursor_line_[0]->ev; + cursor_line_[1]=linked_list_[1]; + first_line_[1]=cursor_line_[1]; + if (cursor_line_[1]!=NULL) cursor_[1]=cursor_line_[1]->ev; + + if (linked_list==NULL) + { + cursor_line=NULL; + cursor=NULL; + first_line=NULL; + } + else + { + cursor_line=linked_list; + cursor=cursor_line->ev; + first_line=linked_list; + } + + nvisiblelines=visibleHeight()/qfmetr->lineSpacing(); + if (nlines>nvisiblelines) + resizeContents(maxX[(typeoftextevents==1)?0:1],maxY[(typeoftextevents==1)?0:1]); + else + resizeContents(0,0); + + + setContentsPos(0,0); + viewport()->repaint(true); +} + +void KDisplayText::PaintIn(int type) +{ + bool paint=false; + if (type!=typeoftextevents) + { + int idx=(type==1)?0:1; + if (cursor_[idx]==NULL) return; + cursor_[idx]=cursor_[idx]->next; + while ((cursor_[idx]==NULL)&&(cursor_line_[idx]!=NULL)) + { + cursor_line_[idx]=cursor_line_[idx]->next; + if (cursor_line_[idx]!=NULL) + { + cursor_[idx]=cursor_line_[idx]->ev; + if ((cursor_line_[idx]->num>first_line_[idx]->num+NUMPREVLINES) + &&(cursor_line_[idx]->numnum+nvisiblelines+1)) + if ((first_line_[idx]!=NULL)&&(first_line_[idx]->num+nvisiblelines<=nlines_[idx])) first_line_[idx]=first_line_[idx]->next; + } + } + return; + } + + if ((cursor==NULL)||(cursor_line==NULL)) + { + printf("KDispT : cursor == NULL !!!\n"); + return; + } + + kdispt_ev *tmp=cursor; + if (cursor->spev->type==typeoftextevents) + { +// int x,y; +// contentsToViewport(cursor->xpos,cursor_line->ypos,x,y); + + cursor=cursor->next; + paint=true; + + } + else + cursor=cursor->next; + + + while ((cursor==NULL)&&(cursor_line!=NULL)) + { + cursor_line=cursor_line->next; + if (cursor_line!=NULL) + { + cursor=cursor_line->ev; + if ((cursor_line->ypos>contentsY()+(visibleHeight()*5/8))&& + (cursor_line->yposlineSpacing(); + if (b) startTimer(100); + else { + TQT_TQOBJECT(this)->killTimers(); + startTimer(100/(autoscrollv/qfmetr->lineSpacing()+1)); + } + } +// scrollBy(0,qfmetr->lineSpacing()); + } + } + if (paint) repaintContents(tmp->r); +} + +void KDisplayText::gotomsec(ulong i) +{ + int notidx=(typeoftextevents==1)?1:0; + + if (linked_list_[notidx]!=NULL) + { + cursor_line_[notidx]=linked_list_[notidx]; + first_line_[notidx]=cursor_line_[notidx]; + cursor_[notidx]=cursor_line_[notidx]->ev; + while ((cursor_line_[notidx]!=NULL)&&(cursor_[notidx]->spev->absmillisecondsnext; + while ((cursor_[notidx]==NULL)&&(cursor_line_[notidx]!=NULL)) + { + cursor_line_[notidx]=cursor_line_[notidx]->next; + if (cursor_line_[notidx]!=NULL) + { + cursor_[notidx]=cursor_line_[notidx]->ev; + if ((cursor_line_[notidx]->num>first_line_[notidx]->num+NUMPREVLINES) + &&(cursor_line_[notidx]->numnum+nvisiblelines+1)) + if ((first_line_[notidx]!=NULL)&&(first_line_[notidx]->num+nvisiblelines<=nlines_[notidx])) first_line_[notidx]=first_line_[notidx]->next; + } + } + } + } + + if (linked_list!=NULL) + { + cursor_line=linked_list; + cursor=cursor_line->ev; + first_line=linked_list; + while ((cursor_line!=NULL)&&(cursor->spev->absmillisecondsnext; + while ((cursor==NULL)&&(cursor_line!=NULL)) + { + cursor_line=cursor_line->next; + if (cursor_line!=NULL) + { + cursor=cursor_line->ev; + if ((cursor_line->num>first_line->num+NUMPREVLINES) + &&(cursor_line->numnum+nvisiblelines+1)) + if ((first_line!=NULL)&&(first_line->num+nvisiblelines<=nlines)) first_line=first_line->next; + } + } + + + } + + TQT_TQOBJECT(this)->killTimers(); + autoscrollv=0; + setContentsPos(0,first_line->ypos); + viewport()->repaint(); + + } +} + +TQFont *KDisplayText::getFont(void) +{ + return qtextfont; +} + +void KDisplayText::fontChanged(void) +{ + TDEConfig *kcfg=TDEGlobal::instance()->config(); + kcfg->setGroup("KMid"); + TQFont *qtextfontdefault=new TQFont(*qtextfont); + delete qtextfont; + qtextfont=new TQFont(kcfg->readFontEntry("KaraokeFont",qtextfontdefault)); + delete qtextfontdefault; + qfmetr=new TQFontMetrics(*qtextfont); + calculatePositions(); + nvisiblelines=height()/qfmetr->lineSpacing(); + viewport()->repaint(TRUE); +} + +void KDisplayText::ChangeTypeOfTextEvents(int type) +{ + int idxold=(typeoftextevents==1)?0:1; + int idxnew=(type==1)?0:1; + cursor_line_[idxold]=cursor_line; + first_line_[idxold]=first_line; + cursor_[idxold]=cursor; + linked_list=linked_list_[idxnew]; + cursor_line=cursor_line_[idxnew]; + first_line=first_line_[idxnew]; + cursor=cursor_[idxnew]; + nlines=nlines_[idxnew]; + typeoftextevents=type; + if (first_line!=NULL) + { + nvisiblelines=height()/qfmetr->lineSpacing(); + if (nlines>nvisiblelines) + resizeContents(maxX[(typeoftextevents==1)?0:1],maxY[(typeoftextevents==1)?0:1]); + else + resizeContents(0,0); + + setContentsPos(0,first_line->ypos); + } + viewport()->repaint(TRUE); +} + +int KDisplayText::ChooseTypeOfTextEvents(void) +{ + return (nlines_[0]>nlines_[1])? 1 : 5; +} + +void KDisplayText::ScrollDown() +{ + scrollBy(0,2/**qfmetr->lineSpacing()*/); +} + +void KDisplayText::ScrollUp() +{ + scrollBy(0,-2/**qfmetr->lineSpacing()*/); +} + +void KDisplayText::ScrollPageDown() +{ + scrollBy(0,nvisiblelines*qfmetr->lineSpacing()); +} + +void KDisplayText::ScrollPageUp() +{ + scrollBy(0,-nvisiblelines*qfmetr->lineSpacing()); +} + +void KDisplayText::saveLyrics(FILE *fh) +{ + kdispt_line *Lptr=linked_list_[(typeoftextevents==1)? 0:1]; + while (Lptr!=NULL) + { + kdispt_ev *Cptr=Lptr->ev; + if (Cptr!=NULL) + { + if (strcmp(Cptr->spev->text,"")!=0) + if (IsLineFeed(Cptr->spev->text[0],Cptr->spev->type)) + fputs(&Cptr->spev->text[1],fh); + else + fputs(Cptr->spev->text,fh); + Cptr=Cptr->next; + } + while (Cptr!=NULL) + { + fputs(Cptr->spev->text,fh); + Cptr=Cptr->next; + } + fputs("\n",fh); + Lptr=Lptr->next; + } +} + +void KDisplayText::timerEvent(TQTimerEvent *e) +{ + int dy; + if (autoscrollv>0) + { + dy=2+autoscrollv/50; + scrollBy(0,dy); + autoscrollv-=dy; + if (autoscrollv<0) + { + killTimer(e->timerId()); + autoscrollv=0; + } + } + else + if (autoscrollv<0) + { +// dy=(autoscrollv<-2*qfmetr->lineSpacing())?-7:-2; + dy=-2+autoscrollv/50; + scrollBy(0,dy); + autoscrollv-=dy; + if (autoscrollv>0) + { + killTimer(e->timerId()); + autoscrollv=0; + } + } + else + killTimer(e->timerId()); + +} + +void KDisplayText::setLyricsEncoding(const TQString &enc) +{ + TQTextCodec *newcodec; + if (enc.isEmpty()) + newcodec=TDEGlobal::locale()->codecForEncoding(); + else + newcodec=TQTextCodec::codecForName(enc.latin1()); + + if (newcodec!=lyrics_codec) + { + if (newcodec) + { + lyrics_codec=newcodec; + fontChanged(); + } + } +} + +#include "kdisptext.moc" diff --git a/tdemid/kdisptext.h b/tdemid/kdisptext.h new file mode 100644 index 00000000..04a25f27 --- /dev/null +++ b/tdemid/kdisptext.h @@ -0,0 +1,126 @@ +/************************************************************************** + + kdisptext.h - The widget that displays the karaoke/lyrics text + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _kdisptext_h_ +#define _kdisptext_h_ + +#include +#include +#include + +struct kdispt_ev +{ + SpecialEvent *spev; + int xpos; + class TQRect r; + kdispt_ev *next; +}; + +struct kdispt_line +{ + kdispt_ev *ev; + int num; + int ypos; + kdispt_line *next; +}; + +class TQFont; +class TQFontMetrics; +class TQScrollBar; + +class KDisplayText : public TQScrollView +{ + Q_OBJECT + +private: + TQTextCodec *lyrics_codec; + + TQFontMetrics *qfmetr; + TQFont *qtextfont; + + int typeoftextevents; + + kdispt_line *linked_list_[2]; + int nlines_[2]; + kdispt_line *first_line_[2]; + kdispt_line *cursor_line_[2]; + kdispt_ev *cursor_[2]; + + kdispt_line *linked_list; + kdispt_line *cursor_line; + kdispt_ev *cursor; + + kdispt_line *first_line; // Pointer to first text at first visible line + + int nlines; // Total number of lines + int nvisiblelines; // Number of visible lines + + void RemoveLine(kdispt_line *tmpl); + void RemoveLinkedList(void); + + int IsLineFeed(char c,int type=0); + virtual void drawContents(TQPainter *qpaint,int clipx,int clipy,int clipw,int cliph); + + kdispt_line * searchYOffset(int y, kdispt_line *start); + + int maxX[2]; + int maxY[2]; + int autoscrollv; + +protected: + virtual void resizeEvent(TQResizeEvent *qre); + virtual void timerEvent(TQTimerEvent *e); + +public: + KDisplayText(TQWidget *parent,const char *name); + virtual ~KDisplayText(); + + void ClearEv(bool totally=true); + void AddEv(SpecialEvent *ev); + void calculatePositions(void); + + void CursorToHome(void); + + void ChangeTypeOfTextEvents(int type); + int ChooseTypeOfTextEvents(void); + void PaintIn(int type); + void gotomsec(ulong i); + + TQFont *getFont(void); + void fontChanged(void); + + void saveLyrics(FILE *fh); + + void setLyricsEncoding(const TQString &enc); + +// TQSize sizeHint(); + +public slots: + void ScrollDown(); + void ScrollUp(); + void ScrollPageDown(); + void ScrollPageUp(); + +}; + +#endif diff --git a/tdemid/keyboard.xpm b/tdemid/keyboard.xpm new file mode 100644 index 00000000..9859e3a7 --- /dev/null +++ b/tdemid/keyboard.xpm @@ -0,0 +1,50 @@ +/* XPM */ +static char * keyboard_xpm[] = { +"63 45 2 1", +" c #000000000000", +". c #FFFFFFFFFFFF", +" ", +"..... .. ..... ..... .. .. ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... . .. . ..... ..... . .. . .. . ..... ", +"..... .... .. .... ..... ..... .... .. .... .. .... ..... ", +"..... .. ..... ..... .. .. ..... ", +"...... .... ...... ...... .... .... ...... ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +"........ ........ ........ ........ ........ ........ ........ ", +" ", +" "}; diff --git a/tdemid/klcdnumber.cpp b/tdemid/klcdnumber.cpp new file mode 100644 index 00000000..3fdf80c4 --- /dev/null +++ b/tdemid/klcdnumber.cpp @@ -0,0 +1,339 @@ +/************************************************************************** + + klcdnumber.cpp - The KLCDNumber widget (displays a lcd number) + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include "klcdnumber.h" +#include +#include +#include "ktrianglebutton.h" + +#define BUTTONWIDTH 9 + +KLCDNumber::KLCDNumber(int _numDigits,TQWidget *parent,const char *name) + : TQWidget(parent,name) +{ + initDigits(); + setUserChangeValue=false; + numDigits=_numDigits; + value=0; + minValue=0; + maxValue=1000; + oldvalue=-1; + // setPalette( TQPalette (TQColor(0,0,0))); + upBtn=NULL; + downBtn=NULL; + setUserDefaultValue=false; + doubleclicked=false; + setLCDBackgroundColor(0,0,0); + setLCDColor(100,255,100); +} + +KLCDNumber::KLCDNumber(bool _setUserChangeValue,int _numDigits,TQWidget *parent,const char *name) + : TQWidget(parent,name) +{ + initDigits(); + setUserChangeValue=_setUserChangeValue; + numDigits=_numDigits; + value=0; + minValue=0; + maxValue=1000; + oldvalue=-1; +// setBackgroundColor(TQColor(0,0,0)); +// setPalette( TQPalette (TQColor(0,0,0))); + upBtn=NULL; + downBtn=NULL; + setUserDefaultValue=false; + doubleclicked=false; + setLCDBackgroundColor(0,0,0); + setLCDColor(100,255,100); + if (setUserChangeValue) + { + upBtn=new KTriangleButton(KTriangleButton::Right,this,"Up"); + downBtn=new KTriangleButton(KTriangleButton::Left,this,"Down"); + upBtn->setGeometry(width()-BUTTONWIDTH,0,BUTTONWIDTH,height()); + downBtn->setGeometry(0,0,BUTTONWIDTH,height()); + connect(upBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(increaseValue())); + connect(downBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(decreaseValue())); + connect(upBtn,TQT_SIGNAL(clickedQuickly()),this,TQT_SLOT(increaseValueFast())); + connect(downBtn,TQT_SIGNAL(clickedQuickly()),this,TQT_SLOT(decreaseValueFast())); + }; +} + +void KLCDNumber::initDigits (void) +{ +Digit[0] = digit(true,true,true,false,true,true,true); +Digit[1] = digit(false,false,true,false,false,true,false); +Digit[2] = digit(true,false,true,true,true,false,true); +Digit[3] = digit(true,false,true,true,false,true,true); +Digit[4] = digit(false,true,true,true,false,true,false); +Digit[5] = digit(true,true,false,true,false,true,true); +Digit[6] = digit(true,true,false,true,true,true,true); +Digit[7] = digit(true,false,true,false,false,true,false); +Digit[8] = digit(true,true,true,true,true,true,true); +Digit[9] = digit(true,true,true,true,false,true,true); +Digit[10] = digit(false,false,false,false,false,false,false); +} + +void KLCDNumber::resizeEvent ( TQResizeEvent *) +{ + if (setUserChangeValue) + { + upBtn->setGeometry(width()-BUTTONWIDTH,0,BUTTONWIDTH,height()); + downBtn->setGeometry(0,0,BUTTONWIDTH,height()); + } +} + +void KLCDNumber::drawVerticalBar(TQPainter *qpaint,int x,int y,int w,int h,int d) +{ + /* If d is 0 it means that it is a bar on the left and if 1 it is on the right */ + /* + |\ /| + | | | | + | | = 0 1 = | | + | | | | + |/ \| + */ + + y++; + h-=2; + if (d==0) + { + for (int i=x;idrawLine(i,y,i,y+h); + y++; + h-=2; + } + } else { + for (int i=x+w;i>x;i--) + { + qpaint->drawLine(i,y,i,y+h); + y++; + h-=2; + } + } +} + +void KLCDNumber::drawHorizBar(TQPainter *qpaint,int x,int y,int w,int h,int d) +{ + // 0 is upper, 1 is bottom and 2 is the middle bar. + x++; + w-=3; + if (d==0) + { + for (int i=y;idrawLine(x,i,x+w,i); + x++; + w-=2; + } + } + else if (d==1) + { + for (int i=y+h;i>y;i--) + { + qpaint->drawLine(x,i,x+w,i); + x++; + w-=2; + } + } + else + { + for (int i=0;i<=h/2;i++) + { + qpaint->drawLine(x,y-i,x+w,y-i); + qpaint->drawLine(x,y+i,x+w,y+i); + x++; + w-=2; + } + + }; + +} + +void KLCDNumber::drawDigit(TQPainter *qpaint,int x,int y,int w,int h,digit d) +{ +if (d.nw) drawVerticalBar(qpaint,x,y,w/5,h/2,0); +if (d.ne) drawVerticalBar(qpaint,x+w*4/5,y,w/5,h/2,1); +if (d.sw) drawVerticalBar(qpaint,x,y+h/2,w/5,h/2,0); +if (d.se) drawVerticalBar(qpaint,x+w*4/5,y+h/2,w/5,h/2,1); +if (d.up) drawHorizBar (qpaint,x,y,w,w/5,0); +if (d.bt) drawHorizBar (qpaint,x,y+h-w/5,w,w/5,1); +if (d.md) drawHorizBar (qpaint,x,y+h/2,w,w/5,2); +} + + +void KLCDNumber::setValue(double v) +{ + oldvalue=value; + if (vmaxValue) + value=maxValue; + else + value=v; + +} + +void KLCDNumber::display (double v) +{ + setValue(v); + repaint(FALSE); +} + +void KLCDNumber::display (int v) +{ + display((double)v); +} + + +void KLCDNumber::paintEvent ( TQPaintEvent * ) +{ + TQPainter qpaint(this); + qpaint.fillRect(0,0,width(),height(),backgcolor); + qpaint.setPen(LCDcolor); + + TQString numStr; + numStr.setNum((int) value); + numStr = numStr.rightJustify( numDigits, ' ', true); + + int dx,dy,dw,dh; + if (setUserChangeValue) + { + dx=BUTTONWIDTH; + dy=height()/10; + dh=height()-dy*2; + dw=(width()-(BUTTONWIDTH*2))/numDigits; + } else + { + dx=0; + dy=height()/10; + dh=height()-dy*2; + dw=width()/numDigits; + }; + int sep=dw/10; + + for(int i=0; i < numDigits; i++) + { + char dig = numStr[i].latin1(); + if ((dig>='0')&&(dig<='9')) + drawDigit(&qpaint,dx+sep,dy,dw-sep*2,dh,Digit[dig-'0']); + else + drawDigit(&qpaint,dx+sep,dy,dw-sep*2,dh,KLCDNumber::Digit[10]); + dx+=dw; + }; +} + +void KLCDNumber::setUserSetDefaultValue(bool _userSetDefaultValue) +{ + if (setUserDefaultValue!=_userSetDefaultValue) + { + setUserDefaultValue=_userSetDefaultValue; + /* if (setUserDefaultValue) + connect(); + else + disconnect(); + */ + } + +} + +void KLCDNumber::setDefaultValue(double v) +{ + defaultValue=v; +} + + +void KLCDNumber::decreaseValue() +{ + display( value-1 ); + emit valueChanged( value ); +} + +void KLCDNumber::increaseValue() +{ + display( value+1 ); + emit valueChanged( value ); +} + +void KLCDNumber::decreaseValueFast() +{ + display( value-1 ); +} + +void KLCDNumber::increaseValueFast() +{ + display( value+1 ); +} + +void KLCDNumber::mouseDoubleClickEvent (TQMouseEvent *) +{ + doubleclicked=true; + defaultValueClicked(); +} + +void KLCDNumber::mousePressEvent (TQMouseEvent *e) +{ + startTimer(200); + TQWidget::mousePressEvent(e); +} + +void KLCDNumber::timerEvent(TQTimerEvent *) +{ + TQT_TQOBJECT(this)->killTimers(); + doubleclicked=false; + +} + + +void KLCDNumber::defaultValueClicked() +{ + if (setUserDefaultValue) + { + display( defaultValue ); + emit valueChanged( value ); + } +} + +void KLCDNumber::setLCDBackgroundColor(int r,int g,int b) +{ + backgcolor=TQColor(r,g,b); + repaint(FALSE); +} + +void KLCDNumber::setLCDColor(int r,int g,int b) +{ + LCDcolor=TQColor(r,g,b); + repaint(FALSE); +} + +void KLCDNumber::setRange(double min, double max) +{ + minValue=min; + maxValue=max; +} + +TQSize KLCDNumber::sizeHint() +{ + return TQSize(83,28); +} +#include "klcdnumber.moc" diff --git a/tdemid/klcdnumber.h b/tdemid/klcdnumber.h new file mode 100644 index 00000000..b124a5db --- /dev/null +++ b/tdemid/klcdnumber.h @@ -0,0 +1,154 @@ +/************************************************************************** + + klcdnumber.h - The KLCDNumber widget (displays a lcd number) + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _klcdnumber_h_ +#define _klcdnumber_h_ + +#include + +class TQPainter; +class KTriangleButton; +class TQColor; + +class KLCDNumber : public TQWidget +{ + Q_OBJECT + +protected: + class digit { +public: + digit() + : up(false), nw(false), ne(false), md(false), + sw(false), se(false), bt(false) { } + digit( bool _up, bool _nw, bool _ne, + bool _md, bool _sw, bool _se, bool _bt) + : up(_up), nw(_nw), ne(_ne), md(_md), + sw(_sw), se(_se), bt(_bt) { } + bool up; + bool nw; + bool ne; + bool md; + bool sw; + bool se; + bool bt; + }; + /* + up + --- + nw| |ne + |___|<------ md + | | + sw|___|se + bt + */ + + + KLCDNumber::digit Digit[11]; +/* +={ + / 0 / {true,true,true,false,true,true,true}, + / 1 / {false,false,true,false,false,true,false}, + / 2 / {true,false,true,true,true,false,true}, + / 3 / {true,false,true,true,false,true,true}, + / 4 / {false,true,true,true,false,true,false}, + / 5 / {true,true,false,true,false,true,true}, + / 6 / {true,true,false,true,true,true,true}, + / 7 / {true,false,true,false,false,true,false}, + / 8 / {true,true,true,true,true,true,true}, + / 9 / {true,true,true,true,false,true,true}, + / / {false,false,false,false,false,false,false} + };*/ + + int numDigits; + bool setUserChangeValue; + bool setUserDefaultValue; + bool doubleclicked; + + TQColor backgcolor; + TQColor LCDcolor; + + double value; + double oldvalue; + double defaultValue; + + double minValue; + double maxValue; + + void drawVerticalBar(TQPainter *qpaint,int x,int y,int w,int h,int d); + void drawHorizBar(TQPainter *qpaint,int x,int y,int w,int h,int d); + void drawDigit(TQPainter *qpaint,int x,int y,int w,int h,digit d); + + void initDigits(void); + +public: + KLCDNumber(int _numDigits,TQWidget *parent,const char *name); + KLCDNumber(bool _setUserChangeValue,int _numDigits,TQWidget *parent,const char *name); + + void setUserSetDefaultValue(bool _userSetDefaultValue); + void setDefaultValue(double v); + + void setValue(double v); + double getValue(void) { return value; }; + double getOldValue(void) { return oldvalue; }; + + double getMinValue(void) { return minValue;}; + double getMaxValue(void) { return maxValue;}; + void setRange(double min, double max); + + void setLCDBackgroundColor (int r,int g,int b); + void setLCDColor (int r,int g,int b); + + void display (int v); + void display (double v); + + TQSize sizeHint (); +// TQSizePolicy sizePolicy(); + +protected: + + virtual void paintEvent ( TQPaintEvent *e ); + virtual void resizeEvent ( TQResizeEvent *e); + virtual void mouseDoubleClickEvent (TQMouseEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); + virtual void timerEvent(TQTimerEvent *e); + void defaultValueClicked(); + + KTriangleButton *downBtn; + KTriangleButton *upBtn; + + + +public slots: + + void decreaseValue(); + void increaseValue(); + void decreaseValueFast(); + void increaseValueFast(); + +signals: + + void valueChanged(double v); + +}; + +#endif diff --git a/tdemid/ktrianglebutton.cpp b/tdemid/ktrianglebutton.cpp new file mode 100644 index 00000000..5bda855f --- /dev/null +++ b/tdemid/ktrianglebutton.cpp @@ -0,0 +1,164 @@ +/************************************************************************** + + ktrianglebutton.cpp - The KTriangleButton widget (button with an arrow) + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + + Note: This widget was based on KButton as found in the tdelibs/tdeui + KButton was originally copyrighted by Torben Weis (weis@kde.org) + and Matthias Ettrich (ettrich@kde.org) on 1997 + +***************************************************************************/ +#include "ktrianglebutton.h" +#include +#include +#include + +KTriangleButton::KTriangleButton( Direction d,TQWidget *_parent, const char *name ) + : TQButton( _parent , name) +{ + dir=d; + raised = FALSE; + setFocusPolicy( TQ_NoFocus ); +} + +KTriangleButton::~KTriangleButton() +{ +} + +void KTriangleButton::enterEvent( TQEvent* ) +{ + if ( isEnabled() ) + { + raised = TRUE; + repaint(FALSE); + } +} + +void KTriangleButton::leaveEvent( TQEvent * ) +{ + if( raised != FALSE ) + { + raised = FALSE; + repaint(); + } +} + + +void KTriangleButton::drawButton( TQPainter *_painter ) +{ + paint( _painter ); +} + +void KTriangleButton::drawButtonLabel( TQPainter *_painter ) +{ + paint( _painter ); +} + +void KTriangleButton::paint( TQPainter *painter ) +{ + if ( isDown() || isOn() ) + { + if ( style().styleHint(TQStyle::SH_GUIStyle) == WindowsStyle ) + qDrawWinButton( painter, 0, 0, width(), + height(), colorGroup(), TRUE ); + else + qDrawShadePanel( painter, 0, 0, width(), + height(), colorGroup(), TRUE, 2, 0L ); + } + else if ( raised ) + { + if ( style().styleHint(TQStyle::SH_GUIStyle) == WindowsStyle ) + qDrawWinButton( painter, 0, 0, width(), height(), + colorGroup(), FALSE ); + else + qDrawShadePanel( painter, 0, 0, width(), height(), + colorGroup(), FALSE, 2, 0L ); + } + + if (dir==Right) + { + int x=width()/4; + int y=height()/6; + int l=height()-y*2; + int i=0; + int maxi=width()-2*x; + double m=(double)(l/2)/maxi; + while (i<=maxi) + { + painter->drawLine(x,y+(int)(i*m),x,y+l-(int)(i*m)); + x++; + i++; + }; + } + else if (dir==Left) + { + int x=width()/4; + int y=height()/6; + int l=height()-y*2; + int i=0; + int maxi=width()-2*x; + x=width()-x; + double m=(double)(l/2)/maxi; + while (i<=maxi) + { + painter->drawLine(x,y+(int)(i*m),x,y+l-(int)(i*m)); + x--; + i++; + }; + + }; + +} + +void KTriangleButton::mousePressEvent(TQMouseEvent *e) +{ + TQButton::mousePressEvent(e); + usingTimer=true; + startTimer(500); + timeCount=0; + +} + +void KTriangleButton::mouseReleaseEvent(TQMouseEvent *e) +{ + usingTimer=false; + TQButton::mouseReleaseEvent(e); +} + +void KTriangleButton::timerEvent(TQTimerEvent *) +{ + if (!usingTimer) {TQT_TQOBJECT(this)->killTimers();return;}; + if (timeCount==0) + { + timeCount++; + TQT_TQOBJECT(this)->killTimers(); + startTimer(120); + } else + if (timeCount==30) + { + timeCount=-1; + TQT_TQOBJECT(this)->killTimers(); + startTimer(80); + } + else if (timeCount>0) timeCount++; + emit clickedQuickly(); + +} +#include "ktrianglebutton.moc" diff --git a/tdemid/ktrianglebutton.h b/tdemid/ktrianglebutton.h new file mode 100644 index 00000000..5013b8d8 --- /dev/null +++ b/tdemid/ktrianglebutton.h @@ -0,0 +1,74 @@ +/************************************************************************** + + ktrianglebutton.h - The KTriangleButton widget (button with an arrow) + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + + Note: This widget was copied from KButton as found in the tdelibs/tdeui + KButton was originally copyrighted by Torben Weis (weis@kde.org) + and Matthias Ettrich (ettrich@kde.org) on 1997 + +***************************************************************************/ +#ifndef _ktrianglebutton_h_ +#define _ktrianglebutton_h_ + +#include + +class KTriangleButton : public TQButton +{ + Q_OBJECT + + +public: + enum Direction {Left , Right, Up, Down}; + /* + Up and Down are not implemented, feel free to implement them yourself + if you need them :-) + */ +protected: + + Direction dir; + bool usingTimer; + int timeCount; + +public: + KTriangleButton( Direction d,TQWidget *_parent = 0L, const char *name = 0L ); + ~KTriangleButton(); + + virtual void leaveEvent( TQEvent *_ev ); + virtual void enterEvent( TQEvent *_ev ); + + virtual void drawButton( TQPainter *_painter ); + virtual void drawButtonLabel( TQPainter *_painter ); + + void paint( TQPainter *_painter ); + +signals: + void clickedQuickly(); + +protected: + bool raised; + + virtual void mousePressEvent(TQMouseEvent *e); + virtual void mouseReleaseEvent(TQMouseEvent *e); + virtual void timerEvent(TQTimerEvent *); + +}; + +#endif diff --git a/tdemid/main.cpp b/tdemid/main.cpp new file mode 100644 index 00000000..a35647e0 --- /dev/null +++ b/tdemid/main.cpp @@ -0,0 +1,101 @@ +/************************************************************************** + + main.cpp - The main function for KMid + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "tdemidframe.h" +#include "tdemid_part.h" +#include "version.h" + +int main(int argc, char **argv) +{ + printf("%s Copyright (C) 1997,98,99,2000,01 Antonio Larrosa Jimenez. Malaga (Spain)\n",VERSION_TXT); + printf("KMid comes with ABSOLUTELY NO WARRANTY; for details view file COPYING\n"); + printf("This is free software, and you are welcome to redistribute it\n"); + printf("under certain conditions\n\n"); + + TQTextCodec::setCodecForCStrings(TQTextCodec::codecForLocale()); +/* + struct sigaction act; + act.sa_handler = SIG_DFL; + sigemptyset(&(act.sa_mask)); + act.sa_flags=0; + + sigaction(SIGINT, &act, NULL); + sigaction(SIGTERM, &act, NULL); +*/ + + TDECmdLineArgs::init(argc, argv, KMidFactory::aboutData() ); + + static KCmdLineOptions options[] = + { + { "+file", I18N_NOOP("File to open"), 0 }, + KCmdLineLastOption + }; + TDECmdLineArgs::addCmdLineOptions(options); + + TDEApplication app; + + tdemidFrame *tdemidframe=new tdemidFrame("KMid"); + + app.setMainWidget ( tdemidframe ); + + TQObject::connect(&app,TQT_SIGNAL(shutDown()),tdemidframe,TQT_SLOT(shuttingDown())); + + if (app.isRestored()) + { + if (tdemidframe->canBeRestored(1)) tdemidframe->restore(1); + } + + tdemidframe->show(); + + //CT TDEIOJob::initStatic(); + +/* + if (app->isRestored()) + { + RESTORE(tdemidFrame); + } + else + { + tdemidFrame *tdemidframe=new tdemidFrame("KMid"); + tdemidframe->show(); + }; +*/ + + + + return app.exec(); +} + diff --git a/tdemid/maps/Makefile.am b/tdemid/maps/Makefile.am new file mode 100644 index 00000000..7ee025c9 --- /dev/null +++ b/tdemid/maps/Makefile.am @@ -0,0 +1,5 @@ + +maps_DATA = gm.map YamahaPSS790.map YamahaPSR500.map YamahaQY10.map +mapsdir = $(kde_datadir)/tdemid/maps + +EXTRA_DIST = $(maps_DATA) diff --git a/tdemid/maps/YamahaPSR500.map b/tdemid/maps/YamahaPSR500.map new file mode 100644 index 00000000..16068c21 --- /dev/null +++ b/tdemid/maps/YamahaPSR500.map @@ -0,0 +1,293 @@ +# Blank lines and lines beginning with # are ignored +# This is a map for a Yamaha PSR-500 keyboard +# This file was done by Dietmar Schnabel (thanks !) + +# If you make a new map, please send it to Antonio, so future releases +# will include them. +# Antonio Larrosa Jimenez, larrosa@kde.org + +# General Midi Map File + +DEFINE PATCHMAP +AcusticPiano =0 +BrightPiano =0 +SynthPiano =3 +HonkyTonky =2 +ElectricPiano1=4 +ElectricPiano2=5 +Harpsichord =6 +Clavinet =8 +Celeste =9 +Glockenspiel =40 +Musicbox =41 +Vibes =40 +Marimba =41 +Xylophon =41 +TubeBell =41 +Santur =42 +HomeOrg =12 +PercussionOrg =13 +RockOrg =14 +ChurchOrg =10 +ReedOrg =11 +Accordion =16 +Harmonica =17 +Concrtna =17 +NylonGuitar =29 +AcusticGuitar =31 +JazzGuitar =24 +CleanGuitar =19 +MuteGuitar =26 +OdGuitar =18 +DistortionGuit=23 +GtrHarm =20 +AcusticBass =88 +FingerBass =89 +PickBass =87 +FretlessBass =84 +SlapBass1 =87 +SlapBass2 =87 +SynthBass1 =90 +SynthBass2 =91 +Violin =32 +Viola =33 +Cello =34 +Contrabajo =33 +Marcato =34 +Pizzicato =38 +Harp =38 +Timpani =33 +Marcato =34 +SlowStrings =35 +SynthStrings1 =36 +SynthStrings2 =75 +Choir =72 +Doo =72 +Voices =72 +OrchestraHit =37 +Trumpet =43 +Trombone =47 +Tuba =50 +MuteTrumpet =44 +FrenchHorn =49 +HitBrass =51 +SynthBrass1 =52 +SynthBrass2 =74 +SopranoSax =60 +AltoSax =61 +TenorSax =62 +BaritoneSax =63 +Oboe =57 +EnglishHorn =58 +Bassoon =59 +Clarinet =55 +Piccolo =53 +Flute =54 +Recorder =66 +WoodFlute =65 +Bottle =55 +Shakazul =55 +Whistle =68 +Ocarina =79 +SquareWave =80 +SawWave =81 +Calliope =82 +Chiflead =83 +Charang =84 +VoxLead =85 +Lead5th =86 +BassLead =87 +Fantasia =88 +WarmPad =89 +Polysyn =90 +Ghostie =91 +BowGlass =92 +MetalPad =93 +HaloPad =94 +Sweeper =95 +Aurora =72 +SoundTrack =72 +Crystal =72 +Atmosphear =72 +FreshAir =100 +Unicorn =101 +Sweeper =102 +StarTrak =103 +Sitar =104 +Banjo =105 +Shamisen =106 +Koto =107 +Kalimba =108 +BagPipes =109 +Fiddle =110 +Shannai =111 +Carillon =112 +Agogo =113 +SteelDrm =114 +WoodBlk =115 +Taiko =116 +Toms =117 +Syntom =118 +RevCymbal =119 +Fx-Fret =120 +Fx-Blow =121 +Seashore =122 +Jungle =123 +Telephon =124 +Helicopter =125 +Applause =126 +Gunshot =127 +END + +DEFINE KEYMAP "Drumset" +C 0 =0 +C#0 =1 +D 0 =2 +D#0 =3 +E 0 =4 +F 0 =5 +F#0 =6 +G 0 =7 +G#0 =8 +A 0 =9 +A#0 =10 +B 0 =11 +C 1 =12 +C#1 =13 +D 1 =14 +D#1 =15 +E 1 =16 +F 1 =17 +F#1 =18 +G 1 =19 +G#1 =20 +A 1 =21 +A#1 =22 +B 1 =23 +C 2 =24 +C#2 =25 +D 2 =26 +D#2 27 Highq =27 +E 2 28 Slap =54 +F 2 29 Scratch1 =62 +F#2 30 Scratch2 =63 +G 2 31 Sticks =22 +G#2 32 SqrClick =87 +A 2 33 MetaClick=57 +A#2 34 MetBell =55 +B 2 35 Kick1 =44 +C 3 36 Kick2 =45 +C#3 37 StickRim =27 +D 3 38 Snare1 =28 +D#3 39 Claps =30 +E 3 40 snare2 =25 +F 3 41 tomlo2 =24 +F#3 42 Hihatclos=72 +G 3 43 Tomlo1 =17 +G#3 44 HihatPd =56 +A 3 45 Tommid2 =26 +A#3 46 Hihatop =35 +B 3 47 Tommid1 =18 +C 4 48 Tomhi2 =29 +C#4 49 Cymbalcrsh1 =36 +D 4 50 Tomhi1 =19 +D#4 51 Cymbalride1 =38 +E 4 52 Cymbalchina =38 +F 4 53 Cymbell =38 +F#4 54 Tamborin =47 +G 4 55 CymbalSplash=37 +G#4 56 Cowbell =31 +A 4 57 Cymbalcrash2=36 +A#4 58 Vibslap =39 +B 4 59 Cymbalride2 =39 +C 5 60 Bongohi =44 +C#5 61 Bongolo =43 +D 5 62 Congahi1 =41 +D#5 63 congahi2 =42 +E 5 64 Congalo =40 +F 5 65 Timbalehi=46 +F#5 66 Timbalelo=45 +G 5 67 Agogohi =51 +G#5 68 Agogolo =50 +A 5 69 Cabasa =32 +A#5 70 Maracas =65 +B 5 71 whistle1 =52 +C 6 72 whistle2 =53 +C#6 73 Guiro1 =74 +D 6 74 Guiro2 =74 +D#6 75 Clave =29 +E 6 76 Woodblock1=73 +F 6 77 Woodblock2=72 +F#6 78 Cuica1 =76 +G 6 79 Cuica2 =77 +G#6 80 Triangle1=13 +A 6 81 Triangle2=15 +A#6 82 Shaker =56 +B 6 83 Jingles =75 +C 7 84 Belltree =71 +C#7 85 Canstinet=85 +D 7 86 Surdo1 =86 +D#7 87 Surdo2 =87 +E 7 =88 +F 7 =89 +F#7 =90 +G 7 =91 +G#7 =92 +A 7 =93 +A#7 =94 +B 7 =95 +C 8 =96 +C#8 =97 +D 8 =98 +D#8 =99 +E 8 =100 +F 8 =101 +F#8 =102 +G 8 =103 +G#8 =104 +A 8 =105 +A#8 =106 +B 8 =107 +C 9 =108 +C#9 =109 +D 9 =110 +D#9 =111 +E 9 =112 +F 9 =113 +F#9 =114 +G 9 =115 +G#9 =116 +A 9 =117 +A#9 =118 +B 9 =119 +C 10=120 +C#10=121 +D 10=122 +D#10=123 +E 10=124 +F 10=125 +F#10=126 +G 10=127 +# This line should be ignored +END + + +DEFINE CHANNELMAP +0 = 0 +1 = 1 +2 = 2 +3 = 3 +4 = 4 +5 = 5 +6 = 6 +7 = 7 +8 = 8 +9 = 9 Keymap "Drumset" ForcePatch 99 +10 = 10 +11 = 11 +12 = 12 +13 = 13 +14 = 14 +15 = 15 +END + diff --git a/tdemid/maps/YamahaPSS790.map b/tdemid/maps/YamahaPSS790.map new file mode 100644 index 00000000..5017832e --- /dev/null +++ b/tdemid/maps/YamahaPSS790.map @@ -0,0 +1,299 @@ +# Blank lines and lines beginning with # are ignored +# This is my a map for the Yamaha PSS-790 keyboard +# it can be used as a template to make any new map for any +# other keyboard. +# If you make a new map, please send it to me, so future releases +# will include it. +# Antonio Larrosa Jimenez, larrosa@kde.org + +# Yamaha PSS-790 Map File + +DEFINE PATCHMAP +AcusticPiano =3 +BrightPiano =3 +SynthPiano =54 +HonkyTonky =25 +ElectricPiano1=25 +ElectricPiano2=25 +Harpsichord =53 +Clavinet =30 +Celeste =6 +Glockenspiel =64 +Musicbox =24 +Vibes =28 +Marimba =8 +Xylophon =24 +TubeBell =95 +Santur =30 +HomeOrg =1 +PercussionOrg =2 +RockOrg =11 +ChurchOrg =29 +ReedOrg =49 +Accordion =31 +Harmonica =22 +Concrtna =3 +NylonGuitar =36 +AcusticGuitar =68 +JazzGuitar =122 +CleanGuitar =68 +MuteGuitar =12 +OdGuitar =123 +DistortionGuit=13 +GtrHarm =72 +AcusticBass =38 +FingerBass =39 +PickBass =79 +FretlessBass =80 +SlapBass1 =14 +SlapBass2 =81 +SynthBass1 =58 +SynthBass2 =86 +Violin =10 +Viola =67 +Cello =67 +Contrabajo =41 +Marcato =41 +Pizzicato =78 +Harp =37 +Timpani =66 +Marcato =41 +SlowStrings =50 +SynthStrings1 =41 +SynthStrings2 =50 +Choir =96 +Doo =94 +Voices =96 +OrchestraHit =90 +Trumpet =15 +Trombone =16 +Tuba =84 +MuteTrumpet =44 +FrenchHorn =17 +HitBrass =92 +SynthBrass1 =0 +SynthBrass2 =82 +SopranoSax =101 +AltoSax =18 +TenorSax =102 +BaritoneSax =101 +Oboe =19 +EnglishHorn =87 +Bassoon =87 +Clarinet =19 +Piccolo =103 +Flute =20 +Recorder =88 +WoodFlute =111 +Bottle =111 +Shakazul =110 +Whistle =88 +Ocarina =93 +SquareWave =54 +SawWave =54 +Calliope =22 +Chiflead =9 +Charang =19 +VoxLead =96 +Lead5th =41 +BassLead =95 +Fantasia =111 +WarmPad =51 +Polysyn =60 +Ghostie =94 +BowGlass =33 +MetalPad =9 +HaloPad =111 +Sweeper =78 +Aurora =60 +SoundTrack =84 +Crystal =60 +Atmosphear =51 +FreshAir =60 +Unicorn =93 +Sweeper =112 +StarTrak =117 +Sitar =73 +Banjo =34 +Shamisen =73 +Koto =70 +Kalimba =73 +BagPipes =11 +Fiddle =67 +Shannai =11 +Carillon =64 +Agogo =91 +SteelDrm =9 +WoodBlk =35 +Taiko =100 AllKeysTo 60 +Toms =66 +Syntom =85 +RevCymbal =100 AllKeysTo 60 +Fx-Fret =121 +Fx-Blow =94 +Seashore =100 AllKeysTo 79 +Jungle =70 +Telephon =91 +Helicopter =111 +Applause =100 AllKeysTo 79 +Gunshot =100 AllKeysTo 38 + +END + +DEFINE KEYMAP "Drumset" +C 0 =0 +C#0 =1 +D 0 =2 +D#0 =3 +E 0 =4 +F 0 =5 +F#0 =6 +G 0 =7 +G#0 =8 +A 0 =9 +A#0 =10 +B 0 =11 +C 1 =12 +C#1 =13 +D 1 =14 +D#1 =15 +E 1 =16 +F 1 =17 +F#1 =18 +G 1 =19 +G#1 =20 +A 1 =21 +A#1 =22 +B 1 =23 +C 2 =24 +C#2 =25 +D 2 =26 +D#2 27 Highq =27 +E 2 28 Slap =54 +F 2 29 Scratch1 =29 +F#2 30 Scratch2 =30 +G 2 31 Sticks =46 +G#2 32 SqrClick =87 +A 2 33 MetaClick=57 +A#2 34 MetBell =55 +B 2 35 AcousticBassDrum=44 +C 3 36 BassDrum1=47 +C#3 37 StickRim =46 +D 3 38 AcSnare =47 +D#3 39 Claps =63 +E 3 40 ElectSnare =49 +F 3 41 LowFloorTom =48 +F#3 42 Hihatclos =57 +G 3 43 HighFloorTom=50 +G#3 44 PedalHihat =80 +A 3 45 LowTom =47 +A#3 46 OpenHihat =59 +B 3 47 LowMidTom =48 +C 4 48 HiMidTom =50 +C#4 49 Cymbalcrsh1 =60 +D 4 50 HiTom =53 +D#4 51 Cymbalride1 =63 +E 4 52 Cymbalchina =60 +F 4 53 RideBell =62 +F#4 54 Tambourin =71 +G 4 55 CymbalSplash=61 +G#4 56 Cowbell =55 +A 4 57 Cymbalcrash2=60 +A#4 58 Vibraslap =79 +B 4 59 Cymbalride2 =62 +C 5 60 Bongohi =68 +C#5 61 Bongolo =67 +D 5 62 MuteHiConga =66 +D#5 63 OpenHiConga =65 +E 5 64 LowConga =64 +F 5 65 HiTimbale =70 +F#5 66 LoTimbale =69 +G 5 67 HiAgogo =75 +G#5 68 LoAgogo =74 +A 5 69 Cabasa =56 +A#5 70 Maracas =56 +B 5 71 ShortWhistle=78 +C 6 72 LongWhistle =78 +C#6 73 ShortGuiro =79 +D 6 74 LongGuiro =71 +D#6 75 Clave =72 +E 6 76 HiWoodBlock =73 +F 6 77 LoWoodBlock =72 +F#6 78 MuteCuica =77 +G 6 79 OpenCuica =76 +G#6 80 MuteTriangle=37 +A 6 81 OpenTriangle=39 +A#6 82 Shaker =56 +B 6 83 Jingles =75 +C 7 84 Belltree =63 +C#7 85 Canstinet=85 +D 7 86 Surdo1 =86 +D#7 87 Surdo2 =87 +E 7 =88 +F 7 =89 +F#7 =90 +G 7 =91 +G#7 =92 +A 7 =93 +A#7 =94 +B 7 =95 +C 8 =96 +C#8 =97 +D 8 =98 +D#8 =99 +E 8 =100 +F 8 =101 +F#8 =102 +G 8 =103 +G#8 =104 +A 8 =105 +A#8 =106 +B 8 =107 +C 9 =108 +C#9 =109 +D 9 =110 +D#9 =111 +E 9 =112 +F 9 =113 +F#9 =114 +G 9 =115 +G#9 =116 +A 9 =117 +A#9 =118 +B 9 =119 +C 10=120 +C#10=121 +D 10=122 +D#10=123 +E 10=124 +F 10=125 +F#10=126 +G 10=127 +# This line should be ignored +END + + +DEFINE CHANNELMAP +0 = 0 +1 = 1 +2 = 2 +3 = 3 +4 = 4 +5 = 5 +6 = 6 +7 = 7 +8 = 8 +9 = 15 Keymap "Drumset" ForcePatch 100 +10 = 10 +11 = 11 +12 = 12 +13 = 13 +14 = 14 +15 = 9 +END + +OPTIONS +PitchBenderRatio = 672 +MapExpressionToVolumeEvents +END + diff --git a/tdemid/maps/YamahaQY10.map b/tdemid/maps/YamahaQY10.map new file mode 100644 index 00000000..1a4914b4 --- /dev/null +++ b/tdemid/maps/YamahaQY10.map @@ -0,0 +1,305 @@ +# Midi map file for the Yamaha QY10 "walkstation", a basic sequencer / tone +# module. + +# Provided by Malcolm Tyrrell. If there is a problem with this file, please +# e-mail tyrrelmr@cs.tcd.ie + +# If you make a new map, please send it to Antonio, so future releases +# will include them. +# Antonio Larrosa Jimenez, larrosa@kde.org + +# Yamaha QY10 Map File + +DEFINE PATCHMAP +AcusticPiano =0 +BrightPiano =0 +SynthPiano =1 +HonkyTonky =0 +ElectricPiano1=1 +ElectricPiano2=2 +Harpsichord =3 +Clavinet =3 +Celeste =18 +Glockenspiel =18 +Musicbox =20 +Vibes =19 +Marimba =18 +Xylophon =20 +TubeBell =19 +Santur =12 +HomeOrg =4 +PercussionOrg =4 +RockOrg =4 +ChurchOrg =5 +ReedOrg =5 +Accordion =5 +Harmonica =23 +Concrtna =23 +NylonGuitar =12 +AcusticGuitar =12 +JazzGuitar =9 +CleanGuitar =9 +MuteGuitar =11 +OdGuitar =9 +DistortionGuit=10 +GtrHarm =25 +AcusticBass =13 +FingerBass =14 +PickBass =14 +FretlessBass =13 +SlapBass1 =15 +SlapBass2 =15 +SynthBass1 =16 +SynthBass2 =16 +Violin =23 +Viola =23 +Cello =23 +Contrabajo =23 +Marcato =6 +Pizzicato =16 +Harp =12 +Timpani =20 +Marcato =6 +SlowStrings =6 +SynthStrings1 =22 +SynthStrings2 =22 +Choir =27 +Doo =21 +Voices =21 +OrchestraHit =8 +Trumpet =26 +Trombone =26 +Tuba =21 +MuteTrumpet =8 +FrenchHorn =26 +HitBrass =8 +SynthBrass1 =21 +SynthBrass2 =21 +SopranoSax =26 +AltoSax =26 +TenorSax =26 +BaritoneSax =26 +Oboe =27 +EnglishHorn =26 +Bassoon =27 +Clarinet =27 +Piccolo =27 +Flute =27 +Recorder =27 +WoodFlute =27 +Bottle =27 +Shakazul =27 +Whistle =27 +Ocarina =27 +SquareWave =28 +SawWave =28 +Calliope =29 +Chiflead =29 +Charang =24 +VoxLead =21 +Lead5th =21 +BassLead =21 +Fantasia =24 +WarmPad =21 +Polysyn =22 +Ghostie =27 +BowGlass =26 +MetalPad =21 +HaloPad =27 +Sweeper =24 +Aurora =31 +SoundTrack =21 +Crystal =19 +Atmosphear =24 +FreshAir =21 +Unicorn =24 +Sweeper =24 +StarTrak =21 +Sitar =9 +Banjo =9 +Shamisen =12 +Koto =12 +Kalimba =18 +BagPipes =28 +Fiddle =28 +Shannai =23 +Carillon =19 +Agogo =20 +SteelDrm =18 +WoodBlk =20 +Taiko =20 +Toms =18 +Syntom =18 +RevCymbal =31 +Fx-Fret =31 +Fx-Blow =31 +Seashore =31 +Jungle =31 +Telephon =5 +Helicopter =31 +Applause =31 +Gunshot =31 +END + +DEFINE KEYMAP "Drumset" +C 0 =0 +C#0 =1 +D 0 =2 +D#0 =3 +E 0 =4 +F 0 =5 +F#0 =6 +G 0 =7 +G#0 =8 +A 0 =9 +A#0 =10 +B 0 =11 +C 1 =12 +C#1 =13 +D 1 =14 +D#1 =15 +E 1 =16 +F 1 =17 +F#1 =18 +G 1 =19 +G#1 =20 +A 1 =21 +A#1 =22 +B 1 =23 +C 2 =24 +C#2 =25 +D 2 =26 +# What is a high q? +D#2 27 Highq =40 +E 2 28 Slap =37 +F 2 29 Scratch1 =23 +F#2 30 Scratch2 =48 +G 2 31 Sticks =21 +G#2 32 SqrClick =42 +A 2 33 MetaClick=42 +A#2 34 MetBell =43 +B 2 35 Kick1 =36 +C 3 36 Kick2 =12 +C#3 37 StickRim =21 +D 3 38 Snare1 =15 +D#3 39 Claps =19 +E 3 40 snare2 =14 +F 3 41 tomlo2 =16 +F#3 42 Hihatclos=23 +G 3 43 Tomlo1 =16 +G#3 44 HihatPd =23 +A 3 45 Tommid2 =17 +A#3 46 Hihatop =24 +B 3 47 Tommid1 =17 +C 4 48 Tomhi2 =18 +C#4 49 Cymbalcrsh1 =20 +D 4 50 Tomhi1 =18 +D#4 51 Cymbalride1 =22 +E 4 52 Cymbalchina =22 +F 4 53 Cymbell =22 +F#4 54 Tamborin =21 +G 4 55 CymbalSplash=20 +G#4 56 Cowbell =37 +A 4 57 Cymbalcrash2=20 +A#4 58 Vibslap =0 +B 4 59 Cymbalride2 =22 +C 5 60 Bongohi =41 +C#5 61 Bongolo =40 +D 5 62 Congahi1 =41 +D#5 63 congahi2 =41 +E 5 64 Congalo =40 +F 5 65 Timbalehi=46 +F#5 66 Timbalelo=45 +G 5 67 Agogohi =44 +G#5 68 Agogolo =43 +A 5 69 Cabasa =48 +A#5 70 Maracas =48 +B 5 71 whistle1 =0 +C 6 72 whistle2 =0 +C#6 73 Guiro1 =0 +D 6 74 Guiro2 =0 +D#6 75 Clave =44 +E 6 76 Woodblock1=40 +F 6 77 Woodblock2=41 +# Don't know about the following two +F#6 78 Cuica1 =0 +G 6 79 Cuica2 =0 +G#6 80 Triangle1=44 +A 6 81 Triangle2=44 +A#6 82 Shaker =48 +B 6 83 Jingles =23 +C 7 84 Belltree =0 +C#7 85 Canstinet=21 +D 7 86 Surdo1 =16 +D#7 87 Surdo2 =17 +E 7 =88 +F 7 =89 +F#7 =90 +G 7 =91 +G#7 =92 +A 7 =93 +A#7 =94 +B 7 =95 +C 8 =96 +C#8 =97 +D 8 =98 +D#8 =99 +E 8 =100 +F 8 =101 +F#8 =102 +G 8 =103 +G#8 =104 +A 8 =105 +A#8 =106 +B 8 =107 +C 9 =108 +C#9 =109 +D 9 =110 +D#9 =111 +E 9 =112 +F 9 =113 +F#9 =114 +G 9 =115 +G#9 =116 +A 9 =117 +A#9 =118 +B 9 =119 +C 10=120 +C#10=121 +D 10=122 +D#10=123 +E 10=124 +F 10=125 +F#10=126 +G 10=127 +END + + +DEFINE CHANNELMAP +# The information on channels 7-8 and 11-15 is ignored since the QY10 is only +# 8 part multi-timbral. The polyphony should be okay. +0 = 0 +1 = 1 +2 = 2 +3 = 3 +4 = 4 +5 = 5 +6 = 6 +# The next two channels are ignored +7 = 9 +8 = 8 +# Play GM channel 9 (drums) on QY10 track 7 (rhythm track) +9 = 7 Keymap "Drumset" ForcePatch 30 +# All the following channels are ignored. +10 = 10 +11 = 11 +12 = 12 +13 = 13 +14 = 14 +15 = 15 +END + +# I don't think the QY10 responds to Expression Events, so... +OPTIONS +MapExpressionToVolumeEvents +END diff --git a/tdemid/maps/gm.map b/tdemid/maps/gm.map new file mode 100644 index 00000000..fd188ec0 --- /dev/null +++ b/tdemid/maps/gm.map @@ -0,0 +1,290 @@ +# Blank lines and lines beginning with # are ignored +# This is a map for any General Midi synthesizer +# If you make a new map, please send it to me, so future releases +# will include them. +# Antonio Larrosa Jimenez, larrosa@kde.org + +# General Midi Map File + +DEFINE PATCHMAP +AcusticPiano =0 +BrightPiano =1 +SynthPiano =2 +HonkyTonky =3 +ElectricPiano1=4 +ElectricPiano2=5 +Harpsichord =6 +Clavinet =7 +Celeste =8 +Glockenspiel =9 +Musicbox =10 +Vibes =11 +Marimba =12 +Xylophon =13 +TubeBell =14 +Santur =15 +HomeOrg =16 +PercussionOrg =17 +RockOrg =18 +ChurchOrg =19 +ReedOrg =20 +Accordion =21 +Harmonica =22 +Concrtna =23 +NylonGuitar =24 +AcusticGuitar =25 +JazzGuitar =26 +CleanGuitar =27 +MuteGuitar =28 +OdGuitar =29 +DistortionGuit=30 +GtrHarm =31 +AcusticBass =32 +FingerBass =33 +PickBass =34 +FretlessBass =35 +SlapBass1 =36 +SlapBass2 =37 +SynthBass1 =38 +SynthBass2 =39 +Violin =40 +Viola =41 +Cello =42 +Contrabajo =43 +Marcato =44 +Pizzicato =45 +Harp =46 +Timpani =47 +Marcato =48 +SlowStrings =49 +SynthStrings1 =50 +SynthStrings2 =51 +Choir =52 +Doo =53 +Voices =54 +OrchestraHit =55 +Trumpet =56 +Trombone =57 +Tuba =58 +MuteTrumpet =59 +FrenchHorn =60 +HitBrass =61 +SynthBrass1 =62 +SynthBrass2 =63 +SopranoSax =64 +AltoSax =65 +TenorSax =66 +BaritoneSax =67 +Oboe =68 +EnglishHorn =69 +Bassoon =70 +Clarinet =71 +Piccolo =72 +Flute =73 +Recorder =74 +WoodFlute =75 +Bottle =76 +Shakazul =77 +Whistle =78 +Ocarina =79 +SquareWave =80 +SawWave =81 +Calliope =82 +Chiflead =83 +Charang =84 +VoxLead =85 +Lead5th =86 +BassLead =87 +Fantasia =88 +WarmPad =89 +Polysyn =90 +Ghostie =91 +BowGlass =92 +MetalPad =93 +HaloPad =94 +Sweeper =95 +Aurora =96 +SoundTrack =97 +Crystal =98 +Atmosphear =99 +FreshAir =100 +Unicorn =101 +Sweeper =102 +StarTrak =103 +Sitar =104 +Banjo =105 +Shamisen =106 +Koto =107 +Kalimba =108 +BagPipes =109 +Fiddle =110 +Shannai =111 +Carillon =112 +Agogo =113 +SteelDrm =114 +WoodBlk =115 +Taiko =116 +Toms =117 +Syntom =118 +RevCymbal =119 +Fx-Fret =120 +Fx-Blow =121 +Seashore =122 +Jungle =123 +Telephon =124 +Helicopter =125 +Applause =126 +Gunshot =127 +END + +DEFINE KEYMAP "Drumset" +C 0 =0 +C#0 =1 +D 0 =2 +D#0 =3 +E 0 =4 +F 0 =5 +F#0 =6 +G 0 =7 +G#0 =8 +A 0 =9 +A#0 =10 +B 0 =11 +C 1 =12 +C#1 =13 +D 1 =14 +D#1 =15 +E 1 =16 +F 1 =17 +F#1 =18 +G 1 =19 +G#1 =20 +A 1 =21 +A#1 =22 +B 1 =23 +C 2 =24 +C#2 =25 +D 2 =26 +D#2 27 Highq =27 +E 2 28 Slap =28 +F 2 29 Scratch1 =29 +F#2 30 Scratch2 =30 +G 2 31 Sticks =31 +G#2 32 SqrClick =32 +A 2 33 MetaClick=33 +A#2 34 MetBell =34 +B 2 35 Kick1 =35 +C 3 36 Kick2 =36 +C#3 37 StickRim =37 +D 3 38 Snare1 =38 +D#3 39 Claps =39 +E 3 40 snare2 =40 +F 3 41 tomlo2 =41 +F#3 42 Hihatclos=42 +G 3 43 Tomlo1 =43 +G#3 44 HihatPd =44 +A 3 45 Tommid2 =45 +A#3 46 Hihatop =46 +B 3 47 Tommid1 =47 +C 4 48 Tomhi2 =48 +C#4 49 Cymbalcrsh1 =49 +D 4 50 Tomhi1 =50 +D#4 51 Cymbalride1 =51 +E 4 52 Cymbalchina =52 +F 4 53 Cymbell =53 +F#4 54 Tamborin =54 +G 4 55 CymbalSplash=55 +G#4 56 Cowbell =56 +A 4 57 Cymbalcrash2=57 +A#4 58 Vibslap =58 +B 4 59 Cymbalride2 =59 +C 5 60 Bongohi =60 +C#5 61 Bongolo =61 +D 5 62 Congahi1 =62 +D#5 63 congahi2 =63 +E 5 64 Congalo =64 +F 5 65 Timbalehi=65 +F#5 66 Timbalelo=66 +G 5 67 Agogohi =67 +G#5 68 Agogolo =68 +A 5 69 Cabasa =69 +A#5 70 Maracas =70 +B 5 71 whistle1 =71 +C 6 72 whistle2 =72 +C#6 73 Guiro1 =73 +D 6 74 Guiro2 =74 +D#6 75 Clave =75 +E 6 76 Woodblock1=76 +F 6 77 Woodblock2=77 +F#6 78 Cuica1 =78 +G 6 79 Cuica2 =79 +G#6 80 Triangle1=80 +A 6 81 Triangle2=81 +A#6 82 Shaker =82 +B 6 83 Jingles =83 +C 7 84 Belltree =84 +C#7 85 Canstinet=85 +D 7 86 Surdo1 =86 +D#7 87 Surdo2 =87 +E 7 =88 +F 7 =89 +F#7 =90 +G 7 =91 +G#7 =92 +A 7 =93 +A#7 =94 +B 7 =95 +C 8 =96 +C#8 =97 +D 8 =98 +D#8 =99 +E 8 =100 +F 8 =101 +F#8 =102 +G 8 =103 +G#8 =104 +A 8 =105 +A#8 =106 +B 8 =107 +C 9 =108 +C#9 =109 +D 9 =110 +D#9 =111 +E 9 =112 +F 9 =113 +F#9 =114 +G 9 =115 +G#9 =116 +A 9 =117 +A#9 =118 +B 9 =119 +C 10=120 +C#10=121 +D 10=122 +D#10=123 +E 10=124 +F 10=125 +F#10=126 +G 10=127 +END + + +DEFINE CHANNELMAP +0 = 0 +1 = 1 +2 = 2 +3 = 3 +4 = 4 +5 = 5 +6 = 6 +7 = 7 +8 = 8 +9 = 9 +10 = 10 +11 = 11 +12 = 12 +13 = 13 +14 = 14 +15 = 15 +END + diff --git a/tdemid/midicfgdlg.cpp b/tdemid/midicfgdlg.cpp new file mode 100644 index 00000000..46577c28 --- /dev/null +++ b/tdemid/midicfgdlg.cpp @@ -0,0 +1,138 @@ +/************************************************************************** + + midicfgdlg.cpp - The midi config dialog + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "midicfgdlg.h" +#include "version.h" +#include +#include + +MidiConfigDialog::MidiConfigDialog(DeviceManager *dm, + TQWidget *parent,const char *name) : KDialogBase(parent,name,TRUE, + i18n("Configure MIDI Devices"), KDialogBase::Ok|KDialogBase::Cancel) +{ + setMinimumSize(360,240); + TQWidget *page = new TQWidget( this ); + setMainWidget(page); + + TQVBoxLayout *topLayout=new TQVBoxLayout(page, 0, spacingHint()); + TQLabel *label=new TQLabel(i18n("Select the MIDI device you want to use:"),page); + topLayout->addWidget(label); + mididevices=new TQListBox(page,"midideviceslist"); + topLayout->addWidget(mididevices,3); + connect(mididevices,TQT_SIGNAL(highlighted(int)),TQT_SLOT(deviceselected(int))); + devman=dm; + TQString temp; + for (int i=0;imidiPorts()+devman->synthDevices();i++) + { + if (strcmp(devman->type(i),"")!=0) + temp = TQString("%1 - %2").arg(devman->name(i)).arg(devman->type(i)); + else + temp = devman->name(i); + + mididevices->insertItem(temp,i); + }; + selecteddevice=devman->defaultDevice(); + mididevices->setCurrentItem(selecteddevice); + + TQLabel *label2=new TQLabel(i18n("Use the MIDI map:"),page); + topLayout->addWidget(label2); + + + if (selectedmap!=NULL) delete selectedmap; + if (strcmp(devman->midiMapFilename(),"")==0) + selectedmap=NULL; + else + { + selectedmap=new char[strlen(devman->midiMapFilename())+1]; + strcpy(selectedmap,devman->midiMapFilename()); + } + + if (selectedmap!=NULL) maplabel=new TQLabel(selectedmap,page); + else maplabel=new TQLabel(i18n("None"),page); + + topLayout->addWidget(maplabel); + + TQHBoxLayout *hbox=new TQHBoxLayout(topLayout); + hbox->addStretch(1); + mapbrowse=new TQPushButton(i18n("Browse..."),page); + hbox->addWidget(mapbrowse); + connect(mapbrowse,TQT_SIGNAL(clicked()),TQT_SLOT(browseMap()) ); + + mapnone=new TQPushButton(i18n("None"),page); + hbox->addWidget(mapnone); + connect(mapnone,TQT_SIGNAL(clicked()),TQT_SLOT(noMap()) ); + + topLayout->addStretch(1); + +} + +void MidiConfigDialog::deviceselected(int idx) +{ + selecteddevice=idx; +} + +void MidiConfigDialog::browseMap() +{ + TQString path = TDEGlobal::dirs()->findAllResources("appdata", "maps/*.map").last(); + path.truncate(path.findRev('/')); + + KURL url = KFileDialog::getOpenURL(path,"*.map",this); + + if( url.isEmpty() ) + return; + + if( !url.isLocalFile() ) + { + KMessageBox::sorry( 0L, i18n( "Only local files are currently supported." ) ); + return; + } + + TQString filename = url.path(); + + delete selectedmap; + selectedmap=new char[filename.length()+1]; + strcpy(selectedmap,TQFile::encodeName(filename)); + maplabel->setText(selectedmap); +} + +void MidiConfigDialog::noMap() +{ + if (selectedmap!=NULL) {delete selectedmap;selectedmap=NULL;}; + maplabel->setText(i18n("None")); +} + +int MidiConfigDialog::selecteddevice=0; +char *MidiConfigDialog::selectedmap=NULL; + +#include "midicfgdlg.moc" diff --git a/tdemid/midicfgdlg.h b/tdemid/midicfgdlg.h new file mode 100644 index 00000000..98585e6f --- /dev/null +++ b/tdemid/midicfgdlg.h @@ -0,0 +1,61 @@ +/************************************************************************** + + midicfgdlg.h - The midi config dialog + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _midicfgdlg_h_ +#define _midicfgdlg_h_ + +#include + +class DeviceManager; + +class TQLabel; +class TQPushButton; +class TQListBox; +class MidiConfigDialog : public KDialogBase +{ + Q_OBJECT + + +public: + + MidiConfigDialog(DeviceManager *dm,TQWidget *parent,const char *name); + +public slots: + void deviceselected(int idx); + void browseMap(); + void noMap(); + +private: + TQLabel *maplabel; + TQListBox *mididevices; + TQPushButton *mapbrowse; + TQPushButton *mapnone; + + DeviceManager *devman; + +public: + static int selecteddevice; + static char *selectedmap; +}; + +#endif diff --git a/tdemid/pics/Makefile.am b/tdemid/pics/Makefile.am new file mode 100644 index 00000000..b9dc09f0 --- /dev/null +++ b/tdemid/pics/Makefile.am @@ -0,0 +1,3 @@ +tdemidicondir = $(kde_datadir)/tdemid/icons +tdemidicon_ICON = AUTO + diff --git a/tdemid/pics/cr16-action-piano.png b/tdemid/pics/cr16-action-piano.png new file mode 100644 index 00000000..29536a0a Binary files /dev/null and b/tdemid/pics/cr16-action-piano.png differ diff --git a/tdemid/pics/cr16-action-volume.png b/tdemid/pics/cr16-action-volume.png new file mode 100644 index 00000000..3b75a38c Binary files /dev/null and b/tdemid/pics/cr16-action-volume.png differ diff --git a/tdemid/pics/cr22-action-piano.png b/tdemid/pics/cr22-action-piano.png new file mode 100644 index 00000000..226e4444 Binary files /dev/null and b/tdemid/pics/cr22-action-piano.png differ diff --git a/tdemid/pics/cr22-action-volume.png b/tdemid/pics/cr22-action-volume.png new file mode 100644 index 00000000..e87c5147 Binary files /dev/null and b/tdemid/pics/cr22-action-volume.png differ diff --git a/tdemid/pics/cr32-action-piano.png b/tdemid/pics/cr32-action-piano.png new file mode 100644 index 00000000..9d75a570 Binary files /dev/null and b/tdemid/pics/cr32-action-piano.png differ diff --git a/tdemid/pics/cr32-action-volume.png b/tdemid/pics/cr32-action-volume.png new file mode 100644 index 00000000..0e1f3dec Binary files /dev/null and b/tdemid/pics/cr32-action-volume.png differ diff --git a/tdemid/qslidertime.cpp b/tdemid/qslidertime.cpp new file mode 100644 index 00000000..aa879da5 --- /dev/null +++ b/tdemid/qslidertime.cpp @@ -0,0 +1,120 @@ +/************************************************************************** + + kslidertime.cpp - A widget that displays time tags under a KSlider + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include "qslidertime.h" +#include +#include +#include + +#define ARROW_LENGTH 13 + +QSliderTime::QSliderTime( TQSlider *ksl, TQWidget *parent, const char *name) + : TQWidget (parent,name) +{ +kslider=ksl; + +TQPainter painter; +TQFontMetrics qfmt(painter.font()); +fontheight=qfmt.height(); + +} + +char *QSliderTime::formatMillisecs(int ms,char *tmp) +{ + if (ms<60000) + { + sprintf(tmp,"0:%02d",ms/1000); + } + else + sprintf(tmp,"%d:%02d",ms/60000,(ms%60000)/1000); +return tmp; +} + +void QSliderTime::paintEvent( TQPaintEvent * ) +{ + TQPainter painter(this); + +// erase(); + drawTimeMarks(&painter); +} + +int quantizeTimeStep(int t) +{ +if (t<=2000) t=2000; + else if (t<=5000) t=5000; + else if (t<=10000) t=10000; + else if (t<=15000) t=15000; + else if (t<=30000) t=30000; + else if (t<=60000) t=60000; + else if (t<=120000) t=120000; +return t; +} + +void QSliderTime::drawTimeMarks(TQPainter *painter) +{ +if (kslider==NULL) return; + int i; + int maxV = kslider->maxValue(); + TQFontMetrics qfmt(painter->font()); + fontheight=qfmt.height(); + int ntimetags = width()/(qfmt.width("-88:88-")); + int timestep; + if (ntimetags>1) timestep = maxV/(ntimetags); + else timestep=maxV; + timestep = quantizeTimeStep(timestep); + ntimetags = maxV/timestep; + + // draw time tags (only in horizontal !!) + int posy=qfmt.height(); + char *tmp=new char[100]; + int pos=0; + int deltapos=0; + formatMillisecs(0,tmp); + painter->drawText( 0, posy,TQString(tmp)); + for ( i = timestep; i <= maxV - timestep; i += timestep ) + { + pos = (width()-10) * i / maxV + 5; + formatMillisecs(i,tmp); + deltapos=qfmt.width(tmp)/2; + painter->drawText( pos-deltapos, posy,TQString(tmp)); + } + + pos = width()- 5; + formatMillisecs(maxV,tmp); + deltapos=qfmt.width(tmp); + + painter->drawText( pos-deltapos, posy,TQString(tmp)); + +} + + +TQSize QSliderTime::sizeHint() +{ + return TQSize(10,fontheight+2); +} + +TQSizePolicy QSliderTime::sizePolicy() +{ + return TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Fixed); +} +#include "qslidertime.moc" diff --git a/tdemid/qslidertime.h b/tdemid/qslidertime.h new file mode 100644 index 00000000..57aa3b18 --- /dev/null +++ b/tdemid/qslidertime.h @@ -0,0 +1,57 @@ +/************************************************************************** + + kslidertime.h - A widget that displays time tags under a KSlider + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _kslidertime_h_ +#define _kslidertime_h_ + +#include + +class TQWidget; + +class QSliderTime : public TQWidget +{ + Q_OBJECT + +private: + + TQSlider *kslider; + +int fontheight; +public: + + QSliderTime( TQSlider *ksl, TQWidget *parent = NULL, const char *name = NULL ); + + int getFontHeight(void) {return fontheight;}; + + TQSize sizeHint(); + TQSizePolicy sizePolicy(); + +private: + + virtual void paintEvent( TQPaintEvent * ); + void drawTimeMarks(TQPainter *painter); + + char *formatMillisecs(int ms,char *tmp); +}; + +#endif diff --git a/tdemid/randomlist.cpp b/tdemid/randomlist.cpp new file mode 100644 index 00000000..f26b8cfc --- /dev/null +++ b/tdemid/randomlist.cpp @@ -0,0 +1,103 @@ +/************************************************************************** + + randomlist.cpp - Some "random functions" :-) + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include "randomlist.h" +#include +#include + +#define RAND_UNIFORM (double)rand()/(double)RAND_MAX + +int random_discrete(double *distrib,int n) +{ + int i=0; + double g=0.0; + double z=0.0; + while ((z==0.0)||(z==1.0)) z=RAND_UNIFORM; + while ((g0) used++; + }; + used--; // k will no longer be used :-) + if (used==0) return; + double piece=distrib[k]/(double)used; + distrib[k]=0.0; + for (i=0;i0) distrib[i]+=piece; +} + +void show_distrib(double *distrib,int n) +{ + printf("("); + for (int j=0;j0) + { + x=random_discrete(distrib,n); + list[x]=i; + i++; + remove_lmn_from_discrete_distrib(x,distrib,n,used); + used--; + }; + delete distrib; + + return list; +} + +int *generate_list(int n) +{ + int *list=new int[n]; + for (int i=0;isetState(KLed::Off); + lamps[i]->setGeometry(x+2,0,w-4,height()); + lamps[i]->show(); + x+=w; + } +// lamps[0]->setState(KLed::On); + +} + +void RhythmView::Beat(int j) +{ + if (j>num) setRhythm(j,4); // This is a preventive case + + for (int i=0;ioff(); + } + lamps[j-1]->on(); +} + +void RhythmView::Beat(void) +{ + +} + +void RhythmView::resizeEvent(TQResizeEvent *) +{ + int w=width()/num; + int x=0; + + for (int i=0;isetGeometry(x+2,0,w-4,height()); + x+=w; + } +} + +TQSize RhythmView::sizeHint() +{ + return TQSize(10,10); +} + +TQSizePolicy RhythmView::sizePolicy() +{ +// return TQWidget::sizePolicy(); + return TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum); +} + diff --git a/tdemid/rhythmview.h b/tdemid/rhythmview.h new file mode 100644 index 00000000..8af09613 --- /dev/null +++ b/tdemid/rhythmview.h @@ -0,0 +1,54 @@ +/************************************************************************** + + rhythmview.h - The RhythmView widget + Copyright (C) 1998 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _rhythmview_h_ +#define _rhythmview_h_ + +#include +#include + +class RhythmView : public TQWidget +{ + int num,den; + + KLed **lamps; + +public: + RhythmView (TQWidget *parent, const char *name); + ~RhythmView(); + + void setRhythm(int numerator,int denominator); + + void Beat(int i); // Sets the beat number + + void Beat(void); // Just increase the beat + + TQSize sizeHint(); + TQSizePolicy sizePolicy(); + +private: + void resizeEvent(TQResizeEvent *); + +}; + +#endif diff --git a/tdemid/slman.cpp b/tdemid/slman.cpp new file mode 100644 index 00000000..39b10ca2 --- /dev/null +++ b/tdemid/slman.cpp @@ -0,0 +1,320 @@ +/************************************************************************** + + slman.cc - SongList Manager, which holds a set of collections (SongLists) + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include "slman.h" +#include +#include +#include +#include "version.h" +#include + +SLManager::SLManager() +{ + list=NULL; + ntotal=0; + tempsl=NULL; + createTemporaryCollection(); +} + +SLManager::SLManager(SLManager &src) +{ + list=NULL; + ntotal=0; + tempsl=NULL; + SongListNode *srcSL=src.list; + SongList *tmpSL; + int i; + while (srcSL!=NULL) + { + i=createCollection(srcSL->name); + tmpSL=getCollection(i); + if (tmpSL!=NULL) + tmpSL->copy(*srcSL->SL); + srcSL=srcSL->next; + } + if (src.tempsl!=NULL) tempsl=new SongList(*src.tempsl); + else tempsl=NULL; +} + +SLManager::~SLManager() +{ + SongListNode *ptr; + ptr=list; + while (ptr!=NULL) + { + list=ptr->next; + if (ptr->SL!=NULL) delete ptr->SL; + if (ptr->name!=NULL) delete ptr->name; + delete ptr; + ptr=list; + } + if (tempsl!=NULL) delete tempsl; + ntotal=0; +} + +int SLManager::createCollection(const char *name) +{ + SongListNode *ptr; + if (nameUsed(name)) + { + printf("Name '%s' is already used\n",name); + return -1; + } + if (list==NULL) + { + list=new SongListNode; + list->id=1; + ntotal=1; + ptr=list; + } + else + { + ptr=list; + while (ptr->next!=NULL) ptr=ptr->next; + ptr->next=new SongListNode; + ptr=ptr->next; + + ptr->id= ++ntotal; + } + ptr->SL=new SongList; + ptr->next=NULL; + if (name!=NULL) + { + ptr->name=new char[strlen(name)+1]; + strcpy(ptr->name,name); + } + else + { + ptr->name=getNotUsedName(); + } +return ptr->id; +} + +char *SLManager::getNotUsedName(void) +{ + char *trythis; + trythis=new char[100]; + strcpy(trythis,"No Name"); + int tries=1; + int success=0; + while (!success) + { + if (nameUsed(trythis)) sprintf(trythis,"No Name - %d",++tries); + else + success=1; + } + return trythis; +} + +int SLManager::nameUsed(const char *name) +{ + /* + SongListNode *ptr=list; + int used=0; + while ((!used)&&(ptr!=NULL)) + { + if (strcmp(ptr->name,name)==0) used=1; + ptr=ptr->next; + }; + return used; + */ + if (getCollection(name)==NULL) return 0; + return 1; +} + +void SLManager::deleteCollection(int id) +{ + if (list==NULL) return; + SongListNode *ptr=list; + SongListNode *ptr2; + if (id==1) list=list->next; + else + { + ptr2=list; + while ((ptr!=NULL)&&(ptr->id!=id)) + { + ptr2=ptr; + ptr=ptr->next; + } + if (ptr==NULL) + { + printf("Trying to delete a not used id\n"); + return; + } + ptr2->next=ptr->next; + } + ptr2=ptr->next; + delete ptr->SL; + delete ptr->name; + delete ptr; + regenerateid(ptr2,id); + +} + +void SLManager::regenerateid(SongListNode *sl,int id) +{ + SongListNode *tmp=sl; + int i=id; + while (tmp!=NULL) + { + tmp->id=i++; + tmp=tmp->next; + } + ntotal=i-1; +} + +void SLManager::changeCollectionName(int id,const char *newname) +{ + if (id<1) return; + if (nameUsed(newname)) + { + printf("Cannot change name, '%s' is already used\n",newname); + return; + } + SongListNode *ptr=list; + while ((ptr!=NULL)&&(ptr->id!=id)) ptr=ptr->next; + if (ptr==NULL) return; + + delete ptr->name; + ptr->name=new char[strlen(newname)+1]; + strcpy(ptr->name,newname); +} + +SongList *SLManager::getCollection(int id) +{ + if (id==0) return tempsl; + + SongListNode *ptr=list; + while ((ptr!=NULL)&&(ptr->id!=id)) ptr=ptr->next; + + if (ptr==NULL) return NULL; + return ptr->SL; +} + +SongList *SLManager::getCollection(const char *name) +{ + SongListNode *ptr=list; + while ((ptr!=NULL)&&(strcmp(ptr->name,name)!=0)) ptr=ptr->next; + + if (ptr==NULL) return NULL; + return ptr->SL; +} + +const char *SLManager::getCollectionName(int id) +{ + if (id==0) return I18N_NOOP("Temporary Collection"); + SongListNode *ptr=list; + while ((ptr!=NULL)&&(ptr->id!=id)) ptr=ptr->next; + + if (ptr==NULL) return NULL; + return ptr->name; +} + +void SLManager::loadConfig(const char *filename) +{ +#ifdef GENERAL_DEBUG_MESSAGES + printf("Loading collections\n"); +#endif + FILE *fh=fopen(filename,"rt"); + if (fh==NULL) + { + printf("Collections cannot be loaded\n(File %s doesn't exist or can't be opened)\n",filename); + return; + } + char s[300]; + SongList *sl=NULL; + int activeid=0; + while (!feof(fh)) + { + s[0] = 0; + fgets(s,299,fh); + if ((strlen(s)>0)&&(s[strlen(s)-1]==10)) s[strlen(s)-1]=0; + switch (s[0]) + { + case (0) : break; + case (10) : break; + case ('=') : + { + if (sl!=NULL) sl->setActiveSong(activeid); + int id=createCollection(&s[1]); + sl=getCollection(id); + fgets(s,299,fh); + activeid=atoi(s); + } + break; + default : + { + if (sl!=NULL) sl->AddSong((const char *)s); + } + } + } + if (sl!=NULL) sl->setActiveSong(activeid); + + fclose(fh); +} + +void SLManager::saveConfig(const char *filename) +{ + SongListNode *ptr=list; + FILE *fh=fopen(filename,"wt"); + if (fh==NULL) + { + printf("Collections couldn't be saved\n"); + return; + } + char s[FILENAME_MAX]; + SongList *sl; + while (ptr!=NULL) + { + sprintf(s,"=%s\n",ptr->name); + fputs(s,fh); + + sl=ptr->SL; + sprintf(s,"%d\n",sl->getActiveSongID()); + fputs(s,fh); + + sl->iteratorStart(); + while (!sl->iteratorAtEnd()) + { + sprintf(s,"%s\n",sl->getIteratorName()); + fputs(s,fh); + sl->iteratorNext(); + } + // ptr->SL->saveList(fh); + fputs("\n",fh); + + ptr=ptr->next; + } + fclose(fh); + +} + +SongList *SLManager::createTemporaryCollection(void) +{ + if (tempsl==NULL) + tempsl=new SongList(); + else + tempsl->clean(); + + return tempsl; +} diff --git a/tdemid/slman.h b/tdemid/slman.h new file mode 100644 index 00000000..f1da57c0 --- /dev/null +++ b/tdemid/slman.h @@ -0,0 +1,74 @@ +/* slman.h - SongList Manager, which holds a set of collections (SongLists) + Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef SLMAN_H +#define SLMAN_H + +#include "songlist.h" + +class SLManager +{ +protected: +int ntotal; + +struct SongListNode + { + int id; + char *name; + SongList *SL; + + SongListNode *next; + }; +SongListNode *list; +SongList *tempsl; + +char *getNotUsedName(void); +int nameUsed(const char *name); +void regenerateid(SongListNode *sl,int id); + +public: +SLManager(); +SLManager(SLManager &src); // Copy constructor +~SLManager(); + +int createCollection(const char *name=NULL); // Returns the id associated to the + // new collection + // -1 if name already is used and Collection was + // not created + +void deleteCollection(int id); +void changeCollectionName(int id, const char *newname); + +SongList *getCollection(int id); +SongList *getCollection(const char *name); +const char *getCollectionName(int id); + +int numberOfCollections(void) {return ntotal;}; + +void loadConfig(const char *filename); +void saveConfig(const char *filename); + +SongList *createTemporaryCollection(void); +SongList *getTemporaryCollection(void) {return tempsl;}; + +}; + +#endif diff --git a/tdemid/songlist.cpp b/tdemid/songlist.cpp new file mode 100644 index 00000000..cc2572d8 --- /dev/null +++ b/tdemid/songlist.cpp @@ -0,0 +1,247 @@ +/************************************************************************** + + songlist.cc - class SongList, which holds a list of songs (collection) + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include "songlist.h" +#include +#include +#include + +SongList::SongList(void) +{ + list=NULL; + last=NULL; + active=NULL; + ntotal=0; +} + +SongList::SongList(SongList &src) +{ + list=last=active=NULL; + ntotal=0; + src.iteratorStart(); + while (!src.iteratorAtEnd()) + { + AddSong(src.getIteratorName()); + src.iteratorNext(); + } + if (src.active!=NULL) active=getSongid(src.active->id); +} + +SongList::~SongList() +{ + clean(); + Song *ptr=list; + active=last=NULL; + ntotal=0; + + while (ptr!=NULL) + { + list=ptr->next; + delete ptr->name; + delete ptr; + ptr=list; + } + +} + +SongList::Song *SongList::getSongid(int id) +{ + Song *ptr=list; + while ((ptr!=NULL)&&(ptr->id!=id)) + ptr=ptr->next; + + return ptr; +} + +int SongList::AddSong(const char *song) +{ + if (!song) return 0; + + if (last==NULL) + { + last=new Song; + list=last; + } + else + { + last->next=new Song; + last=last->next; + } + last->name=new char[strlen(song)+1]; + strcpy(last->name,song); + last->id= ++ntotal; + last->next=NULL; + if (active==NULL) active=last; + return last->id; +} + +void SongList::DelSong(int id) +{ + Song *ptr; + + if (list==NULL) return; + if (id==1) + { + if (last->id==1) + { + list=last=active=NULL; + ntotal=0; + } + else + { + ptr=list; + if (active->id==1) active=list->next; + list=list->next; + delete ptr->name; + delete ptr; + ntotal--; + + regenerateid(list,1); + } + return; + } + Song *ptr_prev=getSongid(id-1); + ptr=ptr_prev->next; + if (last->id==id) last=ptr_prev; + if (active->id==id) + if (active->next!=NULL) active=active->next; + else active=ptr_prev; + + ntotal--; + ptr_prev->next=ptr->next; + delete ptr->name; + delete ptr; + regenerateid(ptr_prev->next,id); + +} + +void SongList::regenerateid(Song *song,int id) +{ + Song *tmp=song; + int i=id; + while (tmp!=NULL) + { + tmp->id=i++; + tmp=tmp->next; + } + ntotal=i-1; +} + +void SongList::setActiveSong(int id) +{ + Song *tmp=getSongid(id); + if (tmp!=NULL) active=tmp; +} + +char *SongList::getName(int id) +{ + Song *tmp=getSongid(id); + if (tmp!=NULL) return tmp->name; + return NULL; +} + +/* +void SongList::saveList(FILE *fh) +{ + Song *ptr=list; + while (ptr!=NULL) + { + fputs(fh,ptr->name); + ptr=ptr->next; + } +} +*/ + +void SongList::iteratorStart(void) +{ + it=list; +} + +void SongList::iteratorNext(void) +{ + if (it!=NULL) it=it->next; +} + +int SongList::getIteratorID(void) +{ + if (it==NULL) return -1; + return it->id; +} + +char *SongList::getIteratorName(void) +{ + if (it==NULL) return NULL; + return it->name; +} + + +void SongList::clean(void) +{ + Song *tmp=list; + active=last=NULL; + ntotal=0; + + while (tmp!=NULL) + { + list=tmp->next; + delete [] tmp->name; + delete tmp; + tmp=list; + } +} + +void SongList::copy(SongList &src) +{ + clean(); + src.iteratorStart(); + while (!src.iteratorAtEnd()) + { + AddSong(src.getIteratorName()); + src.iteratorNext(); + } + if (src.active!=NULL) active=getSongid(src.active->id); +} + +int SongList::next(void) +{ + if (list==NULL) {active=NULL;return 0;}; + if (active!=NULL) active=active->next; + if (active==NULL) + { + Song *tmp=list; + while (tmp->next!=NULL) tmp=tmp->next; + active=tmp; + return 0; + } + return 1; +} + + +void SongList::previous(void) +{ + if (list==NULL) {active=NULL;return;}; + Song *tmp=list; + while ((tmp->next!=NULL)&&(tmp->next->id!=active->id)) tmp=tmp->next; + if (tmp->next==NULL) {active=list;return;}; + active=tmp; +} diff --git a/tdemid/songlist.h b/tdemid/songlist.h new file mode 100644 index 00000000..cd95eb47 --- /dev/null +++ b/tdemid/songlist.h @@ -0,0 +1,84 @@ +/* songlist.h - class SongList, which holds a list of songs (collection) + Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef SONGLIST_H +#define SONGLIST_H + +#include + +class SongList +{ +protected: +int ntotal; + +struct Song +{ + int id; + char *name; // complete path and file name + + Song *next; +}; + +Song *list; +Song *last; +Song *active; + +Song *it; // Iterator, just a helper variable to make easy (and fast) reading + // all the list + +Song *getSongid(int id); + +void regenerateid(Song *song,int id); + +public: +SongList(void); +SongList(SongList &src); // Copy constructor +~SongList(); + +int AddSong(const char *song); // Returns the id number assigned to the song +void DelSong(int id); + +int NumberOfSongs(void) { return ntotal; }; + +void setActiveSong(int id); +int getActiveSongID(void) {return ((active!=NULL)? (active->id ):(-1)); }; +char *getActiveSongName(void) + { + return ((active!=NULL)? (active->name):((char *)NULL)); + }; + +char *getName(int id); // Returns the name of the song with id id + +void previous(void); +int next(void); // returns 1 if evrything is ok, and 0 if it was the last element + // (but leaves active the last element instead of NULL) + +void iteratorStart(void); +void iteratorNext(void); +int iteratorAtEnd (void) {return (it==NULL);}; +int getIteratorID(void); +char *getIteratorName(void); + +void clean(void); // Clean this list +void copy(SongList &src); // Makes this object a copy of src (really copied) +}; + +#endif diff --git a/tdemid/std.o3 b/tdemid/std.o3 new file mode 100644 index 00000000..e58311da Binary files /dev/null and b/tdemid/std.o3 differ diff --git a/tdemid/std.sb b/tdemid/std.sb new file mode 100644 index 00000000..4fe2d0be Binary files /dev/null and b/tdemid/std.sb differ diff --git a/tdemid/tdemid.desktop b/tdemid/tdemid.desktop new file mode 100644 index 00000000..beda97b9 --- /dev/null +++ b/tdemid/tdemid.desktop @@ -0,0 +1,88 @@ +[Desktop Entry] +Name=KMid +Name[af]=Kmid +Name[bn]=কে-মিড +Name[eo]=MIDI-ludilo +Name[hi]=के-मिड +Name[ne]=केडीई मिड +Name[sv]=Kmid +Name[tr]=Kmid +Name[zh_HK]=KMidi +Name[zh_TW]=KMid 播放器 +Name[zu]=KMidi +MimeType=audio/x-karaoke;audio/x-midi;audio/midi; +GenericName=Midi/Karaoke Player +GenericName[af]=Midi/Kareokie Speler +GenericName[ar]=مشغل Midi/Karaoke +GenericName[bg]=Midi/Karaoke плеър +GenericName[br]=C'hoarier Midi/Karaoke +GenericName[bs]=Preglednik Midi/Karaoke datoteka +GenericName[ca]=Reproductor Midi/Karaoke +GenericName[cs]=Přehrávač Midi/Karaoke +GenericName[cy]=Chwaraewr Midi/Karaoke +GenericName[da]=Midi/Karaoke-afspiller +GenericName[de]=Midi/Karaoke-Programm +GenericName[el]=Αναπαραγωγέας Midi/Karaoke +GenericName[eo]=Ludilo por Midi/Karaoko-dosieroj +GenericName[es]=Un reproductor MIDI/Karaoke +GenericName[et]=Midi/karaoke mängija +GenericName[eu]=Midi/Karaoke erreproduzigailua +GenericName[fa]=پخش‌کنندۀ Midi/Karaoke +GenericName[fi]=Midi/Karaokesoitin +GenericName[fr]=Platine MIDI / Karaoké +GenericName[ga]=Seinnteoir Midi/Karaoke +GenericName[gl]=Reproductor de Midi/Karaoke +GenericName[he]=נגן MIDI/קריוקי +GenericName[hi]=मिडी/कराओके प्लेयर +GenericName[hr]=Midi/Karaoke player +GenericName[hu]=MIDI/Karaoke-lejátszó +GenericName[is]=Midi / Karaoke spilari +GenericName[it]=Lettore MIDI/Karaoke +GenericName[ja]=Midi/カラオケプレーヤ +GenericName[kk]=Midi/Караоке ойнатқышы +GenericName[km]=កម្មវិធី​ចាក់ Midi/ខារ៉ាអូខេ +GenericName[ko]=미디/노래방 재생기 +GenericName[lt]=Midi/Karaoke grotuvas +GenericName[lv]=Midi/Karaoke Atskaņotājs +GenericName[mk]=Midi/Karaoke изведувач +GenericName[ms]=Pemain Midi/Karaoke +GenericName[nb]=Midi-/karaokespiller +GenericName[nds]=Midi-/Karaoke-Afspeler +GenericName[ne]=मिडि/कारावके प्लेयर +GenericName[nl]=Midi/karaokespeler +GenericName[nn]=Midi-/karaoke-spelar +GenericName[pl]=Odtwarzacz Midi/Karaoke +GenericName[pt]=Leitor de MIDI/Karaoke +GenericName[pt_BR]=Reprodutor de Midi/Karaokê +GenericName[ro]=Program de redare MIDI/Karaoke +GenericName[ru]=Проигрыватель midi/караоке +GenericName[se]=Midi-/karaoke-čuojaheaddji +GenericName[sk]=Prehrávač Midi/Karaoke +GenericName[sl]=Predvajalnik datotek MIDI/Karaoke +GenericName[sr]=MIDI/караока плејер +GenericName[sr@Latn]=MIDI/karaoka plejer +GenericName[sv]=Midi/Karaoke-spelare +GenericName[ta]=ஒரு மிடி/கரயோக்கே இயக்கி +GenericName[tg]=Бозингари Midi/Karaoke +GenericName[th]=โปรแกรมเล่นแฟ้มมิดี้/คาราโอเกะ +GenericName[tr]=Midi ve Karaoke Yürütücü +GenericName[uk]=Програвач Midi/Karaoke +GenericName[uz]=Midi/Karaoki pleyer +GenericName[uz@cyrillic]=Midi/Караоки плейер +GenericName[ven]=Midi/Tshitambi tsha Karaoke +GenericName[xh]=Umdlali we Midi/Karaoke +GenericName[zh_CN]=Midi/卡拉 OK 播放器 +GenericName[zh_HK]=Midi/卡拉OK 播放器 +GenericName[zh_TW]=Midi/卡拉OK播放器 +GenericName[zu]=Umdlali weMidi/Karaoke +Exec=tdemid %u +Icon=tdemid +Path= +DocPath=tdemid/index.html +Type=Application +Terminal=false +ServiceTypes=Browser/View +X-TDE-Library=libtdemidpart +X-TDE-StartupNotify=true +X-DCOP-ServiceType=Multi +Categories=Qt;TDE;AudioVideo; diff --git a/tdemid/tdemid.lsm b/tdemid/tdemid.lsm new file mode 100644 index 00000000..b94976d4 --- /dev/null +++ b/tdemid/tdemid.lsm @@ -0,0 +1,14 @@ +Begin4 +Title: tdemid +Version: R14.0.0 +Entered-date: 2010-05-10 +Description: A midi/karaoke player with a friendly interface. +Keywords: mid kar player midi karaoke TDE X11 Qt tdemid fm awe gus synth +Author: larrosa@kde.org (Antonio Larrosa Jimenez) +Maintained-by: The Trinity Desktop Environment (TDE) http://www.trinitydesktop.org/ +Primary-site: http://git.trinitydesktop.org/cgit/ +Alternate-site: +Original-site: http://perso.wanadoo.es/antlarr/tdemid.html +Platforms: Linux and other Unices running TDE +Copying-policy: GPL +End diff --git a/tdemid/tdemid.spec b/tdemid/tdemid.spec new file mode 100644 index 00000000..7305dfe1 --- /dev/null +++ b/tdemid/tdemid.spec @@ -0,0 +1,62 @@ +Summary: Play midi/karaoke files and show lyrics. Support External synths, AWE, GUS, and FM devices. For X11/KDE +Name: tdemid +Version: 1.2 +Release: 1 +Copyright: GPL +Group: X11/K Desktop Environment/Multimedia +Source: tdemid-1.2.tar.gz +Requires: qt >= 1.3 , tdelibs + +%description +KMid is a midi/karaoke file player, with configurable midi mapper, +real Session Management, drag & drop, customizable fonts, etc. +It has a very nice interface which let you easily follow the tune while +changing the color of the lyrics. +It supports output through external synthesizers, AWE, FM and GUS cards. +It also has a keyboard view to see the notes played by each instrument + +%prep +%setup + +%build +export TDEDIR=/opt/kde +./configure +make all + +%install +export TDEDIR=/opt/kde +make install + +%files +%doc tdemid/README tdemid/COPYING tdemid/PEOPLE tdemid/tdemid.lsm tdemid/ChangeLog + +/opt/kde/bin/tdemid +/opt/kde/share/doc/tde/HTML/en/tdemid +/opt/kde/share/doc/tde/HTML/es/tdemid +/opt/kde/share/icons/tdemid.xpm +/opt/kde/share/icons/mini/tdemid.xpm +/opt/kde/share/applnk/Multimedia/tdemid.kdelnk +/opt/kde/share/mimelnk/audio/x-karaoke.kdelnk +/opt/kde/share/apps/tdemid/toolbar +/opt/kde/share/apps/tdemid/fm +/opt/kde/share/apps/tdemid/maps/gm.map +/opt/kde/share/apps/tdemid/maps/YamahaPSS790.map +/opt/kde/share/apps/tdemid/maps/YamahaPSR500.map +/opt/kde/share/apps/tdemid/OFortuna.kar +/opt/kde/share/apps/tdemid/StopInTheNameOfLove.kar +/opt/kde/share/apps/tdemid/TheGirlFromIpanema.kar +/opt/kde/share/apps/tdemid/AnotherGlitchInTheCall.kar +/opt/kde/share/locale/es/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/cs/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/de/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/fi/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/hr/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/pl/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/pt/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/sk/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/eo/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/no/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/sv/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/pt_BR/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/zh_CN.GB2312/LC_MESSAGES/tdemid.mo +/opt/kde/share/locale/zh_TW.Big5/LC_MESSAGES/tdemid.mo diff --git a/tdemid/tdemidIface.h b/tdemid/tdemidIface.h new file mode 100644 index 00000000..8bba2575 --- /dev/null +++ b/tdemid/tdemidIface.h @@ -0,0 +1,46 @@ +#ifndef _KMIDIFACE_H_ +#define _KMIDIFACE_H_ + +#include + +class KMidIface : virtual public DCOPObject +{ + K_DCOP + +k_dcop: +// File + + virtual int openURL( const TQString s )=0; + + // Song + virtual void play()=0; + virtual void pause()=0; + virtual void stop()=0; + virtual void rewind()=0; + virtual void forward()=0; + virtual void seek(int ms)=0; + virtual void prevSong()=0; + virtual void nextSong()=0; + + virtual void setSongLoop(int i)=0; + virtual void setVolume(int i)=0; + virtual void setTempo(int i)=0; +// GUI + + + virtual void setSongEncoding( int i )=0; + virtual void setLyricEvents( int i )=0; + +// Collections + virtual void setCurrentSong(int i)=0; + + virtual void setActiveCollection( int i )=0; + virtual void setCollectionPlayMode(int i)=0; + +// Midi device + + virtual void setMidiDevice(int i)=0; + +}; +#endif + diff --git a/tdemid/tdemid_part.cpp b/tdemid/tdemid_part.cpp new file mode 100644 index 00000000..d6e22474 --- /dev/null +++ b/tdemid/tdemid_part.cpp @@ -0,0 +1,144 @@ +#include "tdemid_part.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include "tdemidclient.h" +#include +#include + +K_EXPORT_COMPONENT_FACTORY( libtdemidpart, KMidFactory ) + +/** + * We need one static instance of the factory for our C 'main' + * function + */ +TDEInstance *KMidFactory::s_instance = 0L; + +KMidFactory::KMidFactory() +{ + s_instance=0L; +} + +KMidFactory::~KMidFactory() +{ + if (s_instance) + { + delete s_instance->aboutData(); + delete s_instance; + } + + s_instance = 0; +} + +KParts::Part *KMidFactory::createPartObject(TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, const char*, + const TQStringList& ) +{ + KParts::Part *obj = new KMidPart(parentWidget, widgetName, parent, name); + return obj; +} + +TDEAboutData *KMidFactory::aboutData() +{ + TDEAboutData *aboutdata = new TDEAboutData("tdemid", "KMid", "2.0", + I18N_NOOP("MIDI/Karaoke file player"), TDEAboutData::License_GPL, + I18N_NOOP("(c) 1997,98,99,2000, Antonio Larrosa Jimenez"),"", + "http://perso.wanadoo.es/antlarr/tdemid.html"); + aboutdata->addAuthor("Antonio Larrosa Jimenez", + I18N_NOOP("Original Developer/Maintainer"),"larrosa@kde.org", + "http://perso.wanadoo.es/antlarr/index.html"); + return aboutdata; +} + +TDEInstance *KMidFactory::instance() +{ + if ( !s_instance ) + s_instance = new TDEInstance( aboutData() ); + + return s_instance; +} + + KMidPart::KMidPart(TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name) +: KParts::ReadOnlyPart(parent, name) +{ + setInstance(KMidFactory::instance()); + + widget = new tdemidClient(parentWidget, actionCollection()); + widget->show(); + widget->setFocusPolicy(TQ_ClickFocus); + setWidget(widget); + + // create and connect our actions + (void)new KAction(i18n("Play"), "player_play", 0, this, + TQT_SLOT(slotPlay()), actionCollection(), + "play"); + + (void)new KAction(i18n("Stop"), "player_stop", 0, this, + TQT_SLOT(slotStop()), actionCollection(), + "stop"); + + (void)new KAction(i18n("Backward"), + "2leftarrow", 0, this, + TQT_SLOT(slotBackward()), actionCollection(), + "backward"); + + (void)new KAction(i18n("Forward"), + "2rightarrow", 0, this, + TQT_SLOT(slotForward()), actionCollection(), + "forward"); + + m_extension = new KMidBrowserExtension(this); + + setXMLFile("tdemid_partui.rc"); + + +} + +KMidPart::~KMidPart() +{ +} + +bool KMidPart::openFile() +{ + widget->openURL(m_file); + widget->stop(); + widget->show(); + TQTimer::singleShot(2000, this, TQT_SLOT(slotPlay())); + + return true; +} + +bool KMidPart::closeURL() +{ + slotStop(); + return true; +} + +void KMidPart::slotPlay() +{ + widget->stop(); + widget->play(); +} + + +void KMidPart::slotStop() +{ + widget->stop(); +} +KMidBrowserExtension::KMidBrowserExtension(KMidPart *parent) + : KParts::BrowserExtension(parent, "KMidBrowserExtension") +{ +} + +KMidBrowserExtension::~KMidBrowserExtension() +{ +} +#include "tdemid_part.moc" diff --git a/tdemid/tdemid_part.h b/tdemid/tdemid_part.h new file mode 100644 index 00000000..e2f07af1 --- /dev/null +++ b/tdemid/tdemid_part.h @@ -0,0 +1,66 @@ +#ifndef __KMIDPART_H__ +#define __KMIDPART_H__ + +#include +#include +#include +class TDEAboutData; +class TDEInstance; +class KMidBrowserExtension; +class tdemidClient; + +class KDE_EXPORT KMidFactory : public KParts::Factory +{ + Q_OBJECT + + public: + KMidFactory(); + virtual ~KMidFactory(); + + virtual KParts::Part* createPartObject(TQWidget *parentWidget, const char *widgetName, + TQObject* parent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, + const TQStringList &args = TQStringList()); + + static TDEInstance *instance(); + + static TDEAboutData *aboutData(); + private: + static TDEInstance *s_instance; +}; + +class KMidPart: public KParts::ReadOnlyPart +{ + Q_OBJECT + + public: + KMidPart(TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name); + virtual ~KMidPart(); + + + virtual bool closeURL(); + + protected: + virtual bool openFile(); + + protected slots: + void slotPlay(); + void slotStop(); + + private: + tdemidClient *widget; + KMidBrowserExtension *m_extension; +}; + +class KMidBrowserExtension : public KParts::BrowserExtension +{ + Q_OBJECT + + friend class KMidPart; + public: + KMidBrowserExtension(KMidPart *parent); + virtual ~KMidBrowserExtension(); +}; + +#endif diff --git a/tdemid/tdemid_partui.rc b/tdemid/tdemid_partui.rc new file mode 100644 index 00000000..2490c4c7 --- /dev/null +++ b/tdemid/tdemid_partui.rc @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tdemid/tdemidbutton.h b/tdemid/tdemidbutton.h new file mode 100644 index 00000000..ca48d9fb --- /dev/null +++ b/tdemid/tdemidbutton.h @@ -0,0 +1,32 @@ +#include +#include + +class KMidButton : public TQPushButton +{ +protected: + + TQPixmap pixmap1,pixmap2; + + virtual void drawButton(TQPainter *paint) + { + if ((isOn())&&(!pixmap1.isNull())) paint->drawPixmap(0,0,pixmap1); + else if ((!isOn())&&(!pixmap2.isNull())) paint->drawPixmap(0,0,pixmap2); + }; + +public: + + KMidButton (TQWidget *parent,const char *name) : TQPushButton (parent,name) + { + }; + + ~KMidButton() + { + }; + + void setPixmaps(const TQPixmap& p1, const TQPixmap& p2) + { + pixmap1=p1; + pixmap2=p2; + }; + +}; diff --git a/tdemid/tdemidclient.cpp b/tdemid/tdemidclient.cpp new file mode 100644 index 00000000..ba85e438 --- /dev/null +++ b/tdemid/tdemidclient.cpp @@ -0,0 +1,1606 @@ +/************************************************************************** + + tdemidclient.cpp - The main client widget of KMid + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#include +#include +#include +#include +#include +#include // kill is declared on signal.h on bsd, not sys/signal.h +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "tdemidclient.h" +#include "klcdnumber.h" +#include "randomlist.h" +#include "channelview.h" +#include "channel.h" +#include "version.h" +#include "rhythmview.h" + +//#define TEMPHACK + + +tdemidClient::tdemidClient(TQWidget *parent, KActionCollection *ac, const char *name) + : DCOPObject("KMidIface"), TQWidget(parent,name) +{ + actionCollection=ac; + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + midifile_opened=0L; + loopsong=cfg->readNumEntry("Loop",0); + collectionplaymode=0; + collectionplaylist=0L; + channelView=0L; + noteArray=0L; + shuttingdown=false; + + TDEConfig *kconf=TDEGlobal::instance()->config(); + + kconf->setGroup("KMid"); + TQString tmp2 = locateLocal("appdata", "collections"); + collectionsfile=kconf->readPathEntry("CollectionsFile",tmp2); + slman=new SLManager(); + slman->loadConfig(TQFile::encodeName(collectionsfile)); + currentsl=NULL; + // currentsl=slman->getCollection(activecollection); + itsme=0; + m_kMid.pid=0; + timebar = new TQSlider(0,240000,30000,60000,Qt::Horizontal, this); + timebar->setSteps(30000,60000); + timebar->setValue(0); + connect (timebar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotSeek(int))); + + timetags = new QSliderTime(timebar,this); + timetags->setMinimumSize(timetags->sizeHint()); + + qlabelTempo= new TQLabel(i18n("Tempo:"), this,"tempolabel", + TQLabel::NoFrame); + + tempoLCD = new KLCDNumber( true, 3, this, "TempoLCD"); + tempoLCD->setValue(120); + tempoLCD->display(120); + currentTempo=120; + tempoLCD->setRange(3,999); + tempoLCD->setDefaultValue(120); + tempoLCD->setUserSetDefaultValue(true); + tempoLCD->setMinimumSize(tempoLCD->sizeHint()); + connect(tempoLCD,TQT_SIGNAL(valueChanged(double)),this,TQT_SLOT(slotSetTempo(double))); + + comboSongs = new TQComboBox(FALSE, this,"Songs"); + connect (comboSongs,TQT_SIGNAL(activated(int)),this,TQT_SLOT(slotSelectSong(int))); + comboSongs->setMinimumWidth(200); + + comboEncodings = new TQComboBox(FALSE, this, "Encodings"); + connect (comboEncodings,TQT_SIGNAL(activated(int)),this,TQT_SLOT(slotSelectEncoding(int))); + comboEncodings->insertItem(i18n("Default")); + comboEncodings->insertStringList( TDEGlobal::charsets()->descriptiveEncodingNames() ); + comboEncodings->setCurrentItem(0); + + rhythmview= new RhythmView( this, "RhythmView"); + rhythmview->setMaximumHeight(7); + rhythmview->setMinimumHeight(7); + + volumebar = new TQSlider(0,200,10,100,Qt::Vertical, this ); + volumebar->setSteps(10,20); + volumebar->setValue(100); + volumebar->setTickmarks(TQSlider::NoMarks); + volumebar->setTickInterval(50); + connect (volumebar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotSetVolume(int))); + + visiblevolumebar=cfg->readNumEntry("ShowVolumeBar",0); + if (visiblevolumebar) volumebar->show(); + else volumebar->hide(); + + typeoftextevents=1; + kdispt=new KDisplayText( this, "KaraokeWindow"); + kdispt->show(); + + timer4timebar=new TQTimer(this); + connect (timer4timebar,TQT_SIGNAL(timeout()),this,TQT_SLOT(timebarUpdate())); + timer4events=new TQTimer(this); + connect (timer4events,TQT_SIGNAL(timeout()),this,TQT_SLOT(processSpecialEvent())); + + TQString samplefile = + TDEGlobal::dirs()->findAllResources("appdata", "fm/*.o3").last(); + samplefile.truncate(samplefile.findRev('/')); + FMOut::setFMPatchesDirectory(TQFile::encodeName(samplefile)); + + m_kMid.pctlsmID=shmget(IPC_PRIVATE,sizeof(PlayerController),0666 | IPC_CREAT ); + if (m_kMid.pctlsmID==-1) + { + printf("ERROR: Cannot allocate shared memory !!!\n" + "Please report to larrosa@kde.org\n"); + exit(1); + } + + m_kMid.pctl=(PlayerController *)shmat(m_kMid.pctlsmID,0L,0); + if (!m_kMid.pctl) + printf("ERROR: Cannot get shared memory !!! " + "Please report to larrosa@kde.org\n"); + m_kMid.pctl->playing=0; + m_kMid.pctl->gm=1; + m_kMid.pctl->volumepercentage=100; + m_kMid.pctl->tempo=500000; + m_kMid.pctl->ratioTempo=1.0; + for (int i=0;i<16;i++) + { + m_kMid.pctl->forcepgm[i]=0; + m_kMid.pctl->pgm[i]=0; + } + + + kconf->setGroup("KMid"); + int mididev=kconf->readNumEntry("MidiPortNumber",-1); + + midi = new DeviceManager(mididev); + midi->initManager(); + m_kMid.midi=midi; + player= new MidiPlayer(midi,m_kMid.pctl); + + kconf->setGroup("Midimapper"); + TQCString qs=TQFile::encodeName(kconf->readPathEntry("Loadfile","gm.map")); + +#ifdef KMidDEBUG + printf("Read Config file: %s\n",qs.data()); +#endif + setMidiMapFilename(qs.data()); + + initializing_songs=1; + kconf->setGroup("KMid"); + setActiveCollection(kconf->readNumEntry("ActiveCollection",0)); + initializing_songs=0; + + TQVBoxLayout *lv=new TQVBoxLayout( this ); + lv->addWidget( timebar ); + lv->addWidget( timetags ); + lv->addSpacing(5); + TQHBoxLayout *lh=new TQHBoxLayout( lv ); + lh->addWidget( qlabelTempo ); + lh->addWidget( tempoLCD ); + lh->addWidget( comboSongs, 6 ); + lv->addSpacing(5); + lh->addWidget( comboEncodings, 1 ); + lv->addSpacing(5); + lv->addWidget( rhythmview ); + lv->addSpacing(2); + TQHBoxLayout *lh2=new TQHBoxLayout( lv ); + lh2->addWidget( volumebar ); + lh2->addWidget( kdispt ); +} + +/*void tdemidClient::resizeEvent(TQResizeEvent *) +{ + //timebar->resize(width()-5,timebar->height()); + timebar->setGeometry(5,10,width()-5,timebar->height()); + timetags->setGeometry(5,10+timebar->height(),width()-5,timetags->getFontHeight()); + comboSongs->setGeometry(tempoLCD->x()+tempoLCD->width()+15,tempoLCD->y(),width()-(tempoLCD->x()+tempoLCD->width()+25),tempoLCD->height()); + rhythmview->setGeometry(5,10+timebar->height()+timetags->height()+5+tempoLCD->height()+2,width()-10,7); + volumebar->setGeometry(5,10+timebar->height()+timetags->height()+5+tempoLCD->height()+10,15,height()-(10+timebar->height()+timetags->height()+5+tempoLCD->height()+15)); + kdispt->setGeometry(((visiblevolumebar)?25:5),10+timebar->height()+timetags->height()+5+tempoLCD->height()+10,width()-(5+((visiblevolumebar)?25:5)),height()-(10+timebar->height()+timetags->height()+5+tempoLCD->height()+10)); +} +*/ + +tdemidClient::~tdemidClient() +{ + if (m_kMid.pctl->playing==1) + { + stop(); + // sleep(1); + } + + if (m_kMid.pid!=0) + { + kill(m_kMid.pid,SIGTERM); + waitpid(m_kMid.pid, 0L, 0); + m_kMid.midi->closeDev(); + m_kMid.pid=0; + } + + allNotesOff(); + + delete midifile_opened; + delete player; + delete midi; + delete [] collectionplaylist; + + saveCollections(); + delete slman; + +// Let's detach and delete shared memory + shmdt((char *)m_kMid.pctl); + shmctl(m_kMid.pctlsmID, IPC_RMID, 0L); + m_kMid.pctl=0L; +} + +// Use KURL::filename ! (David) +char *extractFilename(const char *in,char *out) +{ + char *p=(char *)in; + char *result=out; + char *filename=(char *)in; + while (*p!=0) + { + if (*p=='/') filename=p+1; + p++; + } + while (*filename!=0) + { + *out=*filename; + out++; + filename++; + } + *out=0; + return result; +} + +int tdemidClient::openFile(const char *filename) +{ + m_kMid.pctl->message|=PLAYER_HALT; + stop(); + int r; + player->setGenerateBeats(true); + if ((r=player->loadSong(filename))!=0) + { + TQString errormsg; + switch (r) + { + case (-1) : errormsg = + i18n("The file %1 does not exist or cannot be opened.").arg(filename); + break; + case (-2) : errormsg = + i18n("The file %1 is not a MIDI file.").arg(filename);break; + case (-3) : errormsg = + i18n("Ticks per quarter note is negative. Please send this file to larrosa@kde.org");break; + case (-4) : errormsg = + i18n("Not enough memory.");break; + case (-5) : errormsg = + i18n("This file is corrupted or not well built.");break; + case (-6) : errormsg = + i18n("%1 is not a regular file.").arg(filename);break; + default : errormsg = i18n("Unknown error message");break; + } + KMessageBox::error(this, errormsg); + // player->loadSong(midifile_opened); + if (midifile_opened) delete midifile_opened; + midifile_opened=0L; + timebar->setRange(0,240000); + timebar->setValue(0); + timetags->repaint(TRUE); + kdispt->ClearEv(); + kdispt->repaint(TRUE); + topLevelWidget()->setCaption("KMid"); + + return -1; + } + + if (midifile_opened) delete midifile_opened; + midifile_opened=new char[strlen(filename)+1]; + strcpy(midifile_opened,filename); +#ifdef KMidDEBUG + printf("TOTAL TIME: %g milliseconds\n",player->information()->millisecsTotal); +#endif + // noteArray=player->parseNotes(); + noteArray=player->noteArray(); + timebar->setRange(0,(int)(player->information()->millisecsTotal)); + timetags->repaint(TRUE); + kdispt->ClearEv(); + spev=player->specialEvents(); + while (spev) + { + if ((spev->type==1) || (spev->type==5)) + { + kdispt->AddEv(spev); + } + spev=spev->next; + } + + kdispt->calculatePositions(); + kdispt->CursorToHome(); +// kdispt->updateScrollBars(); + emit mustRechooseTextEvent(); + kdispt->repaint(TRUE); + tempoLCD->display(tempoToMetronomeTempo(m_kMid.pctl->tempo)); + currentTempo=tempoLCD->getValue(); + tempoLCD->setDefaultValue(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo); + + char *fn=new char[strlen(filename)+20]; + extractFilename(filename,fn); + char *capt=new char[strlen(fn)+20]; + sprintf(capt,"KMid - %s",fn); + delete fn; + topLevelWidget()->setCaption(capt); + delete capt; + + timebar->setValue(0); + return 0; +} + +int tdemidClient::openURL(const TQString _url) +{ + KURL u(_url); + if (!u.isValid()) {printf("Malformed URL\n");return -1;}; + + TQString filename; + bool deleteFile=false; + if (!u.isLocalFile()) + { + filename = TQString("/tmp/") + u.filename(); + TDEIO::Job *iojob = TDEIO::copy( u, KURL::fromPathOrURL( filename ) ); + downloaded=false; + connect( iojob, TQT_SIGNAL( result( TDEIO::Job *) ), this, TQT_SLOT(downloadFinished( TDEIO::Job * ) ) ); + + if (!downloaded) + kapp->enter_loop(); + deleteFile=true; + + } + else + { + filename=u.path(); + } + + TQCString filename_8bit = TQFile::encodeName(filename); + int r=-1; + if (!filename_8bit.isEmpty()) + { + r=openFile(filename_8bit.data()); + + TDEConfig *cfg=TDEGlobal::instance()->config(); + if (cfg->readBoolEntry("deleteTmpNonLocalFiles",false)) + { + unlink(filename_8bit.data()); + } + } + return r; +} + +ulong tdemidClient::timeOfNextEvent(int *type) +{ + int t=0; + ulong x=0; + + + if (!channelView) + { + if ((spev)&&(spev->type!=0)) + { + t=1; + x=spev->absmilliseconds; + } + } + else + { + if (noteArray) + { + NoteArray::noteCmd *ncmd=noteArray->get(); + if (!ncmd) + { + if ((spev)&&(spev->type!=0)) + { + t=1; + x=spev->absmilliseconds; + } + } + else + { + if ((!spev)||(spev->type==0)) + { + t=2; + x=ncmd->ms; + } + else + { + if (spev->absmillisecondsms) + { + t=1; + x=spev->absmilliseconds; + } + else + { + t=2; + x=ncmd->ms; + } + + } + } + } + } + + if (type) *type=t; + return x; + /* + + if (type!=NULL) *type=0; + if (channelView==NULL) + { + if ((spev!=NULL)&&(spev->type!=0)) + { + if (type!=NULL) *type=1; + return spev->absmilliseconds; + } + else return 0; + } + + if (noteArray==NULL) return 0; + noteCmd *ncmd=noteArray->get(); + if (ncmd==NULL) + { + if ((spev!=NULL)&&(spev->type!=0)) + { + if (type!=NULL) *type=1; + return spev->absmilliseconds; + } + else return 0; + } + else + { + if ((spev==NULL)||(spev->type==0)) + { + if (type!=NULL) *type=2; + return ncmd->ms; + } + else + { + if (spev->absmillisecondsms) + { + if (type!=NULL) *type=1; + return spev->absmilliseconds; + } + else + { + if (type!=NULL) *type=2; + return ncmd->ms; + } + + } + } + */ +} + +void tdemidClient::slotPlay() +{ + if (!player->isSongLoaded()) + { + KMessageBox::sorry(this, + i18n("You must load a file before playing it.")); + return; + } + if (m_kMid.pctl->playing==1) + { + KMessageBox::sorry(this, + i18n("A song is already being played.")); + return; + } + if (midi->checkInit()==-1) + { + KMessageBox::error(this, + i18n("Could not open /dev/sequencer.\nProbably there is another program using it.")); + return; + } + + kdispt->CursorToHome(); + m_kMid.pctl->message=0; + m_kMid.pctl->playing=0; + m_kMid.pctl->finished=0; + m_kMid.pctl->error=0; + m_kMid.pctl->SPEVplayed=0; + m_kMid.pctl->SPEVprocessed=0; +#ifdef KMidDEBUG + passcount=0; +#endif + noteArray->iteratorBegin(); + + TQApplication::flushX(); + if ((m_kMid.pid=fork())==0) + { +#ifdef KMidDEBUG + printf("PlayerProcessID: %d\n",getpid()); +#endif + player->play(0,(void (*)(void))tdemidOutput); +#ifdef KMidDEBUG + printf("End of child process\n"); +#endif + _exit(0); + } + m_kMid.pctl->millisecsPlayed=0; + + + spev=player->specialEvents(); +#ifdef KMidDEBUG + printf("writing SPEV\n"); + player->debugSpecialEvents(); + printf("writing SPEV(END)\n"); +#endif + + while ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->error==0)) ; + + if (m_kMid.pctl->error==1) return; + beginmillisec=m_kMid.pctl->beginmillisec; + + int type; + ulong x=timeOfNextEvent(&type); + if (type!=0) + timer4events->start(x,TRUE); + + timer4timebar->start(1000); + +#ifdef KMidDEBUG + printf("PlayerProcess: %d . ParentProcessID: %d\n",m_kMid.pid,getpid()); + printf("******************************-\n"); +#endif +} + +void tdemidClient::timebarUpdate() +{ + itsme=1; + if (m_kMid.pctl->playing==0) + { + timer4timebar->stop(); + } + + timeval tv; + gettimeofday(&tv, NULL); + ulong currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; + m_kMid.pctl->millisecsPlayed=(currentmillisec-beginmillisec); + + timebar->setValue((int)(m_kMid.pctl->millisecsPlayed)); + itsme=0; + if ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->finished==1)) + { + waitpid(m_kMid.pid, NULL, 0); + if (loopsong) + { + play(); + return; + } + else + nextSong(); + } +} + +void tdemidClient::slotSeek(int i) +{ + if (itsme) return; + + if (m_kMid.pctl->playing==0) + { + itsme=1; + timebar->setValue(0); + itsme=0; + return; + } + + if (m_kMid.pctl->paused) return; + + if (m_kMid.pid!=0) + { + kill(m_kMid.pid,SIGTERM); +#ifdef KMidDEBUG + printf("Waiting for Process %d to be killed\n",m_kMid.pid); +#endif + waitpid(m_kMid.pid, NULL, 0); + m_kMid.midi->closeDev(); + m_kMid.pid=0; + } + allNotesOff(); + + +#ifdef KMidDEBUG + printf("change Time: %d\n",i); +#endif + + timer4events->stop(); + if (channelView!=NULL) channelView->reset(0); + + moveEventPointersTo((ulong)i); + + m_kMid.pctl->playing=0; + m_kMid.pctl->OK=0; + m_kMid.pctl->error=0; + m_kMid.pctl->gotomsec=i; + m_kMid.pctl->message|=PLAYER_SETPOS; + + TQApplication::flushX(); + if ((m_kMid.pid=fork())==0) + { +#ifdef KMidDEBUG + printf("Player_ProcessID: %d\n",getpid()); +#endif + + player->play(0,(void (*)(void))tdemidOutput); + +#ifdef KMidDEBUG + printf("End of child process\n"); +#endif + _exit(0); + } + + while ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->error==0)) ; + + if (m_kMid.pctl->error==1) return; + beginmillisec=m_kMid.pctl->beginmillisec-i; + ulong currentmillisec=m_kMid.pctl->beginmillisec; + + int type; + ulong x=timeOfNextEvent(&type); + if (type!=0) + timer4events->start(x-(currentmillisec-beginmillisec),TRUE); + + /* + if (spev==NULL) return; + ulong delaymillisec=spev->absmilliseconds-(currentmillisec-beginmillisec); + timer4events->start(delaymillisec,TRUE); + */ + + m_kMid.pctl->OK=0; +/* + tempoLCD->display(tempoToMetronomeTempo(m_kMid.pctl->tempo)); + currentTempo=tempoLCD->getValue(); + tempoLCD->setDefaultValue(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo); +*/ +} + +void tdemidClient::moveEventPointersTo(ulong ms) +{ +#ifdef KMidDEBUG + printf("Move To: %lu\n",ms); +#endif + spev=player->specialEvents(); + + ulong tempo=(ulong)(500000 * m_kMid.pctl->ratioTempo); + int num=4; + int den=4; + + while ((spev!=NULL)&&(spev->absmillisecondstype==3) tempo=spev->tempo; + else if (spev->type==6) {num=spev->num;den=spev->den;} + spev=spev->next; + } + tempoLCD->display(tempoToMetronomeTempo(tempo)); + currentTempo=tempoLCD->getValue(); + tempoLCD->setDefaultValue(tempoToMetronomeTempo(tempo)*m_kMid.pctl->ratioTempo); + + rhythmview->setRhythm(num,den); + + kdispt->gotomsec(ms); +// if (noteArray!=NULL) noteArray->moveIteratorTo(ms); + if (noteArray!=NULL) + { + int pgm[16]; + noteArray->moveIteratorTo(ms,pgm); + if (channelView!=NULL) + { + for (int j=0;j<16;j++) + { + if (!m_kMid.pctl->forcepgm[j]) channelView->changeInstrument(j,(m_kMid.pctl->gm==1)?(pgm[j]):(MT32toGM[pgm[j]])); + else channelView->changeInstrument(j,(m_kMid.pctl->pgm[j])); + } + } + } + + /* + if (noteArray!=NULL) + { + noteCmd *ncmd; + noteArray->iteratorBegin(); + ncmd=noteArray->get(); + while ((ncmd!=NULL)&&(ncmd->msnext(); + ncmd=noteArray->get(); + } + } + */ +} + +void tdemidClient::slotSetVolume(int i) +{ + int autochangemap=0; + if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autochangemap=1; + + if (autochangemap) + { + pause(); + } + i=200-i; + m_kMid.pctl->volumepercentage=i; + + if (autochangemap) + { + pause(); + } +} + + +void tdemidClient::slotPrevSong() +{ + if (currentsl==NULL) return; + if (collectionplaylist==NULL) generateCPL(); + if (collectionplaylist==NULL) return; + /* + if (collectionplaymode==0) + { + if (currentsl->getActiveSongID()==1) return; + currentsl->previous(); + } + else + { + int r; + while ((r=1+(int) ((double)(currentsl->NumberOfSongs())*rand()/(RAND_MAX+1.0)))==currentsl->getActiveSongID()) ; + + currentsl->setActiveSong(r); + } + */ + int idx=searchInCPL(currentsl->getActiveSongID()); + if (idx==0) return; + idx--; + currentsl->setActiveSong(collectionplaylist[idx]); + + if (currentsl->getActiveSongID()==-1) + { + // comboSongs->setCurrentItem(0); + // currentsl->setActiveSong(1); + return; + } + + if (m_kMid.pctl->paused) emit stopPause(); + comboSongs->setCurrentItem(currentsl->getActiveSongID()-1); + if (openURL(currentsl->getActiveSongName())==-1) return; + play(); + +} + +void tdemidClient::slotNextSong() +{ + if (currentsl==NULL) return; + if (collectionplaylist==NULL) generateCPL(); + if (collectionplaylist==NULL) return; + + /*if (collectionplaymode==0) + { + if (currentsl->getActiveSongID()==currentsl->NumberOfSongs()) return; + currentsl->next(); + } + else + { + int r; + while ((r=1+(int) ((double)(currentsl->NumberOfSongs())*rand()/(RAND_MAX+1.0)))==currentsl->getActiveSongID()) ; + + #ifdef KMidDEBUG + printf("random number:%d\n",r); + #endif + currentsl->setActiveSong(r); + } + */ + int idx=searchInCPL(currentsl->getActiveSongID()); + idx++; + if (idx==currentsl->NumberOfSongs()) return; + currentsl->setActiveSong(collectionplaylist[idx]); + if (currentsl->getActiveSongID()==-1) + { + //// comboSongs->setCurrentItem(0); + // currentsl->setActiveSong(1); + return; + } + + if (m_kMid.pctl->paused) emit stopPause(); + comboSongs->setCurrentItem(currentsl->getActiveSongID()-1); + if (openURL(currentsl->getActiveSongName())==-1) return; + play(); +} + +void tdemidClient::slotPause() +{ + if (m_kMid.pctl->playing==0) return; +#ifdef KMidDEBUG + printf("song Pause\n"); +#endif + if (m_kMid.pctl->paused==0) + { + if (m_kMid.pid!=0) + { + kill(m_kMid.pid,SIGTERM); + waitpid(m_kMid.pid, NULL, 0); + m_kMid.midi->closeDev(); + m_kMid.pid=0; + } + pausedatmillisec=(ulong)m_kMid.pctl->millisecsPlayed; + m_kMid.pctl->paused=1; + timer4timebar->stop(); + timer4events->stop(); + allNotesOff(); + // kill(m_kMid.pid,SIGSTOP); + // The previous line doesn't work because it stops the two processes (!?) + } + else + { + m_kMid.pctl->playing=0; + m_kMid.pctl->OK=0; + m_kMid.pctl->error=0; + m_kMid.pctl->gotomsec=pausedatmillisec; + m_kMid.pctl->message|=PLAYER_SETPOS; + + TQApplication::flushX(); + if ((m_kMid.pid=fork())==0) + { +#ifdef KMidDEBUG + printf("PlayerProcessID: %d\n",getpid()); +#endif + player->play(0,(void (*)(void))tdemidOutput); +#ifdef KMidDEBUG + printf("End of child process\n"); +#endif + _exit(0); + } + + while ((m_kMid.pctl->playing==0)&&(m_kMid.pctl->error==0)) ; + + if (m_kMid.pctl->error) return; + + m_kMid.pctl->OK=0; + m_kMid.pctl->paused=0; + + beginmillisec=m_kMid.pctl->beginmillisec-pausedatmillisec; + ulong currentmillisec=m_kMid.pctl->beginmillisec; + + int type; + ulong x=timeOfNextEvent(&type); + if (type!=0) + timer4events->start(x-(currentmillisec-beginmillisec),TRUE); + timer4timebar->start(1000); + + if (noteArray!=NULL) + { + int pgm[16]; + noteArray->moveIteratorTo(pausedatmillisec,pgm); + if (channelView!=NULL) + { + for (int j=0;j<16;j++) + { + if (!m_kMid.pctl->forcepgm[j]) channelView->changeInstrument(j,(m_kMid.pctl->gm==1)?(pgm[j]):(MT32toGM[pgm[j]])); + else channelView->changeInstrument(j,(m_kMid.pctl->pgm[j])); + } + } + + } + + } +} + +void tdemidClient::shuttingDown(void) +{ + shuttingdown=true; + stop(); +} + +void tdemidClient::slotStop() +{ + if (!m_kMid.pctl) return; + + if (!shuttingdown) + { + for (int i=0;i<16;i++) m_kMid.pctl->forcepgm[i]=FALSE; + if (channelView) channelView->reset(); + if (tempoLCD) + { + tempoLCD->display(tempoToMetronomeTempo(m_kMid.pctl->tempo)); + currentTempo=tempoLCD->getValue(); + tempoLCD->setDefaultValue(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo); + } + } + + if (m_kMid.pctl->playing==0) return; + + if (m_kMid.pctl->paused) return; +#ifdef KMidDEBUG + printf("song Stop\n"); +#endif + if (m_kMid.pid!=0) + { + kill(m_kMid.pid,SIGTERM); +#ifdef KMidDEBUG + printf("Killing\n"); +#endif + waitpid(m_kMid.pid, NULL, 0); + m_kMid.midi->closeDev(); + m_kMid.pid=0; + } + + m_kMid.pctl->playing=0; + ////////m_kMid.pctl->OK=0; + ////////m_kMid.pctl->message|=PLAYER_HALT; + timer4timebar->stop(); + timer4events->stop(); + + allNotesOff(); + + //m_kMid.pctl->playing=0; + //m_kMid.pctl->paused=0; + ////////while (m_kMid.pctl->OK==0) ; +} + +void tdemidClient::slotRewind() +{ + if ((m_kMid.pctl->playing)&&(!m_kMid.pctl->paused)) + { + timebar->subtractPage(); + slotSeek(timebar->value()); + } +} + +void tdemidClient::slotForward() +{ + if ((m_kMid.pctl->playing)&&(!m_kMid.pctl->paused)) + { + timebar->addPage(); + slotSeek(timebar->value()); + } +} + + +void tdemidClient::allNotesOff() +{ + bool done=false; + m_kMid.pctl->isSendingAllNotesOff=true; + DeviceManager *_midi=new DeviceManager(); + _midi->initManager(); + _midi->openDev(); + _midi->allNotesOff(); + _midi->closeDev(); + delete _midi; + done=true; + m_kMid.pctl->isSendingAllNotesOff=false; +} + +void tdemidClient::tdemidOutput(void) +{ +// Should do nothing + /* + Midi_event *ev=pctl->ev; + + timeval tv; + gettimeofday(&tv, NULL); + ulong currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; + + if ((ev->command==MIDI_SYSTEM_PREFIX)&&((ev->command|ev->chn)==META_EVENT)) + { + if ((ev->d1==5)||(ev->d1==1)) + { + char *text=new char[ev->length+1]; + strncpy(text,(char *)ev->data,ev->length); + text[ev->length]=0; +#ifdef KMidDEBUG + printf("%s , played at: %ld\n",text,currentmillisec-beginmillisec); +#endif + } + else if (ev->d1==ME_SET_TEMPO) + { + int tempo=(ev->data[0]<<16)|(ev->data[1]<<8)|(ev->data[2]); + // printf("Change tempo: %d , %g, played at:%ld\n",tempo,tempoToMetronomeTempo(tempo),currentmillisec-beginmillisec); + } + + } + */ +} + + +void tdemidClient::processSpecialEvent() +{ +/* + if (spev==NULL) + { + printf("SPEV == NULL !!!!!\n"); + return; + } +*/ + +//#ifdef KMidDEBUG +// printf(":::: %ld",passcount++); +// printf("%d %s %ld",spev->type,spev->text,spev->absmilliseconds); +//#endif + + int processNext=1; + int type; + ulong x; + + long delaymillisec=~0; + + while (processNext) + { + /* + timeval tv; + gettimeofday(&tv, NULL); + ulong currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; + */ + + x=timeOfNextEvent(&type); + + if (type==0) return; + if (type==1) + { + if ((spev->type==1) || (spev->type==5)) + { + kdispt->PaintIn(spev->type); + } + else if (spev->type==3) + { + tempoLCD->display(tempoToMetronomeTempo(spev->tempo)); +#ifdef KMidDEBUG + printf("Changing lcd tempo: spev->tempo: %d , ratio: %.9g\n",spev->tempo,m_kMid.pctl->ratioTempo); + printf("Result: %g %.9g %d\n",tempoToMetronomeTempo(spev->tempo),tempoToMetronomeTempo(spev->tempo),(int)tempoToMetronomeTempo(spev->tempo)); +#endif + currentTempo=tempoLCD->getValue(); + tempoLCD->setDefaultValue(tempoToMetronomeTempo(spev->tempo)*m_kMid.pctl->ratioTempo); + } + else if (spev->type==6) + { + rhythmview->setRhythm(spev->num,spev->den); + } + else if (spev->type==7) + { +#ifdef KMidDEBUG + printf("Beat: %d/%d\n",spev->num,spev->den); +#endif + rhythmview->Beat(spev->num); + } + m_kMid.pctl->SPEVprocessed++; + spev=spev->next; + } + if (type==2) + { + NoteArray::noteCmd *ncmd=noteArray->get(); + if (ncmd==NULL) {printf("ncmd is NULL !!!");return;} + if (channelView!=NULL) + { + if (ncmd->cmd==1) channelView->noteOn(ncmd->chn,ncmd->note); + else if (ncmd->cmd==0) channelView->noteOff(ncmd->chn,ncmd->note); + else if (ncmd->cmd==2) + if (!m_kMid.pctl->forcepgm[ncmd->chn]) channelView->changeInstrument(ncmd->chn,(m_kMid.pctl->gm==1)?(ncmd->note):(MT32toGM[ncmd->note])); + else channelView->changeInstrument(ncmd->chn,(m_kMid.pctl->pgm[ncmd->chn])); + + noteArray->next(); + } + } + processNext=0; + + x=timeOfNextEvent(&type); + + if (type==0) return; + + timeval tv; + ulong currentmillisec; + gettimeofday(&tv, NULL); + currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; + delaymillisec=x-(currentmillisec-beginmillisec); + if (delaymillisec<10) processNext=1; + } + + if (delaymillisec!=~(long)0) timer4events->start(delaymillisec,TRUE); + +} + +void tdemidClient::repaintText(int type) +{ + kdispt->ChangeTypeOfTextEvents(type); + typeoftextevents=type; + kdispt->repaint(TRUE); +} + +int tdemidClient::ChooseTypeOfTextEvents(void) +{ + return kdispt->ChooseTypeOfTextEvents(); +} + +void tdemidClient::setSongType(int i) +{ + int autochangetype=0; + if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autochangetype=1; + + if (autochangetype) + { + pause(); + } + m_kMid.pctl->gm=i; + + if (autochangetype) + { + pause(); + } + +} + + +TQFont * tdemidClient::getFont(void) +{ +return kdispt->getFont(); +} + +void tdemidClient::fontChanged(void) +{ + kdispt->fontChanged(); +} + +void tdemidClient::setMidiDevice(int i) +{ + midi->setDefaultDevice(i); +} + +void tdemidClient::setMidiMapFilename(const char *mapfilename) +{ + MidiMapper *map=new MidiMapper(mapfilename); + if (map->ok()==-1) + { + TQString tmp = locate("appdata", TQString("maps/") + mapfilename); + delete map; + map=new MidiMapper(tmp.local8Bit()); + if (map->ok()!=1) + { + delete map; + map=new MidiMapper(NULL); + } + } + int autochangemap=0; + if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autochangemap=1; + + if (autochangemap) + { + pause(); + } + midi->setMidiMap(map); + if (autochangemap) + { + pause(); + } +} + +void tdemidClient::setSLManager(SLManager *slm) +{ + if (slman!=NULL) delete slman; + slman=slm; +} + +void tdemidClient::setActiveCollection(int i) +{ + activecollection=i; + TDEConfig *kconf=TDEGlobal::instance()->config(); + + kconf->setGroup("KMid"); + kconf->writeEntry("ActiveCollection",activecollection); + currentsl=slman->getCollection(activecollection); + generateCPL(); + initializing_songs=1; + fillInComboSongs(); + initializing_songs=0; +} + +void tdemidClient::fillInComboSongs(void) +{ + //int oldselected=comboSongs->currentItem(); + comboSongs->clear(); + //comboSongs->setCurrentItem(-1); + if (currentsl==NULL) return; + currentsl->iteratorStart(); + char temp[FILENAME_MAX]; + char temp2[FILENAME_MAX]; + TQString qs; + while (!currentsl->iteratorAtEnd()) + { + qs=currentsl->getIteratorName(); + //KURL::decode(qs); + sprintf(temp,"%d - %s",currentsl->getIteratorID(), + extractFilename(KURL::decode_string(qs).ascii(),temp2)); + comboSongs->insertItem(temp); + currentsl->iteratorNext(); + } + if (currentsl->getActiveSongID()==-1) return; + comboSongs->setCurrentItem(currentsl->getActiveSongID()-1); + /* + if (oldselected==currentsl->getActiveSongID()-1) + { + slotSelectSong(currentsl->getActiveSongID()-1); + } + */ + slotSelectSong(currentsl->getActiveSongID()-1); +} + +void tdemidClient::slotSelectSong(int i) +{ + if (currentsl==NULL) return; + i++; + if ((i<=0)) // The collection may be empty, or it may be just a bug :-) + { +#ifdef KMidDEBUG + printf("Empty\n"); +#endif + emit stopPause(); + if (m_kMid.pctl->playing) stop(); + if (midifile_opened!=NULL) delete midifile_opened; + midifile_opened=NULL; + player->removeSong(); + timebar->setRange(0,240000); + timebar->setValue(0); + timetags->repaint(TRUE); + kdispt->ClearEv(); + kdispt->repaint(TRUE); + comboSongs->clear(); + comboSongs->repaint(TRUE); + topLevelWidget()->setCaption("KMid"); + return; + } + + if ((i==currentsl->getActiveSongID())&&(!initializing_songs)) return; + int pl=0; + if (m_kMid.pctl->playing==1) pl=1; + + if (m_kMid.pctl->paused) emit stopPause(); + if (/*(i!=currentsl->getActiveSongID())&&*/(pl==1)) stop(); + currentsl->setActiveSong(i); + if (openURL(currentsl->getActiveSongName())==-1) return; + if (pl) play(); + +} + + +int tdemidClient::getSelectedSong(void) +{ + if (currentsl==NULL) return -1; + return currentsl->getActiveSongID(); +} + + +void tdemidClient::setSongLoop(int i) +{ + loopsong=i; +} + + +void tdemidClient::generateCPL(void) +{ + delete [] collectionplaylist; + collectionplaylist=0; + + if (currentsl==NULL) return; + + if (collectionplaymode==0) + collectionplaylist=generate_list(currentsl->NumberOfSongs()); + else + collectionplaylist=generate_random_list(currentsl->NumberOfSongs()); +} + + +void tdemidClient::setCollectionPlayMode(int i) +{ + collectionplaymode=i; + generateCPL(); +} + +void tdemidClient::saveCollections(void) +{ + if (slman==NULL) return; +#ifdef KMidDEBUG + printf("Saving collections in: %s\n",collectionsfile.ascii()); +#endif + slman->saveConfig(TQFile::encodeName(collectionsfile)); +} + +void tdemidClient::saveLyrics(FILE *fh) +{ + if (kdispt!=NULL) kdispt->saveLyrics(fh); +} + +int tdemidClient::searchInCPL(int song) +{ + if (currentsl==NULL) return -1; + int i=0; + int n=currentsl->NumberOfSongs(); + while ((ishow(); + else + volumebar->hide(); +#endif +} + +void tdemidClient::visibleChannelView(int i) +{ + if ((channelView==NULL)&&(i==1)) + { + channelView=new ChannelView(); + if (noteArray!=NULL) + { + int pgm[16],j; + noteArray->moveIteratorTo((ulong)m_kMid.pctl->millisecsPlayed,pgm); + for (j=0;j<16;j++) + { + if (!m_kMid.pctl->forcepgm[j]) channelView->changeInstrument(j,(m_kMid.pctl->gm==1)?(pgm[j]):(MT32toGM[pgm[j]])); + else channelView->changeInstrument(j,(m_kMid.pctl->pgm[j])); + channelView->changeForceState(j,m_kMid.pctl->forcepgm[j]); + } + } + channelView->show(); + connect(channelView,TQT_SIGNAL(signalToKMidClient(int *)),this,TQT_SLOT(communicationFromChannelView(int *))); + connect(kapp,TQT_SIGNAL(shutDown()),parentWidget(),TQT_SLOT(shuttingDown())); + + } + else if ((channelView!=NULL)&&(i==0)) + { + delete channelView; + channelView=NULL; + + } + rethinkNextEvent(); +} + +void tdemidClient::channelViewDestroyed() +{ + channelView=NULL; + rethinkNextEvent(); +} + + +void tdemidClient::rethinkNextEvent(void) +{ + if (m_kMid.pctl->playing==0) return; + timer4events->stop(); + + int type; + ulong delaymillisec; + ulong x=timeOfNextEvent(&type); + + if (type==0) return; + + timeval tv; + ulong currentmillisec; + gettimeofday(&tv, NULL); + currentmillisec=tv.tv_sec*1000+tv.tv_usec/1000; + delaymillisec=x-(currentmillisec-beginmillisec); + + timer4events->start(delaymillisec,TRUE); +} + +void tdemidClient::communicationFromChannelView(int *i) +{ + if (i==NULL) return; + int autocontplaying=0; + if ((i[0]==CHN_CHANGE_PGM)||((i[0]==CHN_CHANGE_FORCED_STATE)&&(i[3]==1))) + { + if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autocontplaying=1; + + if (autocontplaying) + { + pause(); + } + } + if (i[0]==CHN_CHANGE_PGM) + m_kMid.pctl->pgm[i[1]-1]=i[2]; + else if (i[0]==CHN_CHANGE_FORCED_STATE) + m_kMid.pctl->forcepgm[i[1]-1]=i[2]; + if ((i[0]==CHN_CHANGE_PGM)||((i[0]==CHN_CHANGE_FORCED_STATE)&&(i[3]==1))) + { + if (autocontplaying) + { + pause(); + } + } + +} + +void tdemidClient::slotSetTempo(double value) +{ + if (!player->isSongLoaded()) + { + tempoLCD->display(120); + currentTempo=120; + tempoLCD->setDefaultValue(120); + return; + } + +#ifdef KMidDEBUG + printf("Change tempo to %g\n",value); +#endif + int autocontplaying=0; + + if ((m_kMid.pctl->playing==1)&&(m_kMid.pctl->paused==0)) autocontplaying=1; + + + if (autocontplaying) + { + pause(); + } + +// double ratio=(tempoToMetronomeTempo(m_kMid.pctl->tempo)*m_kMid.pctl->ratioTempo)/(value); +// double ratio=(tempoLCD->getOldValue()*m_kMid.pctl->ratioTempo)/(value); + double ratio=(currentTempo*m_kMid.pctl->ratioTempo)/value; + + char s[20]; + sprintf(s,"%g",ratio); + if (strcmp(s,"1")!=0) tempoLCD->setLCDColor (255,100,100); + else tempoLCD->setLCDColor (100,255,100); +#ifdef KMidDEBUG + printf("ratio: (%.9g = %g ) tempo now: %g , new tempo %g\n",ratio,ratio,tempoToMetronomeTempo(m_kMid.pctl->tempo),value); + printf("OldValue: %g , value %g\n",tempoLCD->getOldValue(),value); +#endif + + if (m_kMid.pctl->paused==1) + { + pausedatmillisec=(long)(((double)pausedatmillisec/m_kMid.pctl->ratioTempo)*ratio); +#ifdef KMidDEBUG + printf("pausedat: %ld\n",pausedatmillisec); +#endif + } + player->setTempoRatio(ratio); + + timebar->setRange(0,(int)(player->information()->millisecsTotal)); + timebar->setValue(pausedatmillisec); + timetags->repaint(TRUE); + + kdispt->ClearEv(false); + + noteArray=player->noteArray(); + spev=player->specialEvents(); + currentTempo=value; + + while (spev!=NULL) + { + if ((spev->type==1) || (spev->type==5)) + { + kdispt->AddEv(spev); + } + spev=spev->next; + } + + kdispt->calculatePositions(); + kdispt->CursorToHome(); + if (m_kMid.pctl->paused==1) + moveEventPointersTo(pausedatmillisec); + + if (autocontplaying) + { + pause(); + } + +} + +void tdemidClient::downloadFinished(TDEIO::Job *) +{ + downloaded=true; + kapp->exit_loop(); +} + +TQSize tdemidClient::sizeHint() const +{ + TQSize sh = TQWidget::sizeHint(); + return sh.expandedTo(TQSize(560,420)); +} + +TQSizePolicy tdemidClient::sizePolicy() +{ + return TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); +} + + +void tdemidClient::play() +{ + slotPlay(); +} +void tdemidClient::pause() +{ + slotPause(); +} +void tdemidClient::stop() +{ + slotStop(); +} +void tdemidClient::rewind() +{ + slotRewind(); +} +void tdemidClient::forward() +{ + slotForward(); +} +void tdemidClient::seek(int ms) +{ + slotSeek(ms); +} +void tdemidClient::prevSong() +{ + slotPrevSong(); +} +void tdemidClient::nextSong() +{ + slotNextSong(); +} +void tdemidClient::setVolume(int i) +{ + slotSetVolume(200-i); +} +void tdemidClient::setTempo(int i) +{ + slotSetTempo(i); +} +void tdemidClient::setSongEncoding( int i ) +{ + KListAction *tmplistaction= + ((KListAction*)actionCollection->action("file_type")); + + tmplistaction->setCurrentItem(i); +} +void tdemidClient::setLyricEvents( int i ) +{ + KListAction *tmplistaction= + ((KListAction*)actionCollection->action("display_events")); + tmplistaction->setCurrentItem(i); +} +void tdemidClient::setCurrentSong(int i) +{ + getComboSongs()->setCurrentItem(i-1); + slotSelectSong(i-1); +} +void tdemidClient::setPlayListMode(int i) +{ + ((KListAction*)actionCollection->action("play_order"))->setCurrentItem(i); +} +void tdemidClient::slotSelectEncoding(int i) +{ + if (i == 0) + kdispt->setLyricsEncoding(TQString()); // Default + else + kdispt->setLyricsEncoding(TDEGlobal::charsets()->encodingForName(comboEncodings->text(i))); +} +#include "tdemidclient.moc" diff --git a/tdemid/tdemidclient.h b/tdemid/tdemidclient.h new file mode 100644 index 00000000..526b0656 --- /dev/null +++ b/tdemid/tdemidclient.h @@ -0,0 +1,241 @@ +/************************************************************************** + + tdemidclient.h - The main client widget of KMid + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _KMIDCLIENT_H +#define _KMIDCLIENT_H + +#include "qslidertime.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "kdisptext.h" +#include "slman.h" +#include "version.h" +#include "tdemidIface.h" + +#include + +class DeviceManager; + + +class TDEApplication; +class TDEConfig; +class KLCDNumber; +class TQLabel; +class TQComboBox; +class RhythmView; +class ChannelView; +class TQString; + +class tdemidClient : public TQWidget, virtual public KMidIface +{ + Q_OBJECT + +private: +#ifdef KMidDEBUG + long passcount; +#endif + + DeviceManager *midi; + MidiPlayer *player; + + struct kMidData m_kMid; + + TQTimer *timer4timebar; + TQTimer *timer4events; + + ulong beginmillisec; + ulong pausedatmillisec; + double currentTempo; + SpecialEvent *spev; + NoteArray *noteArray; + + bool downloaded; + + int itsme; + bool shuttingdown; + int visiblevolumebar; + + char *midifile_opened; + int hasbeenopened; + + int typeoftextevents; + + SLManager *slman; + int activecollection; + TQString collectionsfile; + SongList *currentsl; + int initializing_songs; + int loopsong; + int collectionplaymode; + int *collectionplaylist; // the list of songs ordered in the + // user selected mode + + class KActionCollection *actionCollection; + + void generateCPL(void); + int searchInCPL(int song); // Returns the index of song + + void fillInComboSongs(void); + + int openFile(const char *filename); + void allNotesOff(void); +public: + tdemidClient(TQWidget *parent, KActionCollection *ac, const char *name=0); + ~tdemidClient(); + + char *midiFileName(void) {return midifile_opened;}; + // If it returns NULL then there isn't any file opened + + int isPlaying(void) {return m_kMid.pctl->playing;}; + int isPaused(void) {return (m_kMid.pctl->playing)&&(m_kMid.pctl->paused);}; + + int openURL(const TQString s); + + void repaintText(int typeoftextevents); + static void tdemidOutput(void); + + int ChooseTypeOfTextEvents(void); + + TQFont *getFont(void); + void fontChanged(void); // The new font is already in TDEConfig + + SLManager *getSLManager(void) {return slman;}; + void setSLManager(SLManager *slm); + // setSLManager only change the pointer, so DO NOT DELETE + // the objectr you pass to it + int getActiveCollection(void) {return activecollection;}; + void setActiveCollection(int i); + int getSelectedSong(void); + void saveCollections(void); + + void setSongType(int i); + void setSongLoop(int i); + void setCollectionPlayMode(int i); + + void visibleVolumeBar(int i); // 1 shows it, and 0 hides it + // int isVisibleVolumeBar(void) {return visiblevolumebar;}; + void visibleChannelView(int i); + + void shuttingDown(void); + + ulong timeOfNextEvent(int *type=NULL); + void rethinkNextEvent(void); + // Recalculates time of next event and updates the timer4events according to it + + + void moveEventPointersTo(ulong ms); + +protected: +// void resizeEvent(TQResizeEvent *qre); + + +public slots: +// void help_Help(); +// void help_About(); + void slotPlay(); + void slotPause(); + void slotStop(); + void slotRewind(); + void slotForward(); + void slotPrevSong(); + void slotNextSong(); + + void timebarUpdate(); + void slotSeek(int i); + void slotSetVolume(int i); + void slotSelectSong(int i); + void slotSelectEncoding(int i); + + void downloadFinished( TDEIO::Job * ); + + void processSpecialEvent(); + + void channelViewDestroyed(); + + void communicationFromChannelView(int *); + + void slotSetTempo(double value); + +signals: + void mustRechooseTextEvent(); + void stopPause(); +// void channelView_Destroyed(); + +public: + void saveLyrics(FILE *fh); + + DeviceManager *devman(void) {return midi;}; + void setMidiDevice(int i); + void setMidiMapFilename(const char *mapfilename); + + ChannelView *getChannelView(void) { return channelView; }; + KDisplayText *getKDisplayText(void) { return kdispt; }; + + TQSizePolicy sizePolicy(); + + TQComboBox *getComboSongs() { return comboSongs; }; + + + void play(); + void pause(); + void stop(); + void rewind(); + void forward(); + void seek(int ms); + void prevSong(); + void nextSong(); + void setVolume(int i); + void setTempo(int i); + void setSongEncoding( int i ); + void setLyricEvents( int i ); + void setCurrentSong(int i); + void setPlayListMode(int i); + + TQSize sizeHint() const; +private: + TQSlider *timebar; + QSliderTime *timetags; + TQSlider *volumebar; + + KLCDNumber *tempoLCD; + KDisplayText *kdispt; + TQLabel *qlabelTempo; + TQComboBox *comboSongs; + TQComboBox *comboEncodings; + RhythmView *rhythmview; + + + ChannelView *channelView; + +}; + +char *extractFilename(const char *in,char *out); // returns a pointer to out + +#endif + diff --git a/tdemid/tdemidframe.cpp b/tdemid/tdemidframe.cpp new file mode 100644 index 00000000..cbadbc73 --- /dev/null +++ b/tdemid/tdemidframe.cpp @@ -0,0 +1,728 @@ +/************************************************************************** + + tdemidframe.cpp - The main widget of KMid + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tdemidframe.h" +#include "tdemidclient.h" +#include "midicfgdlg.h" +#include "collectdlg.h" +#include "channelcfgdlg.h" +#include "channelview.h" +#include "version.h" + +tdemidFrame::tdemidFrame(const char *name) + :KMainWindow(0, name) +{ + tdemidclient=new tdemidClient(this,actionCollection(), "KMidClient"); + tdemidclient->setSongType(1); + tdemidclient->show(); + setCentralWidget( tdemidclient ); +/* + kKeysAccel=new KAccel(this); + kKeysAccel->insertItem(i18n("Play/Pause"),"Play/Pause", Key_Space); + kKeysAccel->connectItem("Play/Pause", TQT_TQOBJECT(this), TQT_SLOT(spacePressed())); + kKeysAccel->insertItem(i18n("Stop"),"Stop", Key_Backspace); + kKeysAccel->connectItem("Stop",tdemidclient,TQT_SLOT(song_Stop())); + kKeysAccel->insertItem(i18n("Previous Song"),"Previous Song", Key_Left); + kKeysAccel->connectItem("Previous Song",tdemidclient,TQT_SLOT(song_PlayPrevSong())); + kKeysAccel->insertItem(i18n("Next Song"),"Next Song", Key_Right); + kKeysAccel->connectItem("Next Song",tdemidclient,TQT_SLOT(song_PlayNextSong())); + kKeysAccel->insertItem(i18n("Scroll Down Karaoke"),"Scroll down karaoke",Key_Down); + kKeysAccel->connectItem("Scroll Down karaoke",tdemidclient->getKDisplayText(),TQT_SLOT(ScrollDown())); + kKeysAccel->insertItem(i18n("Scroll Up Karaoke"),"Scroll up karaoke",Key_Up); + kKeysAccel->connectItem("Scroll Up Karaoke",tdemidclient->getKDisplayText(),TQT_SLOT(ScrollUp())); + kKeysAccel->insertItem(i18n("Scroll Page Down Karaoke"),"Scroll page down karaoke",Key_PageDown); + kKeysAccel->connectItem("Scroll Page Down Karaoke",tdemidclient->getKDisplayText(),TQT_SLOT(ScrollPageDown())); + kKeysAccel->insertItem(i18n("Scroll Page Up Karaoke"),"Scroll page up karaoke",Key_PageUp); + kKeysAccel->connectItem("Scroll Page Up Karaoke",tdemidclient->getKDisplayText(),TQT_SLOT(ScrollPageUp())); + + kKeysAccel->readSettings(); +*/ + KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(file_Open()), actionCollection()); + (void)new KAction(i18n("&Save Lyrics..."), 0, TQT_TQOBJECT(this), + TQT_SLOT(file_SaveLyrics()), actionCollection(), "file_save_lyrics"); + KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection()); + + (void)new KAction(i18n("&Play"), "player_play", TQt::Key_Space, + TQT_TQOBJECT(tdemidclient), TQT_SLOT(slotPlay()), actionCollection(), "song_play"); + (void)new KAction(i18n("P&ause"), "player_pause", TQt::Key_P, TQT_TQOBJECT(tdemidclient), + TQT_SLOT(slotPause()), actionCollection(), "song_pause"); + (void)new KAction(i18n("&Stop"), "player_stop", TQt::Key_Backspace, + TQT_TQOBJECT(tdemidclient), TQT_SLOT(slotStop()), actionCollection(), "song_stop"); + + (void)new KAction(i18n("P&revious Song"), "player_start", Key_Left, + TQT_TQOBJECT(tdemidclient), TQT_SLOT(slotPrevSong()), actionCollection(), + "song_previous"); + (void)new KAction(i18n("&Next Song"), "player_end", Key_Right, + TQT_TQOBJECT(tdemidclient), TQT_SLOT(slotNextSong()), actionCollection(), + "song_next"); + (void)new KToggleAction(i18n("&Loop"), 0, TQT_TQOBJECT(this), TQT_SLOT(song_Loop()), + actionCollection(), "song_loop"); + + (void)new KAction(i18n("Rewind"), "2leftarrow", 0, TQT_TQOBJECT(tdemidclient), + TQT_SLOT(slotRewind()), actionCollection(), "song_rewind"); + + (void)new KAction(i18n("Forward"), "2rightarrow", 0, TQT_TQOBJECT(tdemidclient), + TQT_SLOT(slotForward()), actionCollection(), "song_forward"); + + (void)new KAction(i18n("&Organize..."), 0, TQT_TQOBJECT(this), TQT_SLOT(collect_organize()), + actionCollection(), "collect_organize"); + + TQStringList playmodes; + playmodes.append(i18n("In Order")); + playmodes.append(i18n("Shuffle")); + + KSelectAction *act=new KSelectAction(i18n("Play Order"), 0, /*this, TQT_SLOT(collect_PlayOrder(int)),*/ + actionCollection(), "play_order"); + connect(act,TQT_SIGNAL(activated(int)),this, TQT_SLOT(collect_PlayOrder(int))); + act->setItems(playmodes); + + (void)new KToggleAction(i18n("Auto-Add to Collection"), 0, TQT_TQOBJECT(this), + TQT_SLOT(collect_AutoAdd()), actionCollection(), "collect_autoadd"); + + playmodes.clear(); + playmodes.append(i18n("&General MIDI")); + playmodes.append(i18n("&MT-32")); + + act=new KSelectAction(i18n("File Type"), 0,/* this, TQT_SLOT(options_FileType(int)),*/ + actionCollection(), "file_type"); + connect(act,TQT_SIGNAL(activated(int)),this, TQT_SLOT(options_FileType(int))); + act->setItems(playmodes); + + playmodes.clear(); + playmodes.append(i18n("&Text Events")); + playmodes.append(i18n("&Lyric Events")); + + act=new KSelectAction(i18n("Display Events"), Key_T, /*this, + TQT_SLOT(options_DisplayEvents(int)),*/ actionCollection(), + "display_events"); + connect(act,TQT_SIGNAL(activated(int)),this, TQT_SLOT(options_DisplayEvents(int))); + act->setItems(playmodes); + + (void)new KToggleAction(i18n("Automatic Text Chooser"), 0, TQT_TQOBJECT(this), + TQT_SLOT(options_AutomaticText()), actionCollection(), + "option_automatictext"); + + KToggleAction* togact = new KToggleAction(i18n("Show &Volume Bar"), "volume", + 0, TQT_TQOBJECT(this), TQT_SLOT(options_ShowVolumeBar()), actionCollection(), + "toggle_volumebar"); + togact->setCheckedState(i18n("Hide &Volume Bar")); + + togact = new KToggleAction(i18n("Show &Channel View"), "piano", + 0, TQT_TQOBJECT(this), TQT_SLOT(options_ShowChannelView()), actionCollection(), + "toggle_channelview"); + togact->setCheckedState(i18n("Hide &Channel View")); + + (void)new KAction(i18n("Channel View &Options..."), 0, TQT_TQOBJECT(this), + TQT_SLOT(options_ChannelViewOptions()), actionCollection(), + "channelview_options"); + + (void)new KAction(i18n("&Font Change..."), 0, TQT_TQOBJECT(this), + TQT_SLOT(options_FontChange()), actionCollection(), + "change_font"); + + (void)new KAction(i18n("MIDI &Setup..."), 0, TQT_TQOBJECT(this), + TQT_SLOT(options_MidiSetup()), actionCollection(), "midi_setup"); + + + setupGUI((ToolBar | Keys | StatusBar | Save | Create ), "tdemidui.rc" ); + + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + KSelectAction *tmplistaction= + ((KSelectAction*)actionCollection()->action("display_events")); + + if (cfg->readNumEntry("TypeOfTextEvents",5)==5) + tmplistaction->setCurrentItem(1); + else + tmplistaction->setCurrentItem(0); + + tmplistaction=((KSelectAction*)actionCollection()->action("file_type")); + if (cfg->readNumEntry("TypeOfMidiFile",0)==0) + tmplistaction->setCurrentItem(0); + else + tmplistaction->setCurrentItem(1); + + if (cfg->readNumEntry("Loop",0)==1) + ((KToggleAction*)actionCollection()->action("song_loop"))->setChecked(true); + + if (cfg->readNumEntry("ShowVolumeBar",0)==1) + ((KToggleAction*)actionCollection()->action("toggle_volumebar"))->setChecked(true); + + + tmplistaction=((KSelectAction*)actionCollection()->action("play_order")); + if (cfg->readNumEntry("CollectionPlayMode",0)==0) + tmplistaction->setCurrentItem(0); + else + tmplistaction->setCurrentItem(1); + + if ((cfg->readNumEntry("AutoAddToCollection",0))==1) + ((KToggleAction*)actionCollection()->action("collect_autoadd"))->setChecked(true); + + if ((cfg->readNumEntry("AutomaticTextEventChooser",1))==1) + ((KToggleAction*)actionCollection()->action("option_automatictext"))->setChecked(true); + + setAcceptDrops(true); + + connect( tdemidclient, TQT_SIGNAL( mustRechooseTextEvent() ), + this, TQT_SLOT( rechooseTextEvent() ) ); + + connect( tdemidclient, TQT_SIGNAL( stopPause() ), + this, TQT_SLOT( song_stopPause() ) ); + +// connect( tdemidclient, TQT_SIGNAL( channelView_Destroyed() ), +// this, TQT_SLOT( channelViewDestroyed() ) ); + + TDECmdLineArgs * args = TDECmdLineArgs::parsedArgs(); + + if ( args->count() > 0 ) + { +// printf("Opening command line file...\n"); + int backautoadd=cfg->readNumEntry("AutoAddToCollection",0); + cfg->writeEntry("AutoAddToCollection",0); + + char ttt[40]; + sprintf(ttt,"%d",kapp->argc()); + int i=0; + int c=autoAddSongToCollection( args->url( 0 ).path() , 1 ); + i++; + while (icount()) + { + autoAddSongToCollection( args->url( i ).path() , 0 ); + i++; + } + + tdemidclient->setActiveCollection(c); + + /// tdemidclient->openURL((kapp->argv())[1]); + /* if ((cfg->readNumEntry("AutomaticTextEventChooser",1))==1) + { + if (tdemidclient->ChooseTypeOfTextEvents()==1) + options_Text(); + else + options_Lyrics(); + }*/ + if (tdemidclient->midiFileName()!=NULL) tdemidclient->play(); + cfg->writeEntry("AutoAddToCollection",backautoadd); + } + + args->clear(); + /* + kKeys->addKey("Play/Pause",Key_Space); + kKeys->registerWidget("KMidFrame",this); + kKeys->connectFunction("KMidFrame","Play/Pause",this,TQT_SLOT(spacePressed())); + */ +// kKeysAccel->writeSettings(cfg); + + DCOPClient *client = kapp->dcopClient(); + if (!client->isRegistered()) // just in case we're embeeded + { + client->attach(); + client->registerAs("tdemid"); + } +} + +tdemidFrame::~tdemidFrame() +{ +} + +void tdemidFrame::file_Open() +{ + KURL url = KFileDialog::getOpenURL(TQString(), "*.kar *.mid *.kar.gz *.mid.gz\n*.kar *.kar.gz\n*.mid *.mid.gz\n*",this); + + if( url.isEmpty() ) + return; + + if( !url.isLocalFile() ) + { + KMessageBox::sorry( 0L, i18n( "Only local files are currently supported." ) ); + return; + } + + openURL(url.path()); +} + + + +void tdemidFrame::song_stopPause() +{ + if (tdemidclient->isPaused()) + { + // song_Pause(); + ((KToggleAction*)actionCollection()->action("song_pause"))->setChecked(false); + tdemidclient->pause(); + } +} + +void tdemidFrame::options_FileType(int i) +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + cfg->writeEntry("TypeOfMidiFile",i); + tdemidclient->setSongType(1-i); +} + +void tdemidFrame::options_DisplayEvents(int i) +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + cfg->writeEntry("TypeOfTextEvents",(i==0)?1:5); + cfg->sync(); + tdemidclient->repaintText((i==0)?1:5); +} + +void tdemidFrame::options_AutomaticText() +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + cfg->writeEntry("AutomaticTextEventChooser",1-cfg->readNumEntry("AutomaticTextEventChooser",1)); +} + +void tdemidFrame::options_FontChange() +{ + KFontDialog *kfd=new KFontDialog(this); + TQFont font; + font=*tdemidclient->getFont(); + kfd->getFont(font); + delete kfd; + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + cfg->writeEntry("KaraokeFont",font); + cfg->sync(); + tdemidclient->fontChanged(); +} + +int tdemidFrame::autoAddSongToCollection(const TQString& filename,int setactive) +{ + int r; + SLManager *slman; + SongList *sl; + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + if (cfg->readNumEntry("AutoAddToCollection",0)==0) + { + r=0; + slman=tdemidclient->getSLManager(); + if (setactive) slman->createTemporaryCollection(); + sl=slman->getCollection(0); + if (filename==NULL) sl->AddSong(tdemidclient->midiFileName()); + else sl->AddSong(TQFile::encodeName(filename)); + } + else + { + slman=tdemidclient->getSLManager(); + sl=slman->getCollection(tdemidclient->getActiveCollection()); + r=tdemidclient->getActiveCollection(); + if (sl==NULL) return 0; + int id; + if (filename==NULL) id=sl->AddSong(tdemidclient->midiFileName()); + else id=sl->AddSong(TQFile::encodeName(filename)); + if (setactive) + { + sl->setActiveSong(id); + } + } + return r; +} + +void tdemidFrame::urlDrop_slot(TQDropEvent* e) +{ + dropEvent(e); +} + +void tdemidFrame::dragEnterEvent(TQDragEnterEvent* e) +{ + e->accept(KURLDrag::canDecode(e)); +} + +void tdemidFrame::dropEvent( TQDropEvent * event ) +{ + KURL::List list; + KURLDrag::decode(event, list); + + if (list.count()==0) return; + + bool first = true; + int c = true; + + for (KURL::List::ConstIterator it = list.begin(); + it != list.end(); ++it) + { + if (!(*it).isLocalFile()) + continue; + + if (first) + { + c = autoAddSongToCollection((*it).path(),1); + first = false; + } + else + { + autoAddSongToCollection((*it).path(),0); + } + } + + if (!first) + { + tdemidclient->setActiveCollection(c); + + if ((!tdemidclient->isPlaying())&&(tdemidclient->midiFileName()!=NULL)) + tdemidclient->play(); + } +} + +void tdemidFrame::shuttingDown() +{ + if (tdemidclient->isPlaying()==1) + { +// tdemidclient->stop(); + tdemidclient->shuttingDown(); + } + tdemidclient->saveCollections(); +} + +void tdemidFrame::saveProperties(TDEConfig *cfg) +{ + tdemidclient->saveCollections(); + int play=tdemidclient->isPlaying(); + cfg->writeEntry("File",tdemidclient->midiFileName()); + cfg->writeEntry("ActiveCollection",tdemidclient->getActiveCollection()); + cfg->writeEntry("ActiveSong",tdemidclient->getSelectedSong()); + cfg->writeEntry("Playing",play); +} + +void tdemidFrame::readProperties(TDEConfig *cfg) +{ + int activecol=cfg->readNumEntry("ActiveCollection",0); + int activesong=cfg->readNumEntry("ActiveSong",0); + int wasplaying=cfg->readNumEntry("Playing",0); + SLManager *slman=tdemidclient->getSLManager(); + SongList *sl=slman->getCollection(activecol); + sl->setActiveSong(activesong); + tdemidclient->setActiveCollection(activecol); + tdemidclient->slotSelectSong(activesong-1); + + if ((activecol==0)&&(wasplaying)) // It was the temporary collection, + { // surely the user would like to continue + // hearing the song + TQString s = cfg->readPathEntry("File"); + int c=autoAddSongToCollection(s,1); + tdemidclient->setActiveCollection(c); + } + + if ((wasplaying)&&(tdemidclient->midiFileName()!=NULL)) tdemidclient->play(); +} + +void tdemidFrame::options_MidiSetup() +{ + if (tdemidclient->devman()->checkInit()<0) + { + KMessageBox::error(this, + i18n("Could not open /dev/sequencer to get some info.\nProbably there is another program using it.")); + return; + } + MidiConfigDialog *dlg; + + dlg=new MidiConfigDialog(tdemidclient->devman(),NULL,"MidiDialog"); + if (dlg->exec() == TQDialog::Accepted) + { + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + cfg->writeEntry("MidiPortNumber",MidiConfigDialog::selecteddevice); + tdemidclient->setMidiDevice(MidiConfigDialog::selecteddevice); + cfg->setGroup("Midimapper"); + cfg->writePathEntry("LoadFile", + (MidiConfigDialog::selectedmap==NULL)? TQString():MidiConfigDialog::selectedmap); + tdemidclient->setMidiMapFilename(MidiConfigDialog::selectedmap); + } + delete dlg; +} + +void tdemidFrame::collect_organize() +{ + CollectionDialog *dlg; + SLManager *slman=new SLManager(*tdemidclient->getSLManager()); + int idx=tdemidclient->getActiveCollection(); + + dlg=new CollectionDialog(slman,idx,NULL,"MidiDialog"); + if (dlg->exec() == TQDialog::Accepted) + { + tdemidclient->setSLManager(slman); + tdemidclient->setActiveCollection(CollectionDialog::selectedC); + tdemidclient->slotSelectSong( + (slman->getCollection(CollectionDialog::selectedC))->getActiveSongID()-1); + } + else + { + delete slman; + } +delete dlg; +} + +void tdemidFrame::rechooseTextEvent() +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + if ((cfg->readNumEntry("AutomaticTextEventChooser",1))==1) + { + int t=tdemidclient->ChooseTypeOfTextEvents(); + tdemidclient->repaintText(t); + if (t==1) + ((KSelectAction*)actionCollection()->action("display_events"))->setCurrentItem(0); + else + ((KSelectAction*)actionCollection()->action("display_events"))->setCurrentItem(1); + } +} + +void tdemidFrame::song_Loop() +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + int i=1-cfg->readNumEntry("Loop",0); + cfg->writeEntry("Loop",i); + cfg->sync(); + tdemidclient->setSongLoop(i); +} + +void tdemidFrame::collect_PlayOrder(int i) +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + cfg->writeEntry("CollectionPlayMode", i); + cfg->sync(); + tdemidclient->setCollectionPlayMode(i); +} + +void tdemidFrame::collect_AutoAdd() +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + cfg->writeEntry("AutoAddToCollection",1-cfg->readNumEntry("AutoAddToCollection",0)); + cfg->sync(); +} + +void tdemidFrame::file_SaveLyrics() +{ + KURL url = KFileDialog::getSaveURL(TQString(),"*",this); + + if( url.isEmpty() ) + return; + + if( !url.isLocalFile() ) + { + KMessageBox::sorry( 0L, i18n( "Only local files are currently supported." ) ); + return; + } + + TQString filename = url.path(); + struct stat statbuf; + + if (stat(TQFile::encodeName(filename), &statbuf)!=-1) + { + TQString s = i18n("File %1 already exists\nDo you want to overwrite it?").arg(filename); + if (KMessageBox::warningYesNo(this,s,TQString(),i18n("Overwrite"),KStdGuiItem::cancel())==1) + return; + } + + FILE *fh=fopen(TQFile::encodeName(filename),"wt"); + tdemidclient->saveLyrics(fh); + fclose(fh); +} + +void tdemidFrame::spacePressed() +{ + if (!tdemidclient->isPlaying()) tdemidclient->play(); + else pause(); +} +void tdemidFrame::options_ShowVolumeBar() +{ + TDEConfig *cfg=kapp->config(); + cfg->setGroup("KMid"); + int i=1-cfg->readNumEntry("ShowVolumeBar",0); + cfg->writeEntry("ShowVolumeBar",i); + tdemidclient->visibleVolumeBar(i); +} + +void tdemidFrame::options_ShowChannelView() +{ + if (!((KToggleAction*)actionCollection()->action("toggle_channelview"))->isChecked()) + { + tdemidclient->visibleChannelView(0); + } else + { + tdemidclient->visibleChannelView(1); + connect (tdemidclient->getChannelView(),TQT_SIGNAL(destroyMe()),this,TQT_SLOT(channelViewDestroyed())); + } + +} + +void tdemidFrame::channelViewDestroyed() +{ + tdemidclient->channelViewDestroyed(); + ((KToggleAction*)actionCollection()->action("toggle_channelview"))->setChecked(false); +} + +void tdemidFrame::options_ChannelViewOptions() +{ + ChannelViewConfigDialog *dlg; + + dlg=new ChannelViewConfigDialog(NULL,"ChannelViewConfigDialog"); + if (dlg->exec() == TQDialog::Accepted) + { + if (tdemidclient->getChannelView()) + tdemidclient->getChannelView()->lookMode( + ChannelViewConfigDialog::selectedmode ); + } + delete dlg; +} + +void tdemidFrame::openURL( const TQString url ) +{ + int c=autoAddSongToCollection(url,1); + tdemidclient->setActiveCollection(c); +} + +/*void tdemidFrame::play() +{ + tdemidclient->play(); +} + +void tdemidFrame::pause() +{ +// tdemidclient->pause(); + ((KAction*)actionCollection()->action("pause"))->activate(); +} + +void tdemidFrame::stop() +{ + tdemidclient->stop(); +} + +void tdemidFrame::rewind() +{ + tdemidclient->rewind(); +} + +void tdemidFrame::forward() +{ + tdemidclient->forward(); +} + +void tdemidFrame::seek(int ms) +{ + tdemidclient->timebarChange(ms); +} + +void tdemidFrame::prevSong() +{ + tdemidclient->prevSong(); +} + +void tdemidFrame::nextSong() +{ + tdemidclient->nextSong(); +} + +void tdemidFrame::setSongLoop(int i) +{ + ((KToggleAction*)actionCollection()->action("song_loop"))->setChecked(i!=0); +} + +void tdemidFrame::setVolume(int i) +{ + tdemidclient->volumebarChange(200-i); +} + +void tdemidFrame::setTempo(int i) +{ + tdemidclient->changeTempo(i); +} + +void tdemidFrame::setSongType( int i ) +{ + KSelectAction *tmplistaction= + ((KSelectAction*)actionCollection()->action("file_type")); + + tmplistaction->setCurrentItem(i); +} + +void tdemidFrame::setLyricEvents( int i ) +{ + KSelectAction *tmplistaction= + ((KSelectAction*)actionCollection()->action("display_events")); + tmplistaction->setCurrentItem(i); +} + +void tdemidFrame::selectSong(int i) +{ + tdemidclient->getComboSongs()->setCurrentItem(i-1); + tdemidclient->selectSong(i-1); +} + +void tdemidFrame::setActiveCollection( int i ) +{ + tdemidclient->setActiveCollection(i); +} + +void tdemidFrame::setCollectionPlayMode(int i) +{ + ((KSelectAction*)actionCollection()->action("play_order"))->setCurrentItem(i); +} + +void tdemidFrame::setMidiDevice(int i) +{ + + +} +*/ + + +#include "tdemidframe.moc" diff --git a/tdemid/tdemidframe.h b/tdemid/tdemidframe.h new file mode 100644 index 00000000..e146762e --- /dev/null +++ b/tdemid/tdemidframe.h @@ -0,0 +1,134 @@ +/************************************************************************** + + tdemidframe.h - The main widget of KMid + Copyright (C) 1997,98 Antonio Larrosa Jimenez + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Send comments and bug fixes to larrosa@kde.org + or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain + +***************************************************************************/ +#ifndef _KMIDFRAME_H +#define _KMIDFRAME_H + +#include +#include +#include +#include +#include +#include +#include + +class TDEApplication; +class TDEConfig; +class tdemidClient; +class KToolBar; +class TQDragEvent; +class KAccel; + +class KDE_EXPORT tdemidFrame : public KMainWindow +{ + Q_OBJECT + +private: +#ifdef KMidDEBUG + long passcount; +#endif + + MidiOut *Midi; + MidiPlayer *Player; +/* + int playerProcessID; + PlayerController *pctl; + + int donttoggle; + + TQPopupMenu *m_file; + TQPopupMenu *m_song; + TQPopupMenu *m_collections; + TQPopupMenu *m_options; + TQPopupMenu *m_help; +*/ + KAccel *kKeysAccel; +protected: + int autoAddSongToCollection(const TQString& filename=TQString(),int setactive=1); + + + virtual void saveProperties(TDEConfig *kcfg); + virtual void readProperties(TDEConfig *kcfg); + +// virtual void closeEvent(TQCloseEvent *e); + + void dragEnterEvent(TQDragEnterEvent* e); + void dropEvent ( TQDropEvent * event ); + + +public: + tdemidFrame(const char *name=0); + virtual ~tdemidFrame(); + +public slots: + + void file_Open(); + void file_SaveLyrics(); + void song_stopPause(); // release the pause button and quit the pause mode + void song_Loop(); + void collect_organize(); + void collect_PlayOrder(int i); + void collect_AutoAdd(); + void options_FileType(int i); + void options_DisplayEvents(int i); + void options_AutomaticText(); + void options_ShowVolumeBar(); + void options_ShowChannelView(); + void options_ChannelViewOptions(); + void options_FontChange(); + + void options_MidiSetup(); + void spacePressed(); + + + virtual void openURL( const TQString s ); +/* virtual void play(); + virtual void pause(); + virtual void stop(); + virtual void rewind(); + virtual void forward(); + virtual void seek(int ms); + virtual void prevSong(); + virtual void nextSong(); + virtual void setSongLoop(int i); + virtual void setVolume(int i); + virtual void setTempo(int i); + virtual void setSongType( int i ); + virtual void setLyricEvents( int i ); + virtual void selectSong(int i); + virtual void setActiveCollection( int i ); + virtual void setCollectionPlayMode(int i); + virtual void setMidiDevice(int i); +*/ + void urlDrop_slot(class TQDropEvent *); + + void rechooseTextEvent(); + + void channelViewDestroyed(); + void shuttingDown(); + +private: + tdemidClient *tdemidclient; +}; + +#endif diff --git a/tdemid/tdemidui.rc b/tdemid/tdemidui.rc new file mode 100644 index 00000000..28d60897 --- /dev/null +++ b/tdemid/tdemidui.rc @@ -0,0 +1,44 @@ + + + + &File + + + &Song + + + + + + + + &Collections + + + + + + + + + + + + + + + + +Main Toolbar + + + + + + + + + + + + diff --git a/tdemid/version.h b/tdemid/version.h new file mode 100644 index 00000000..b2416c18 --- /dev/null +++ b/tdemid/version.h @@ -0,0 +1,48 @@ +#ifndef _VERSION_H + + +#define VERSION_NUM 2.0 +#define VERSION_SHORTTXT "2.0" +#define VERSION_TXT "KMid 2.0" + +// Undefine WORKING for release versions +//#define WORKING + +// I want to keep some special variables defined at home for personal +// adjustments +//#define AT_HOME + + +// The next definition makes tdemid display some general debug messages +// that may be helpful to locate any bug, but without making lots of +// messages. Please when reporting a bug, be sure that this is set and +// send me the output. +//#define GENERAL_DEBUG_MESSAGES + +// Define MODE_DEMO_ONLYVISUAL for tdemid to work on systems with no soundcard, +// or when it is not well configured. You will only get visual feedback, that +// is, you will see the letter changing of colors, but no music. Really, you +// would get music if it is possible, but by defining this, many synchronization +// routines will be turned off. +//#define MODE_DEMO_ONLYVISUAL + + +// And now, DEBUG messages : +#ifdef WORKING +#define KMidDEBUG +//#define KDISPTEXTDEBUG +//#define COLLECTDLGDEBUG +//#define DEVICEMANDEBUG +//#define FMOUTDEBUG +//#define GUSOUTDEBUG +//#define MIDFILEDEBUG +//#define MIDIOUTDEBUG +//#define MIDISTATDEBUG +//#define MIDIMAPPERDEBUG +//#define SYNTHOUTDEBUG +//#define VOICEMANDEBUG +//#define PLAYERDEBUG +//#define TRACKDEBUG +#endif + +#endif diff --git a/tdemid/x-karaoke.desktop b/tdemid/x-karaoke.desktop new file mode 100644 index 00000000..2784f27a --- /dev/null +++ b/tdemid/x-karaoke.desktop @@ -0,0 +1,61 @@ +[Desktop Entry] +Type=MimeType +MimeType=audio/x-karaoke +Icon=sound +Patterns=*.kar;*.KAR; +Comment=Karaoke File +Comment[ar]=ملف Karaoke +Comment[bg]=Файл на Karaoke +Comment[bn]=কারাওকে ফাইল +Comment[br]=Restr Karaoke +Comment[bs]=Karaoke datoteka +Comment[ca]=Fitxer karaoke +Comment[cs]=Karaoke soubor +Comment[cy]=Ffeil Karaoke +Comment[da]=Karaoke-fil +Comment[de]=Karaoke-Datei +Comment[el]=Αρχείο Karaoke +Comment[eo]=Karaoko-dosiero +Comment[es]=Archivo Karaoke +Comment[et]=Karaoke fail +Comment[eu]=Karaoke fitxategia +Comment[fa]=پروندۀ Karaoke +Comment[fi]=Karaoketiedosto +Comment[fr]=Fichier de karaoké +Comment[ga]=Comhad Karaoke +Comment[gl]=Ficheiro Karaoke +Comment[he]=קובץ קריוקי +Comment[hi]=कराओके फ़ाइल +Comment[hu]=Karaoke-fájl +Comment[is]=Karaoke skrá +Comment[ja]=カラオケファイル +Comment[kk]=Караоке файлы +Comment[km]=ឯកសារ​ខារ៉ាអូខេ +Comment[ko]=노래방 파일 +Comment[lt]=Karaoke byla +Comment[mk]=Karaoke датотека +Comment[nb]=Karaokefil +Comment[nds]=Karaoke-Datei +Comment[ne]=कारावके फाइल +Comment[nl]=Karaoke-bestand +Comment[nn]=Karaokefil +Comment[pl]=Plik Karaoke +Comment[pt]=Ficheiro de Karaoke +Comment[pt_BR]=Arquivo Karaokê +Comment[ro]=Fişier karaoke +Comment[ru]=Файл караоке +Comment[sk]=Karaoke súbor +Comment[sl]=Datoteka Karaoke +Comment[sr]=Караоке фајл +Comment[sr@Latn]=Karaoke fajl +Comment[sv]=Karaoke-fil +Comment[ta]=கரோக்கி கோப்பு +Comment[tg]=Файли Karaoke +Comment[th]=แฟ้มคาราโอเกะ +Comment[tr]=Karaoke Dosyası +Comment[uk]=Файл Karaoke +Comment[uz]=Karaoki fayli +Comment[uz@cyrillic]=Караоки файли +Comment[zh_CN]=卡拉 OK 文件 +Comment[zh_HK]=卡拉OK 檔案 +Comment[zh_TW]=卡拉OK檔案 -- cgit v1.2.1