pax_global_header00006660000000000000000000000064114205032440014505gustar00rootroot0000000000000052 comment=e314c538db5e536255d00b303485e0c75bb45f75 stretchplayer-0.503/000077500000000000000000000000001142050324400144055ustar00rootroot00000000000000stretchplayer-0.503/.gitattributes000066400000000000000000000000561142050324400173010ustar00rootroot00000000000000debian/* export-ignore debian export-ignore stretchplayer-0.503/.gitignore000066400000000000000000000002011142050324400163660ustar00rootroot00000000000000## General ignores ## --------------- *.[oa] *~ ## For debian package building ## --------------------------- obj-*-linux-gnu/ stretchplayer-0.503/AUTHORS000066400000000000000000000000551142050324400154550ustar00rootroot00000000000000Gabriel M. Beddingfield stretchplayer-0.503/BUGS.txt000066400000000000000000000020661142050324400157120ustar00rootroot00000000000000BUGS FOR STRETCHPLAYER ---------------------- Here is an unordered list of complaints, shorcomings, wishes, and bugs. * Possible clicks on A/B Repeat (no crossfading). * QFont::setStretch() doesn't work on all fonts. Where it doesn't work, they get massively kerned. Would be better to just make the font smaller. This is especially bad on Windows. * The font layout is .... ok.... but still looks a little amateurish. * Doesn't work with buffer size < 256 * Doesn't work on older computers (<= 800 MHz) * Memory hog. Needs to stream. * Add MP3 support. * Create CLI version. * Create Windows version with MSI package. * Add PortAudio support * Sliders don't match the UI. * Get the Git version into the CMake stuff. * needs a help/version button. * Faders need a detented spot (stretch fader near 100%, volume fader near unity gain). Dragan Noveski also suggested that a right-click moves the fader to the default spot. * Using arrow keys will not get the stretch fader to go to the extreme position. stretchplayer-0.503/CMakeLists.txt000066400000000000000000000021661142050324400171520ustar00rootroot00000000000000### ### Top directory for StretchPlayer ### CMAKE_MINIMUM_REQUIRED(VERSION 2.4) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") SET(VERSION_MAJOR "0") SET(VERSION_MINOR "503") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}") OPTION(ENABLE_COMPOSITING "Enable X11 window compositing, if system supports it." ON ) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(art) IF(ENABLE_COMPOSITING) SET(USE_COMPOSITING true) ELSE(ENABLE_COMPOSITING) SET(USE_COMPOSITING false) ENDIF(ENABLE_COMPOSITING) CONFIGURE_FILE(config.h.in config.h) CONFIGURE_FILE(stretchplayer.desktop.in stretchplayer.desktop) ADD_CUSTOM_TARGET(dist git archive --format=tar --prefix=stretchplayer-${VERSION}/ HEAD | gzip -9 > ${CMAKE_BINARY_DIR}/stretchplayer_${VERSION}.orig.tar.gz WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Making stretchplayer_${VERSION}.orig.tar.gz" ) INSTALL( FILES ${CMAKE_BINARY_DIR}/stretchplayer.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications" ) INSTALL( FILES ${CMAKE_BINARY_DIR}/stretchplayer.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/stretchplayer/" ) stretchplayer-0.503/COPYING000066400000000000000000000001711142050324400154370ustar00rootroot00000000000000StretchPlayer is distributed under the GPL version 2.0 or later. See the files gpl-2.0.txt and gpl-3.0.txt for details. stretchplayer-0.503/ChangeLog000066400000000000000000000651001142050324400161610ustar00rootroot00000000000000commit e5deafdb3d6e846270107d42704ccaa00a448b38 Author: Gabriel M. Beddingfield Date: Sat Jul 17 23:05:41 2010 -0500 Bump version to 0.503. M CMakeLists.txt M debian/changelog commit 2ea0c23fe9cffeb16bde844e93cfbdf22ee99ad6 Author: Gabriel M. Beddingfield Date: Wed Jul 14 01:00:12 2010 -0500 Add a 'make dist' target. Note that it packages Git HEAD rather than the files in the current working copy. M CMakeLists.txt commit e09f375d119991e826217959fe4b03ee3e73c548 Author: Gabriel M. Beddingfield Date: Wed Jul 14 01:04:22 2010 -0500 Exclude debian/ folder from tarball export. Removed based on advice from Erik de Castro Lopo, that shipping the debian/ folder in the tarball makes things more difficult for downstream packagers. He recommended that it stay in the SCM, but not the source distribution. His discussion was on LAU on 2010-07-14. A .gitattributes commit d5d0ec035235cd5ca188eb27f2a9102686c46d46 Author: Gabriel M. Beddingfield Date: Wed Jul 14 00:38:47 2010 -0500 Add idea to move faders to default spot with right-click. Thanks to Dragan Noveski for the idea. M BUGS.txt commit 88b3eae99e8c5591eff0747c0b7ea11e78005da7 Author: Gabriel M. Beddingfield Date: Sun Jul 11 22:01:31 2010 -0500 Fix minor errors in debian/control file. M debian/control commit aaa965ed1e22792ec2ed02d47d743d601cda2308 Author: Gabriel M. Beddingfield Date: Sun Jul 11 21:46:12 2010 -0500 Update debian changelog. M debian/changelog commit 0d09cb29f15faba209462fd041e0f38b0278b966 Author: Gabriel M. Beddingfield Date: Sun Jul 11 21:38:34 2010 -0500 Add a docs file. A debian/docs commit b29f23033623766a855150c3c75778ba7174056f Author: Gabriel M. Beddingfield Date: Sun Jul 11 21:32:08 2010 -0500 Add ChangeLog from Git log. A ChangeLog commit 3cdbbe11c60172d2ee8bf3de8d797d0f4d836b02 Author: Gabriel M. Beddingfield Date: Sun Jul 11 21:08:56 2010 -0500 PlayerWidget::update_time(): Update _status instead of everything. This reduces Xorg's workload considerably, even when compositing is enabled. We're only updating internal widgets instead of the entire window. M src/PlayerWidget.cpp commit 449214cbe1720d33923112983c63863d3157cd52 Author: Gabriel M. Beddingfield Date: Tue Jul 6 21:50:22 2010 -0500 Remove several resolved and "won't fix" items from BUGS.txt M BUGS.txt commit 9d8ff14899fd1860c38a9f462baed352ba864504 Author: Gabriel M. Beddingfield Date: Tue Jul 6 21:46:48 2010 -0500 Add some resolutions to the BUGS.txt file: * Immediate jack disconnects: bug in jack 2, solved in SVN. * Over-active GUI fixed in ff4d4ebf4 2010-07-06. M BUGS.txt commit b996adcc85c6e16ffb1149162df7451ddda70bfc Author: Gabriel M. Beddingfield Date: Tue Jul 6 21:33:08 2010 -0500 Add CMake flag USE_COMPOSITING to en/dis-able compositing. Use of compositing require some overhead with the X-server. Some users may have systems that enable compositing, but don't want the overhead. In the future, this should be a run-time configuration setting, but for now it's compile time since there's no run-time configuration infrastructure. M CMakeLists.txt M config.h.in M src/PlayerWidget.cpp commit de798587ccc969a066220a0f168e866902324a54 Author: Gabriel M. Beddingfield Date: Tue Jul 6 16:17:37 2010 -0500 Bump version to 0.502. M CMakeLists.txt commit ff4d4ebf4a4f89fd437cae72a44158defadb1b89 Author: Gabriel M. Beddingfield Date: Tue Jul 6 16:09:54 2010 -0500 Remove several redundant update() calls in GUI. When idle, the GUI is using up to 30% CPU to update its status very often. It turns out that several of the widgets were getting the update() call when their values changed. This was thought to be safe, but turns out to be too manu GUI updates. Now, the GUI is totally disconnected from RT events in the audio thread. The only way the GUI is getting updated is by the timer that is set up in PlayerWidget::_setup_signals_and_slots()... which is currently set to update every 200 ms (5 times/sec). This results in about 3-5% CPU. However, if compositing is enabled, the X server may still be using 20-30% CPU to calculate the compositing features. M src/Marquee.cpp M src/StatusWidget.cpp commit 7487277cf722f89a0b57f13bebdc974d40574bde Author: Gabriel M. Beddingfield Date: Sun Jun 13 07:36:19 2010 -0500 Fix typo in share folder install directory. M CMakeLists.txt commit 7424096649fe22fd488ed3132edaccb2c78af94f Author: Gabriel M. Beddingfield Date: Sun Jun 13 07:06:17 2010 -0500 Update the BUGS.txt file with two new bugs. * Stretchplayer gets immediately disconnected when you hit the file open button. * The GUI uses up a lot of CPU when idle. Removed a bug: * Clicks whenever a change is made. (This was fixed in 0.501.) M BUGS.txt commit 20ce4f4a29b9fce454ca09469681e2e4b6fd2ad8 Author: Gabriel M. Beddingfield Date: Sat Jun 12 10:30:48 2010 -0500 Suppress build errors. * JackAudioSystem::activate() Possible (but unlikely) use of uninitialized 'rv' value. * JackAudioSystem::deactivate() should return int, but does not return anything. M src/JackAudioSystem.cpp commit a47f858223d237b97d92b3e7cec2403f2ca07aa9 Author: Gabriel M. Beddingfield Date: Sat Jun 12 10:25:28 2010 -0500 Fix 64-bit compile issue: s/size_t/uint32_t/g M src/Engine.cpp M src/JackAudioSystem.cpp M src/JackAudioSystem.hpp commit 56dd9c9e004157658446657f1efc695d618b95ad Author: Gabriel M. Beddingfield Date: Thu May 20 22:56:25 2010 -0500 Fix installation issues with icon and .desktop files. For some reason, it wasn't finding my icons. So, i chose to do a hard path. M art/CMakeLists.txt M stretchplayer.desktop.in commit dec4bd0ee7d4ebef998a27bc1b8c813bdb9cecc5 Author: Gabriel M. Beddingfield Date: Thu May 20 22:34:29 2010 -0500 Correct icon installation directories. E.g. /usr/share/icons instead of /usr/icons. M art/CMakeLists.txt commit 299d48d3cd31f1ba6d380c5ad5880bab22be217c Author: Gabriel M. Beddingfield Date: Thu May 20 22:26:45 2010 -0500 Add desktop file and icons, and install them. M CMakeLists.txt A art/CMakeLists.txt A art/stretchplayer-icon-16x16.png A art/stretchplayer-icon-22x22.png A art/stretchplayer-icon-24x24.png A art/stretchplayer-icon-32x32.png A art/stretchplayer-icon-48x48.png A art/stretchplayer-icon.svg A config.h.in M src/CMakeLists.txt M src/main.cpp A stretchplayer.desktop.in commit df0bc7e4ebe1928d6286c3003bde5d685a1fed54 Author: Gabriel M. Beddingfield Date: Thu May 6 23:09:38 2010 -0500 Add build dependency on CMake and CDBS for Debian. M debian/control commit 4d6c952d3cd91643b03d8e006beb7e2f78ab64f0 Author: Gabriel M. Beddingfield Date: Sat Apr 24 14:59:51 2010 -0500 Get the -dbg package working. Had to up debhelper (and possibly 'compat') to 5. M .gitignore A debian/.gitignore M debian/compat M debian/control M debian/rules commit b4f18e29907e1d94c82f3d5664822d70de7b3c1a Author: Gabriel M. Beddingfield Date: Tue Apr 20 17:51:06 2010 -0500 Add debian packaging. A debian/changelog A debian/compat A debian/control A debian/rules commit dc48bab6ca4476b59960ad8b93e1326f25eeebed Author: Gabriel M. Beddingfield Date: Sun Apr 11 17:30:29 2010 -0500 Reduce/remove click when changing speeds/pitch. The parameter change was causing a RubberBandStretcher::reset() to be called, which not only causes a reboot of the audio calculated (time delay) but also deleted whatever audio has already been fed. M src/Engine.hpp commit e5e44be863be1fc8b4b885ea6e51920658beebb9 Author: Gabriel M. Beddingfield Date: Thu Apr 8 12:01:08 2010 -0500 Add Tritium::RingBuffer<> from Composite... which came from Ardour. File copied from Ardour to Composite to Here. A src/RingBuffer.hpp commit 793b30e69b77e3fb1673409e74db61ad3f62bed7 Author: Gabriel M. Beddingfield Date: Thu Apr 8 11:56:59 2010 -0500 Abstract audio system to make room for other audio API's. A src/AudioSystem.hpp M src/CMakeLists.txt M src/Engine.cpp M src/Engine.hpp A src/JackAudioSystem.cpp A src/JackAudioSystem.hpp commit a549e1e3363de5d0e2fad3890a21d154cf31d225 Author: Gabriel M. Beddingfield Date: Tue Apr 6 20:49:28 2010 -0500 Add a BUGS.txt file. A BUGS.txt commit 28a3dc4989ab2cc03aa2b468badfbd73b43480d4 Author: Gabriel M. Beddingfield Date: Tue Apr 6 02:06:40 2010 -0500 Remove a test string. I had a really long string for testing the scroll. As it happened, when you started up StretchPlayer... that's the first thing you see. :-) M src/StatusWidget.cpp commit dc103d18b0232884e13bc93a8b29f133c8f30b13 Author: Gabriel M. Beddingfield Date: Tue Apr 6 01:48:55 2010 -0500 Reverse order of incr/decr pitch buttons. M src/PlayerWidget.cpp commit 0cc8526d08cedf080a739d520936a0e02ee3e7de Author: Gabriel M. Beddingfield Date: Tue Apr 6 01:05:32 2010 -0500 Update documentation for [HOME] key and performance issues. M INSTALL.txt M README.txt commit 1a192b70bfac55b58481257a006f485852f1fc35 Author: Gabriel M. Beddingfield Date: Tue Apr 6 00:55:49 2010 -0500 Add a Marquee widget with scrolling text. M src/CMakeLists.txt M src/Engine.cpp M src/Engine.hpp A src/Marquee.cpp A src/Marquee.hpp M src/PlayerWidget.cpp M src/StatusWidget.cpp M src/StatusWidget.hpp commit f408d7e87e13cb1caafef1c0d2f9cbce6bd468c3 Author: Gabriel M. Beddingfield Date: Mon Apr 5 22:09:23 2010 -0500 Add version info and make responsive while song loading. M src/Engine.cpp M src/PlayerWidget.cpp M src/main.cpp commit d1da5cd67d12d0684bf59c268f7d4c30c611a2e8 Author: Gabriel M. Beddingfield Date: Mon Apr 5 21:53:47 2010 -0500 Allow for sane rendering when compositing not avail. I.e. Qt 4.4. M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 1dda50c1b2f40666046685b4ca33c8b05922aa09 Author: Gabriel M. Beddingfield Date: Mon Apr 5 21:30:45 2010 -0500 Increase the max buffer size for RubberBand. M src/Engine.cpp commit 45134dcdeac0d8ad173873e0e550e8113c014306 Author: Gabriel M. Beddingfield Date: Mon Apr 5 21:17:50 2010 -0500 Adjust for memory issues. On some systems, I was getting OOM problems because of the way that the audio file buffer and the PlayerWidget were being allocated. M src/Engine.cpp M src/main.cpp commit 3f0bc984826c83972fe989d8287c1b40d90dab84 Author: Gabriel M. Beddingfield Date: Mon Apr 5 18:50:18 2010 -0500 Make the stats text come out bolder. M src/StatusWidget.cpp commit 04152092175b30bb19da670abbb141da8d5dde9d Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:50:27 2010 -0500 Add a README file. A README.txt commit 59edf8ba08436c93b1da417f17e38deb07fc79f1 Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:37:26 2010 -0500 Update Qt version requirement. M src/CMakeLists.txt commit 407519cb9ce00923f8fe13aad889a2a1eb20d2b0 Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:37:10 2010 -0500 Add installation instructions. A INSTALL.txt commit bf81a0b37ddc7e05b8c96b7a4279f5431cb40c1f Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:24:37 2010 -0500 Add an AUTHORS file. A AUTHORS commit 36fbd236fbd66ecd6b6c306c59c77708c5327355 Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:24:15 2010 -0500 Add license files. A COPYING A gpl-2.0.txt A gpl-3.0.txt commit e4c65199a7ed350ac2ce411804c745e85db69b7c Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:17:30 2010 -0500 Add CMake module for finding librubberband. A cmake/FindRubberBand.cmake M src/CMakeLists.txt commit 1f0bb550cf005a25ad1eb8dfa897f142e9e874ba Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:08:05 2010 -0500 Add library status for JACK and LibSndfile. M src/CMakeLists.txt commit 0c780e49d48a7af3d9b253cda222218a9774412a Author: Gabriel M. Beddingfield Date: Mon Apr 5 12:04:07 2010 -0500 Convert to CMake build system (was qmake). A CMakeLists.txt A src/CMakeLists.txt D src/stretchplayer.pro D stretchplayer.pro commit 52d47ecc79eb689fe9b205ab7db3a821453991dc Author: Gabriel M. Beddingfield Date: Mon Apr 5 07:53:21 2010 -0500 Add some CMake modules from Composite. A cmake/FindJACK.cmake A cmake/FindLibSndfile.cmake A cmake/TritiumFindPackageHandleStandardArgs.cmake A cmake/TritiumPackageHelper.cmake commit fd209f932d5e4df1e1c55eb08d9b0d2f59099985 Author: Gabriel M. Beddingfield Date: Mon Apr 5 07:36:41 2010 -0500 Watch out for a corner case when looping. Prevent _loop_a == _loop_b. M src/Engine.cpp commit 11d4236132e4d1cdf6a74dd0f6efa9ebd3932716 Author: Gabriel M. Beddingfield Date: Mon Apr 5 07:34:18 2010 -0500 Tweak how samples are fed/read from rubberband when looping. M src/Engine.cpp commit a26afcf5335645a874f93398aa8f3897173e2f8c Author: Gabriel M. Beddingfield Date: Mon Apr 5 01:43:46 2010 -0500 Enable threading for RubberBand. I didn't notice much of a performance difference. M src/Engine.cpp commit a375a2f44feb0855f0fef82ece62cdaa2c56dd25 Author: Gabriel M. Beddingfield Date: Mon Apr 5 01:32:20 2010 -0500 Avoid buffer overflows with RubberBand engine. M src/Engine.cpp M src/Engine.hpp commit f0cc39d947ba8e6fb4abed4e9b1ce564caec15ea Author: Gabriel M. Beddingfield Date: Mon Apr 5 00:44:21 2010 -0500 Reset the rubber band stretcher after a state change. M src/Engine.cpp M src/Engine.hpp commit f3cac458f9ac4b142e2a7c603a9c41bb9e08e721 Author: Gabriel M. Beddingfield Date: Mon Apr 5 00:31:19 2010 -0500 Add Actions for volume control. M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 4b230092db4d5863a20a317746b6f498e22e1366 Author: Gabriel M. Beddingfield Date: Mon Apr 5 00:13:36 2010 -0500 Fix small possible error when setting stretch factors. M src/StatusWidget.cpp commit 23608999663c25ae28ccbf99bbdbd78e80db6f40 Author: Gabriel M. Beddingfield Date: Mon Apr 5 00:09:50 2010 -0500 Rename StatusWidget::_status to _message. M src/StatusWidget.cpp M src/StatusWidget.hpp commit 96de48677cf308416c6e5b51bf39c5aa82116377 Author: Gabriel M. Beddingfield Date: Mon Apr 5 00:01:07 2010 -0500 Tweak fonts on the layout. M src/StatusWidget.cpp commit ddc43384ab49ea5df119affe909a432af5d307a7 Author: Gabriel M. Beddingfield Date: Sun Apr 4 23:51:02 2010 -0500 Fix a resizing thinko. Was accidentally doing drag resizes on the _which_cursor() results... rather than the actual current cursor. M src/PlayerWidget.cpp commit d791adff59c3659ec9f08a022bec339208dea0af Author: Gabriel M. Beddingfield Date: Sun Apr 4 23:47:49 2010 -0500 Add rudimentary window resizing. M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 79647b69bdc727676c8bee7723dcd9c6b40f0c73 Author: Gabriel M. Beddingfield Date: Sun Apr 4 22:01:02 2010 -0500 Add a little more margin around the status widget. M src/PlayerWidget.cpp commit e87260bd9c27b626b60047bd9fd7259c38195e03 Author: Gabriel M. Beddingfield Date: Sun Apr 4 21:55:49 2010 -0500 Remove a little extra space from the stats. M src/StatusWidget.cpp commit 8bd9a93794f05e8704e15ac9b1840f65103f8917 Author: Gabriel M. Beddingfield Date: Sun Apr 4 21:49:13 2010 -0500 Lay out all the status text by hand. M src/StatusWidget.cpp M src/StatusWidget.hpp M src/ThinSlider.hpp commit b6eca4eacf41244f210dfc0b50a6ce778072918e Author: Gabriel M. Beddingfield Date: Sun Apr 4 13:03:34 2010 -0500 Update status position line size. M src/StatusWidget.cpp commit ffae6b39eb5093259f92e3ea273ffdb52323935a Author: Gabriel M. Beddingfield Date: Sun Apr 4 12:52:03 2010 -0500 Lay out widgets manually. The Layouts were great... but I couldn't get the control that I wanted from them. M src/PlayerSizes.cpp M src/PlayerSizes.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp M src/StatusWidget.cpp commit 098b90488095b0b8d1605becd20192b3db3fd8d2 Author: Gabriel M. Beddingfield Date: Sun Apr 4 07:37:23 2010 -0500 Get the widgets to resize when the window resizes. M src/PlayerSizes.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp M src/main.cpp commit 5105b16961e883775d3e8d46b369b903c8e7868d Author: Gabriel M. Beddingfield Date: Sun Apr 4 06:47:46 2010 -0500 Add a text height field for PlayerSizes. M src/PlayerSizes.cpp M src/PlayerSizes.hpp commit 0e38578d52ace22b4a5a53d408b7ac77f23f73fa Author: Gabriel M. Beddingfield Date: Sat Apr 3 18:55:06 2010 -0500 Increase size of icons on widgets. M src/PlayerWidget.cpp M src/icons.svg M src/img/ab.png M src/img/help.png M src/img/play.png M src/img/quit.png M src/img/stop.png commit aa9a8e01bf7bad8d41f3a77a5d347db516252369 Author: Gabriel M. Beddingfield Date: Sat Apr 3 18:41:43 2010 -0500 Fix a couple widget layout thinkos. M src/PlayerWidget.cpp commit ea07b81f27061af4f047abdd5b50d921538361c1 Author: Gabriel M. Beddingfield Date: Sat Apr 3 18:36:36 2010 -0500 Export icons and use them in the player. M src/PlayerWidget.cpp M src/PlayerWidget.hpp A src/img/ab.png A src/img/file.png A src/img/help.png A src/img/minus.png A src/img/play.png A src/img/plus.png A src/img/quit.png A src/img/stop.png M src/stretchplayer.pro A src/stretchplayer.qrc commit 576a94b6cd00de632c22fa2714f09886acdeeb03 Author: Gabriel M. Beddingfield Date: Sat Apr 3 17:50:46 2010 -0500 Add all icons as SVG file. A src/icons.svg commit 484275bd451dcfcf6449d1ce7961c470dbe634e1 Author: Gabriel M. Beddingfield Date: Sat Apr 3 16:28:38 2010 -0500 Tweak the fader so that we don't get 10x vol. Also, the volume indicator now scales 0-100%... which will make a lot of people very happy (was 0-200%). M src/PlayerWidget.cpp M src/StatusWidget.cpp commit cbdaf93e918732a76ed4f4ec272c3ba283a9fe09 Author: Gabriel M. Beddingfield Date: Sat Apr 3 16:18:15 2010 -0500 Implement volume control. I put in a typical mixer fader... not happy with it. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 619b39d4ab37e5548a345cc437ee94d63e30b90a Author: Gabriel M. Beddingfield Date: Sat Apr 3 14:59:44 2010 -0500 Implement QActions for major control functions. This implements keyboard shorcuts like P (play/stop), Escape (quit), etc. It also ties them to buttons visible on the GUI. The setup of all the widgets has been refactored a bit. M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 2d496f1ad413ab8c15be8dd4877209857a29fee2 Author: Gabriel M. Beddingfield Date: Sat Apr 3 12:30:26 2010 -0500 Make the ThinSlider work with mouse events. M src/Engine.cpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp M src/StatusWidget.cpp M src/StatusWidget.hpp M src/ThinSlider.cpp M src/ThinSlider.hpp commit 23614b9d7a81412818eb481673df5e6008659d7d Author: Gabriel M. Beddingfield Date: Sat Apr 3 10:50:31 2010 -0500 Convert color scheme to use QPalette. D src/PlayerColors.cpp D src/PlayerColors.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp M src/StatusWidget.cpp M src/StatusWidget.hpp M src/ThinSlider.cpp M src/ThinSlider.hpp M src/stretchplayer.pro commit 87d0c2769dfa3972dbd030cdb8ee37ab212a1048 Author: Gabriel M. Beddingfield Date: Sat Apr 3 09:47:09 2010 -0500 Add background for status widget. M src/StatusWidget.cpp M src/StatusWidget.hpp commit b7dab288b834e6cdfad75e63175a28414776b53c Author: Gabriel M. Beddingfield Date: Sat Apr 3 09:34:27 2010 -0500 Add a custom progress-bar-like slider, ThinSlider. M src/PlayerWidget.cpp M src/StatusWidget.cpp M src/StatusWidget.hpp A src/ThinSlider.cpp A src/ThinSlider.hpp M src/stretchplayer.pro commit 0ec518c31081f58462b12ff81b855af06576f69d Author: Gabriel M. Beddingfield Date: Sat Apr 3 07:42:04 2010 -0500 Add a color management class. A src/PlayerColors.cpp A src/PlayerColors.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp M src/stretchplayer.pro commit 8bb97a9913578bdf544a9611182d4026de41d2d9 Author: Gabriel M. Beddingfield Date: Sat Apr 3 07:12:51 2010 -0500 Autoconnect to output ports. M src/Engine.cpp commit 8b8e6d979bd454e6a4f78de85b19ad51ba49f7df Author: Gabriel M. Beddingfield Date: Fri Apr 2 19:23:12 2010 -0500 Divide up the widgets according to the intended design. M src/Engine.cpp M src/Engine.hpp A src/PlayerSizes.cpp A src/PlayerSizes.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp A src/StatusWidget.cpp A src/StatusWidget.hpp M src/stretchplayer.pro commit 8fba7b239db012b3a475d122ce4ff6e489a36d30 Author: Gabriel M. Beddingfield Date: Fri Apr 2 15:34:40 2010 -0500 Remove window frames etc. M src/PlayerWidget.cpp commit 24845aa38e49505036b4e34de373b7f0e43f0cf1 Author: Gabriel M. Beddingfield Date: Fri Apr 2 15:04:25 2010 -0500 Paint a yellow background with a black border. M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 81ac7bd316524cd46dd041684a051a282c39dc65 Author: Gabriel M. Beddingfield Date: Fri Apr 2 10:42:10 2010 -0500 Add a simple UI mock-up. A Documentation/ui-mockup.svg commit 4b639ded0e12ede6aea3b66a9a1ef27c34d3acf3 Author: Gabriel M. Beddingfield Date: Thu Apr 1 23:43:28 2010 -0500 Get A/B Looping working. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp commit 660523ef829dceedb8f354b16a6ec105ea7495e0 Author: Gabriel M. Beddingfield Date: Thu Apr 1 23:20:10 2010 -0500 Remove hour from readout. M src/PlayerWidget.cpp commit ff2729da5092aa3581734ad7425251a6d3d9b246 Author: Gabriel M. Beddingfield Date: Thu Apr 1 23:15:50 2010 -0500 Put error messages on the GUI. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 6cee0671c672944498ff7b34959431a9774adaa4 Author: Gabriel M. Beddingfield Date: Thu Apr 1 22:11:14 2010 -0500 Add error handling for file opening. M src/Engine.cpp commit f518661319bcea7eab407026aa17640534532b1b Author: Gabriel M. Beddingfield Date: Thu Apr 1 21:38:57 2010 -0500 Add buttons for remaining UI items. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 7e65fe7bb9f20bc799342b0a45f6500785b587f8 Author: Gabriel M. Beddingfield Date: Thu Apr 1 12:58:27 2010 -0500 Add top-level .gitignore. A .gitignore commit 555141336a732b2e1c684e2a31d205f64c4a4b71 Author: Gabriel M. Beddingfield Date: Thu Apr 1 12:57:49 2010 -0500 Add a top-level QMake project file. A stretchplayer.pro commit f381685a16ed280dc346ebd40339bc6cf52c0858 Author: Gabriel M. Beddingfield Date: Thu Apr 1 12:52:12 2010 -0500 Add a .gitignore for the source folder. A src/.gitignore commit 94b3f38ac2ee25d53997f9208c820f698b2f0685 Author: Gabriel M. Beddingfield Date: Wed Mar 31 22:50:21 2010 -0500 Update time readout for song. M src/PlayerWidget.cpp commit 6c3c5c25681fa31949eb79a870fc4f4986b53022 Author: Gabriel M. Beddingfield Date: Wed Mar 31 22:37:00 2010 -0500 Add pitch shifting. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit f848fe7971d6e7970c6301d4a1ac5c785bd201ce Author: Gabriel M. Beddingfield Date: Wed Mar 31 22:24:37 2010 -0500 Get time stretching working. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp commit df1094bfe8e7ab2744d5f1983f30f5a2b0c44436 Author: Gabriel M. Beddingfield Date: Wed Mar 31 01:31:55 2010 -0500 Remove the resampling stuff and connect the stretch slider. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp M src/stretchplayer.pro commit c9299460af47ac271a3fbef99253b493a99002dd Author: Gabriel M. Beddingfield Date: Wed Mar 31 01:12:11 2010 -0500 Make the song position slider work. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit 4d23ec9aa21ca8da2f85a1ee393c62f7440c5885 Author: Gabriel M. Beddingfield Date: Wed Mar 31 01:04:28 2010 -0500 Resample data after loading it. M src/Engine.cpp M src/Engine.hpp M src/stretchplayer.pro commit 31e3552488f712b3622e5133a010117a66b19dae Author: Gabriel M. Beddingfield Date: Wed Mar 31 00:14:50 2010 -0500 Get the simple player working. M src/Engine.cpp M src/Engine.hpp M src/PlayerWidget.cpp M src/main.cpp M src/stretchplayer.pro commit e91b3ec27914486fa915278c3ddfdb15355f41db Author: Gabriel M. Beddingfield Date: Tue Mar 30 23:19:11 2010 -0500 Add a simple sound engine. A src/Engine.cpp A src/Engine.hpp M src/PlayerWidget.cpp M src/PlayerWidget.hpp M src/stretchplayer.pro commit eb394fe232409844af82561914b068c5ffd8e960 Author: Gabriel M. Beddingfield Date: Tue Mar 30 22:14:17 2010 -0500 Tweak look and add stretch slider. M src/PlayerWidget.cpp M src/PlayerWidget.hpp commit c34add9271ec293c315414a92d23812255f41f35 Author: Gabriel M. Beddingfield Date: Tue Mar 30 21:56:53 2010 -0500 Add base UI for a player. A src/PlayerWidget.cpp A src/PlayerWidget.hpp A src/main.cpp A src/stretchplayer.pro stretchplayer-0.503/Documentation/000077500000000000000000000000001142050324400172165ustar00rootroot00000000000000stretchplayer-0.503/Documentation/ui-mockup.svg000066400000000000000000000304201142050324400216470ustar00rootroot00000000000000 image/svg+xml 00:00.0 A/B SPEED 50%PITCH +12VOL 75%CPU 80% Loading file 'foo.bar.wav' + - ? stretchplayer-0.503/INSTALL.txt000066400000000000000000000106561142050324400162640ustar00rootroot00000000000000StretchPlayer - Audio file stretch player and phrase trainer BUILDING AND INSTALLING STRETCHPLAYER ===================================== Contents: 1. System Requirements 2. Download 3. Binary Packages 4. Prerequisites to Build from Source 5. Build and Install from Source (Simple) 6. Build and Install from Source (Detailed Configuration) 7. INSTALL.txt Changelog 1. System Requirements ---------------------- Composite is supported on the following operating systems: * Linux/Unix/BSD Composite is not yet supported on Windows or OS X. If you would like to help, please let me know. StretchPlayer is very calculation-intensive (via librubberband). It is known to /not/ work on PIII 800 MHz machines because they're not fast enough. Pentium 4 1200 MHz 512 MB RAM Consumer-Grade (cheap) audio card Keyboard and Mouse However, if you are careful (stay within about 30% of orig. speed and with +/- 5 half-steps) and use a large buffer size (e.g. 4096), it is possible to get this to work on a PIII 800 MHz. 2. Download ----------- StretchPlayer's source code can be downloaded for the home page: http://www.teuton.org/~gabriel/stretchplayer/ The source code for the current development version can be checked out via Git: $ git clone git://gitorious.org/stretchplayer/stretchplayer.git 3. Binary Packages ------------------ There are currently no binary packages available. 4. Prerequisites to Build from Source ------------------------------------- In order to build from source, you will need the following libraries installed on your system, and the development header files. REQUIRED * Qt 4 Library (>=4.5.0) * Qt 4 SDK (moc, uic, etc.) * GNU g++ compiler (>=4.0, 3.x might work) * CMake (>= 2.6, earlier might work) * JACK (jack1 >= 0.109.0, jack2 >= 1.9.3, earlier ones may work on some systems) * libsndfile >=1.0.17 * librubberband On a dual-core, 32-bit, 1800MHz processor using a parallel build, StretchPlayer takes about 10 seconds to compile. 5. Build and Install from Source (Simple) ----------------------------------------- After you have all the prerequisites, building and installing will look like this: $ tar xjf stretchplayer-0.500.tar.bz2 $ cd stretchplayer-0.500 $ mkdir build $ cd build $ cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr/local $ make $ sudo make install +---------------------------------------------------+ | NOTICE: BUILDING WITH 'cmake .' IS NOT SUPPORTED | +---------------------------------------------------+ To change the directory where StretchPlayer is installed, it is done like this on the last step: $ sudo make install DESTDIR=/mnt/chroot THERE IS NO UNINSTALL. USE A PACKAGE MANAGER. Composite uses a tool that detects the correct Qt settings. Please make sure that qmake for Qt4 is in your path... and all will be well. ___CREATING A BINARY PACKAGE___ If you are a package maintainer and wish for your packaging scripts to be included in the StretchPlayer source tree, we would be happy to work with you. Please contact Gabriel Beddingfield . 6. Build and Install from Source (Detailed Configuration) --------------------------------------------------------- Unfortunately, CMake doesn't have something that works exactly like './configure --help' that will show you all the configuration options. The best way to see the standard options is to run: $ ccmake /path/to/sources/stretchplayer-0.500 Which will give you a listing of the options from the CMakeLists.txt file. You have the following commands (and more) available: h - get help on the current field/option c - Reconfigure g - Generate makefiles t - Toggle advanced mode so that you can set -funroll-loops -fomit-frame-pointer The following information is for your convenience, and is bound to go out-of date as things change: DEBUG BUILDS -- Either `cmake -DCMAKE_BUILD_TYPE=Debug /path/to/srcs` or `cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo /path/to/srcs` PREFIX -- `cmake -DCMAKE_INSTALL_PREFIX=/usr/local /path/to/srcs` DESTDIR -- With GNU Makefiles, `make install DESTDIR=/mnt/chroot` 7. INSTALL.txt Changelog ------------------------ 2010-04-05 Gabriel M. Beddingfield * Copied INSTALL.txt from Composite and modified it. stretchplayer-0.503/README.txt000066400000000000000000000123021142050324400161010ustar00rootroot00000000000000StretchPlayer - Audio file stretch player and phrase trainer Copyright (C) 2010 by Gabriel M. Beddingfield All Rights Reserved "For of him [God], and through him, and unto him, are all things. To him be the glory for ever. Amen." (Romans 11:36) CONTENTS ======== 1. Description 2. Dependencies and Installation 3. Usage 4. About StretchPlayer DESCRIPTION =========== StretchPlayer is an audio file player that allows you to change the speed of the song without changing the pitch. It will also allow you to transpose the song to another key (while also changing the speed). This is a very powerful tool for musicians who are learning to play a pre-recorded song. It's features include: + Time Stretch (50% to 150% of song speed) + Pitch shift (up or down 1 octave) + A/B repeat The player supports all the audio formats that libsndfile supports, which currently includes OGG/Vorbis, WAV, W64, AIFF, SND, and FLAC. +--------------------------------------------------+ | Note that neither libsndfile nor StretchPlayer | | supports MP3 files for patent liability reasons. | +--------------------------------------------------+ StretchPlayer is free software, distributed under the GNU Public License, version 2 or later. See the files gpl-2.0.txt and gpl-3.0.txt for the details of the license. DEPENDENCIES AND INSTALLATION ============================= Please read the file INSTALL.txt for package dependencies and installation instructions. USAGE ===== $ stretchplayer If you hover over the buttons with your mouse, you'll find several keyboard shortcuts. One extra shortcut is the [HOME] key, which will set everything back to default settings (including relocating to the beginning of the song). +-------------------------------------------+ | Important: Performance | | | | Make sure that you use a JACK buffer size | | larger than 256. Less than 256 is known | | to have real-time issues. | +-------------------------------------------+ ABOUT STRETCHPLAYER =================== StretchPlayer is free software written to glorify God and His Savior Jesus Christ. I dedicate this code to spreading His word and His love. If you have found this software useful, please make a donation to a Christian missionary. Suggested donation is US $10 or US $20. The mission is (of course) your choice... but if you don't know one to pick, may I suggest Wycliffe Bible Translators (www.wycliffe.org). They are an organization dedicated to translating the Bible into the "heart language" of every person on earth -- *every* indigenous language. In doing so, they have brought literacy to thousands of third-world peoples. These peoples now have their language written down, increased literacy rates, and greater pride in their heritage through such literacy. This is admirable even if you are not a believer of Jesus Christ. Are you a believer and a follower of Jesus Christ? Do you have in your life peace and forgiveness of sins? Or do you live in fear of God because of your sins -- the evil things that you do every day? Jesus didn't come put you down! He came to SAVE you from your sins. He came to: (1) forgive you for all your sins (past, present, and future) (2) Make a way for God to live inside you (every day), to teach you about Himself, and to be your friend. But this can only happen if you surrender your life to Him. To say, "I have sinned. I am sorry. I turn from that, and turn to you, God. Please forgive me for my sins. I give my life to you. You are now in control... I am your slave. I will follow Your Word. What You say, I will do." Not those exact words... but you get the idea. When this happens, the Holy Spirit comes into your life and lives within you. This happens as a "down payment" (from God to you) -- as a way of proving that you *will* be with God when you die. Proving that you are now a child of God -- no longer an enemy but a favored child. (Otherwise, you will go to hell -- forever separated from God.) Don't believe me? OK. But this is what the Bible (the Christian Scriptures / Holy Book) says about it: 1. That people are separated from God by sins... "All have sinned, and fall short of the glory of God." (Romans 3:26) 2. That God loves you and wants to FREE you... "For God so loved the world, that he gave his only begotten Son, that whoever believes on him should not perish, but have eternal life. For God sent not the Son into the world to judge the world; but that the world should be saved through him. He that believes on him is not judged: he that does not believe has been judged already, because he has not believed on the name of the only begotten Son of God." (John 3:16-18) 3. That Jesus is the ONLY way... "And in no other is there salvation: for there is no other name under heaven, that is given among men, by which we must be saved." (Acts 4:12) If you now believe -- tell someone. Even me. Offended? No flames, please. I'm not forcing myself on anyone. Questions? Drop me a line: gabriel@teuton.org Grace and peace to you all! stretchplayer-0.503/art/000077500000000000000000000000001142050324400151735ustar00rootroot00000000000000stretchplayer-0.503/art/CMakeLists.txt000066400000000000000000000020611142050324400177320ustar00rootroot00000000000000###################################################################### ### StretchPlayer Build Script (CMake) ### ###################################################################### CMAKE_MINIMUM_REQUIRED(VERSION 2.4) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) ###################################################################### ### INSTALL MISC ART ### ###################################################################### INSTALL( FILES stretchplayer-icon-48x48.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons RENAME stretchplayer.png ) INSTALL( FILES stretchplayer-icon-48x48.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME stretchplayer.png ) INSTALL( FILES stretchplayer-icon.svg stretchplayer-icon-16x16.png stretchplayer-icon-22x22.png stretchplayer-icon-24x24.png stretchplayer-icon-32x32.png stretchplayer-icon-48x48.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/stretchplayer/icons/ ) stretchplayer-0.503/art/stretchplayer-icon-16x16.png000066400000000000000000000011361142050324400223040ustar00rootroot00000000000000PNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<IDAT8K[QsIz^!b : u?8S]N !`B4 ܜ-ɵfw>|/ZkR/R~%8Fܰ\NiϪ\NisC1@Tnlm0ٶҐ,a^]F"(I5 X ,dn.0R *b+'W{f--},.&H&Mڜ60i,hd212H-VVd ?|;Z`{ru:i}|Rg##.FD&;ܼ /H$FggMB2IfgAdAAqR)B!P"L'm "@)<7ԁ~y*ery`YœA}TBkݝj^~Jk>VIENDB`stretchplayer-0.503/art/stretchplayer-icon-22x22.png000066400000000000000000000014061142050324400222760ustar00rootroot00000000000000PNG  IHDRĴl;sBIT|d pHYsaa0UtEXtSoftwarewww.inkscape.org<IDAT8OKAƬ5ԛ"h,7 (=S{QL /IѢ.DqDwIP|``gRJ}*bb`}<|ݶ kZr}wue "kY`Ga`Mff|D"SiӶ/Hehs^_"wXɤFRBޒ٬bk+3b9YB^]J.MSAc%ϟer )$t--n+x(7ta 8r]^VDje%bҩͩ>NMm#8Q`mnlt13SWi"ac^L0;I&- ~?Mw}b&tuI03&s ݠi*fgӌ~;NUU/N5VWo[S)$q:H y_)YZ i<|xb|Y]!t\ѹ-8++sqL߽;drҠKOO .$GLLMMjJ (ut1CGѯ8<W5HYroѯR"2]#VwInVE NNo.)޿ch4ΝZ[8Fzz;ff5mluR )5MLc<^s$8|XGM 1ͯi}}aTUUU۷iF=sbUfsf)Blɘϧ0>I,ty'uXD@Wn-34x8գ eq8(JխHD-yVU-Bww *5JΟsz2V!x. UEh8uʊ׫00BPWzu#+СDD@J`DBG"xɹs("IU^Xl&ff~'fh/*}-otqhS$d8a!>Ξ-?l% eu/*e㊢u <~+WTJFFJ۷Wsg̸M\My:ThTmmFo)%f|qޞlꆠ͸k6 ]k…rMTHd_L2g||$q/-v4]QMh/`BE1)|J`]"F |0m.tZߌ[VM~G5&}hNq¾IENDB`stretchplayer-0.503/art/stretchplayer-icon-48x48.png000066400000000000000000000027721142050324400223250ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs11(RtEXtSoftwarewww.inkscape.org<wIDATh՚KLSYABgC"Qcb Ƹq4" LfcB7n(" ue4MXaH1aW)y3zo_r{νroϕ$$I!"ҊM+苴.!ć#?4 hBX'-ᔵo: c9K$0N]=:JKRU\ix<ׯ}{B@X$IY[ ;[MkkBx9l.V'SS)G1 aEeeXVUmF϶;EEZ[bO$XE*%z DϤ=C*@M~-xB 1ui|xO_!jrrMŎ?| 3pZ.v[fRvD-LǏ%ŢbI/~Oӧ(lv-(ܙŋɅD6;h^r٬f`6kU/9^.bL\Y9MyB UU:3p[KU(٩SY?oD@ebEGS/J.E42JO}HwoƉ2Z ۨM]$ׯA^Hjt image/svg+xml S stretchplayer-0.503/cmake/000077500000000000000000000000001142050324400154655ustar00rootroot00000000000000stretchplayer-0.503/cmake/FindJACK.cmake000066400000000000000000000007011142050324400177760ustar00rootroot00000000000000# - Try to find jack-2.6 # Once done this will define # # JACK_FOUND - system has jack # JACK_INCLUDE_DIRS - the jack include directory # JACK_LIBRARIES - Link these to use jack # INCLUDE(TritiumPackageHelper) TPH_FIND_PACKAGE(JACK jack jack/midiport.h jack) INCLUDE(TritiumFindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(JACK DEFAULT_MSG JACK_LIBRARIES JACK_INCLUDE_DIRS) MARK_AS_ADVANCED(JACK_INCLUDE_DIRS JACK_LIBRARIES) stretchplayer-0.503/cmake/FindLibSndfile.cmake000066400000000000000000000007111142050324400213020ustar00rootroot00000000000000# FindLibSndfile # Try to find libLibSndfile # # Once found, will define: # # LibSndfile_FOUND # LibSndfile_INCLUDE_DIRS # LibSndfile_LIBRARIES # INCLUDE(TritiumPackageHelper) TPH_FIND_PACKAGE(LibSndfile sndfile sndfile.h sndfile) INCLUDE(TritiumFindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibSndfile DEFAULT_MSG LibSndfile_LIBRARIES LibSndfile_INCLUDE_DIRS) MARK_AS_ADVANCED(LibSndfile_INCLUDE_DIRS LibSndfile_LIBRARIES) stretchplayer-0.503/cmake/FindRubberBand.cmake000066400000000000000000000007461142050324400213050ustar00rootroot00000000000000# FindRubberBand # Try to find librubberband # # Once found, will define: # # RubberBand_FOUND # RubberBand_INCLUDE_DIRS # RubberBand_LIBRARIES # INCLUDE(TritiumPackageHelper) TPH_FIND_PACKAGE(RubberBand rubberband rubberband/RubberBandStretcher.h rubberband) INCLUDE(TritiumFindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(RubberBand DEFAULT_MSG RubberBand_LIBRARIES RubberBand_INCLUDE_DIRS) MARK_AS_ADVANCED(RubberBand_INCLUDE_DIRS RubberBand_LIBRARIES) stretchplayer-0.503/cmake/TritiumFindPackageHandleStandardArgs.cmake000066400000000000000000000052521142050324400256170ustar00rootroot00000000000000# # This file was copied from CMake 2.5. It's used to permit CMake 2.4 # to use the CMake 2.5-derived find scripts here. # IF (NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) # Use the original from cmake 2.5 if possible INCLUDE(FindPackageHandleStandardArgs) ELSE(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) # or define our own... # FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... ) # This macro is intended to be used in FindXXX.cmake modules files. # It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and # it also sets the _FOUND variable. # The package is found if all variables listed are TRUE. # Example: # # FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) # # LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and # LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. # If it is not found and REQUIRED was used, it fails with FATAL_ERROR, # independent whether QUIET was used or not. # If it is found, the location is reported using the VAR1 argument, so # here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out. # If the second argument is DEFAULT_MSG, the message in the failure case will # be "Could NOT find LibXml2", if you don't like this message you can specify # your own custom failure message there. MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") SET(_FAIL_MESSAGE "Could NOT find ${_NAME}") ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") SET(_FAIL_MESSAGE "${_FAIL_MSG}") ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") STRING(TOUPPER ${_NAME} _NAME_UPPER) SET(${_NAME_UPPER}_FOUND TRUE) IF(NOT ${_VAR1}) SET(${_NAME_UPPER}_FOUND FALSE) ENDIF(NOT ${_VAR1}) FOREACH(_CURRENT_VAR ${ARGN}) IF(NOT ${_CURRENT_VAR}) SET(${_NAME_UPPER}_FOUND FALSE) ENDIF(NOT ${_CURRENT_VAR}) ENDFOREACH(_CURRENT_VAR ${ARGN}) IF (${_NAME_UPPER}_FOUND) IF (NOT ${_NAME}_FIND_QUIETLY) MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}") ENDIF (NOT ${_NAME}_FIND_QUIETLY) ELSE (${_NAME_UPPER}_FOUND) IF (${_NAME}_FIND_REQUIRED) MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}") ELSE (${_NAME}_FIND_REQUIRED) IF (NOT ${_NAME}_FIND_QUIETLY) MESSAGE(STATUS "${_FAIL_MESSAGE}") ENDIF (NOT ${_NAME}_FIND_QUIETLY) ENDIF (${_NAME}_FIND_REQUIRED) ENDIF (${_NAME_UPPER}_FOUND) ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS) ENDIF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) stretchplayer-0.503/cmake/TritiumPackageHelper.cmake000066400000000000000000000025401142050324400225410ustar00rootroot00000000000000# TritiumPackageHelper # # Defines useful macros for package discovery. # # Sets the following: # # TPH_FOUND # TPH_FIND_PACKAGE(prefix pkgconfigname header lib) # # If the package is found, it will define: # # _FOUND # _INCLUDE_DIRS # _LIBRARIES # SET(TPH_FOUND TRUE) MACRO(TPH_FIND_PACKAGE prefix pkgconfigname header lib) IF(${prefix}_LIBRARIES AND ${prefix}_INCLUDE_DIRS) #...already in cache SET(${prefix}_FOUND TRUE) ELSE(${prefix}_LIBRARIES AND ${prefix}_INCLUDE_DIRS) FIND_PACKAGE(PkgConfig) IF(PKG_CONFIG_FOUND AND "${pkgconfigname}") PKG_SEARCH_MODULE(${prefix} ${pkgconfigname}) ELSE(PKG_CONFIG_FOUND AND "${pkgconfigname}") FIND_PATH(${prefix}_INCLUDE_DIRS ${header}) FIND_LIBRARY(${prefix}_LIBRARIES ${lib}) IF(${prefix}_INCLUDE_DIRS AND ${prefix}_LIBRARIES) SET(${prefix}_FOUND TRUE) ENDIF(${prefix}_INCLUDE_DIRS AND ${prefix}_LIBRARIES) ENDIF(PKG_CONFIG_FOUND AND "${pkgconfigname}") ## If _INCLUDE_DIRS is an empty string, ## FIND_PACKAGE_HANDLE_STANDARD_ARGS() chokes. IF(${prefix}_FOUND) IF(${prefix}_INCLUDE_DIRS STREQUAL "") SET(${prefix}_INCLUDE_DIRS /usr/include) ENDIF(${prefix}_INCLUDE_DIRS STREQUAL "") ENDIF(${prefix}_FOUND) ENDIF(${prefix}_LIBRARIES AND ${prefix}_INCLUDE_DIRS) ENDMACRO(TPH_FIND_PACKAGE) stretchplayer-0.503/config.h.in000066400000000000000000000001431142050324400164260ustar00rootroot00000000000000 #define STRETCHPLAYER_VERSION "@VERSION@" #define STRETCHPLAYER_USE_COMPOSITING @USE_COMPOSITING@ stretchplayer-0.503/gpl-2.0.txt000066400000000000000000000431031142050324400162260ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. stretchplayer-0.503/gpl-3.0.txt000066400000000000000000001045131142050324400162320ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . stretchplayer-0.503/src/000077500000000000000000000000001142050324400151745ustar00rootroot00000000000000stretchplayer-0.503/src/.gitignore000066400000000000000000000001271142050324400171640ustar00rootroot00000000000000*.[oa] *~ stretchplayer moc_* Makefile Makefile.Debug Makefile.Release Debug/ Release/ stretchplayer-0.503/src/AudioSystem.hpp000066400000000000000000000067551142050324400201700ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef AUDIOSYSTEM_HPP #define AUDIOSYSTEM_HPP #include class QString; namespace StretchPlayer { /** * \brief Pure virtual interface to an audio driver API. * * This AudioSystem assumes a very simple system with two audio * outputs. It maintains those ports and buffers and the * connection of them. */ class AudioSystem { public: typedef float sample_t; typedef int (*process_callback_t)(uint32_t nframes, void *arg); virtual ~AudioSystem() {} /** * 'Construct' the system. * * The Constructor should only initialize bare-bones stuff. * This function should actually do the initialization. It * does /not/ need to be realtime safe. * * \param app_name if non-zero, identifies this application by * the name given. If the sound system requires the name be * changed, then app_name will be quietly changed to match. * * \returns 0 on success, nonzero on error. */ virtual int init(QString* app_name, QString *err_msg = 0) = 0; /** * Clean up the system. * * This is the opposite of init(). De-initialization should * be done here rather than the destructor... but the * destructor should be able to call this function, even after * the function was called explicitly. */ virtual void cleanup() = 0; /** * Set the process() callback function. * * The audio system will call this function periodically when * it is time to process data. This function may only be * called before activate() or after deactivate(). * * Pass a null pointer to clear the callback. * * \return 0 on success, otherwise non-zero. */ virtual int set_process_callback(process_callback_t cb, void* arg, QString* err_msg = 0) = 0; /** * Activate the driver (may start processing audio). * * \returns 0 on success, nonzero on error. */ virtual int activate(QString *err_msg = 0) = 0; /** * Deactivates the driver (must stop processing audio). * * \returns 0 on success, nonzero on error. */ virtual int deactivate(QString *err_msg = 0) = 0; /** * Returns a pointer to the output buffer. [RT SAFE] * * index is 0 for Left, 1 for Right. Any others will return a * null pointer. * * \returns pointer to buffer, or null pointer if the buffer * does not exist. */ virtual sample_t* output_buffer(int index) = 0; /** * Returns the size of the output buffer. [RT SAFE] */ virtual uint32_t output_buffer_size(int index) = 0; virtual uint32_t sample_rate() = 0; /** * Returns the current CPU/DSP load as a float [0.0, 1.0] * * \return A float [0.0, 1.0]. -1.0 if the audio system doesn't * support this feature. */ virtual float dsp_load() = 0; }; } // namespace StretchPlayer #endif // AUDIOSYSTEM_HPP stretchplayer-0.503/src/CMakeLists.txt000066400000000000000000000050601142050324400177350ustar00rootroot00000000000000###################################################################### ### StretchPlayer Build Script (CMake) ### ###################################################################### CMAKE_MINIMUM_REQUIRED(VERSION 2.4) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) ###################################################################### ### REQUIRED LIBRARIES ### ###################################################################### ### ### Qt 4 http://qt.nokia.com/ ### FIND_PACKAGE(Qt4 4.5.0 REQUIRED) INCLUDE(${QT_USE_FILE}) SET(LIBS ${QT_LIBRARIES}) FIND_PACKAGE(JACK REQUIRED) INCLUDE(${JACK_INCLUDE_DIRS}) SET(LIBS ${LIBS} ${JACK_LIBRARIES}) FIND_PACKAGE(LibSndfile REQUIRED) INCLUDE(${LibSndfile_INCLUDE_DIRS}) SET(LIBS ${LIBS} ${LibSndfile_LIBRARIES}) ### Don't have a module for rubberband, yet. FIND_PACKAGE(RubberBand REQUIRED) INCLUDE(${RubberBand_INCLUDE_DIRS}) SET(LIBS ${LIBS} ${RubberBand_LIBRARIES}) ###################################################################### ### LIBRARY SOURCES AND BUILD ### ###################################################################### LIST(APPEND sp_cpp main.cpp PlayerWidget.cpp Engine.cpp StatusWidget.cpp PlayerSizes.cpp ThinSlider.cpp Marquee.cpp JackAudioSystem.cpp ) LIST(APPEND sp_hpp PlayerWidget.hpp Engine.hpp StatusWidget.hpp PlayerSizes.hpp ThinSlider.hpp Marquee.hpp AudioSystem.hpp JackAudioSystem.hpp ) LIST(APPEND sp_moc_hpp PlayerWidget.hpp StatusWidget.hpp Marquee.hpp ) QT4_WRAP_CPP(sp_moc ${sp_moc_hpp}) QT4_ADD_RESOURCES(sp_qrc stretchplayer.qrc) INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR} ) ADD_EXECUTABLE(stretchplayer ${sp_cpp} ${sp_hpp} ${sp_moc} ${sp_qrc} ) TARGET_LINK_LIBRARIES(stretchplayer ${LIBS} ) INSTALL(TARGETS stretchplayer RUNTIME DESTINATION bin) ###################################################################### ### CONFIGURATION SUMMARY ### ###################################################################### MESSAGE("\n" "Configuration Summary for StretchPlayer\n" "---------------------------------------\n" ) MACRO(lib_report name) IF(${name}_FOUND) message("ENABLED..... ${name}") ELSE(${name}_FOUND) message("disabled.... ${name}") ENDIF(${name}_FOUND) ENDMACRO(lib_report) lib_report(QT4) lib_report(JACK) lib_report(LibSndfile) lib_report(RubberBand) stretchplayer-0.503/src/Engine.cpp000066400000000000000000000212051142050324400171050ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "Engine.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include using RubberBand::RubberBandStretcher; using namespace std; namespace StretchPlayer { Engine::Engine() : _playing(false), _state_changed(false), _position(0), _loop_a(0), _loop_b(0), _sample_rate(48000.0), _stretch(1.0), _pitch(0), _gain(1.0) { QString err; QMutexLocker lk(&_audio_lock); _audio_system.reset( new JackAudioSystem ); QString app_name("StretchPlayer"); _audio_system->init( &app_name, &err); _audio_system->set_process_callback(Engine::static_process_callback, this); if( ! err.isNull() ) throw std::runtime_error(err.toLocal8Bit().data()); uint32_t sample_rate = _audio_system->sample_rate(); _stretcher.reset( new RubberBandStretcher( sample_rate, 2, RubberBandStretcher::OptionProcessRealTime | RubberBandStretcher::OptionThreadingAuto ) ); _stretcher->setMaxProcessSize(16384); if( _audio_system->activate(&err) ) throw std::runtime_error(err.toLocal8Bit().data()); } Engine::~Engine() { QMutexLocker lk(&_audio_lock); _audio_system->deactivate(); _audio_system->cleanup(); callback_seq_t::iterator it; QMutexLocker lk_cb(&_callback_lock); for( it=_error_callbacks.begin() ; it!=_error_callbacks.end() ; ++it ) { (*it)->_parent = 0; } for( it=_message_callbacks.begin() ; it!=_message_callbacks.end() ; ++it ) { (*it)->_parent = 0; } } void Engine::_zero_buffers(uint32_t nframes) { // MUTEX MUST ALREADY BE LOCKED // Just zero the buffers void *buf_L = 0, *buf_R = 0; buf_L = _audio_system->output_buffer(0); if(buf_L) { memset(buf_L, 0, nframes * sizeof(float)); } buf_R = _audio_system->output_buffer(1); if(buf_R) { memset(buf_R, 0, nframes * sizeof(float)); } } int Engine::process_callback(uint32_t nframes) { bool locked = false; try { locked = _audio_lock.tryLock(); if(_state_changed) { _state_changed = false; _stretcher->reset(); } if(locked) { if(_playing) { if(_left.size()) { _process_playing(nframes); } else { _playing = false; } } else { _zero_buffers(nframes); } } else { _zero_buffers(nframes); } } catch (...) { } if(locked) _audio_lock.unlock(); return 0; } void Engine::_process_playing(uint32_t nframes) { // MUTEX MUST ALREADY BE LOCKED float *buf_L = 0, *buf_R = 0; buf_L = _audio_system->output_buffer(0); buf_R = _audio_system->output_buffer(1); float* rb_buf_in[2]; float* rb_buf_out[2] = { buf_L, buf_R }; uint32_t srate = _audio_system->sample_rate(); _stretcher->setTimeRatio( srate / _sample_rate / _stretch ); _stretcher->setPitchScale( ::pow(2.0, double(_pitch)/12.0) * _sample_rate / srate ); uint32_t frame; uint32_t reqd, gend, zeros, feed; frame = 0; while( frame < nframes ) { reqd = _stretcher->getSamplesRequired(); int avail = _stretcher->available(); if( avail <= 0 ) avail = 0; if( unsigned(avail) >= nframes ) reqd = 0; zeros = 0; feed = reqd; if( looping() && ((_position + reqd) >=_loop_b) ) { assert( _loop_b >= _position ); reqd = _loop_b - _position; } if( _position + reqd > _left.size() ) { feed = _left.size() - _position; zeros = reqd - feed; } rb_buf_in[0] = &_left[_position]; rb_buf_in[1] = &_right[_position]; if( reqd == 0 ) { feed = 0; zeros = 0; } _stretcher->process( rb_buf_in, feed, false); if(reqd && zeros) { float l[zeros], r[zeros]; float* z[2] = { l, r }; memset(l, 0, zeros * sizeof(float)); memset(r, 0, zeros * sizeof(float)); _stretcher->process(z, zeros, false); } gend = 1; while( gend && frame < nframes ) { gend = _stretcher->retrieve(rb_buf_out, (nframes-frame)); rb_buf_out[0] += gend; rb_buf_out[1] += gend; frame += gend; } _position += feed; if( looping() && _position >= _loop_b ) { _position = _loop_a; } } // Apply gain and clip for( frame=0 ; frame 1.0) buf_L[frame] = 1.0; if(buf_L[frame] < -1.0) buf_L[frame] = -1.0; buf_R[frame] *= _gain; if(buf_R[frame] > 1.0) buf_R[frame] = 1.0; if(buf_R[frame] < -1.0) buf_R[frame] = -1.0; } if(_position >= _left.size()) { _playing = false; _position = 0; } } /** * Load a file * * \return Name of song */ QString Engine::load_song(const QString& filename) { QMutexLocker lk(&_audio_lock); stop(); _left.clear(); _right.clear(); _position = 0; SNDFILE *sf = 0; SF_INFO sf_info; memset(&sf_info, 0, sizeof(sf_info)); _message( QString("Opening file...") ); sf = sf_open(filename.toLocal8Bit().data(), SFM_READ, &sf_info); if( !sf ) { _error( QString("Error opening file '%1': %2") .arg(filename) .arg( sf_strerror(sf) ) ); return QString(); } _sample_rate = sf_info.samplerate; _left.reserve( sf_info.frames ); _right.reserve( sf_info.frames ); if(sf_info.frames == 0) { _error( QString("Error opening file '%1': File is empty") .arg(filename) ); sf_close(sf); return QString(); } _message( QString("Opening file...") ); std::vector buf(4096, 0.0f); sf_count_t read, k; unsigned mod; while(true) { read = sf_read_float(sf, &buf[0], buf.size()); if( read < 1 ) break; for(k=0 ; k 0) { return float(_position) / _sample_rate; } return 0; } void Engine::loop_ab() { if( _loop_b > _loop_a ) { _loop_b = 0; _loop_a = 0; } else if( _loop_a == 0 ) { _loop_a = _position; if(_position == 0) { _loop_a = 1; } } else if( _loop_a != 0 ) { if( _position > _loop_a ) { _loop_b = _position; } else { _loop_a = _position; } } else { assert(false); // invalid state } } float Engine::get_length() { if(_left.size() > 0) { return float(_left.size()) / _sample_rate; } return 0; } void Engine::locate(double secs) { unsigned long pos = secs * _sample_rate; QMutexLocker lk(&_audio_lock); _position = pos; _state_changed = true; } void Engine::_dispatch_message(const Engine::callback_seq_t& seq, const QString& msg) const { QMutexLocker lk(&_callback_lock); Engine::callback_seq_t::const_iterator it; for( it=seq.begin() ; it!=seq.end() ; ++it ) { (**it)(msg); } } void Engine::_subscribe_list(Engine::callback_seq_t& seq, EngineMessageCallback* obj) { if( obj == 0 ) return; QMutexLocker lk(&_callback_lock); obj->_parent = this; seq.insert(obj); } void Engine::_unsubscribe_list(Engine::callback_seq_t& seq, EngineMessageCallback* obj) { if( obj == 0 ) return; QMutexLocker lk(&_callback_lock); obj->_parent = 0; seq.erase(obj); } float Engine::get_cpu_load() { return _audio_system->dsp_load(); } } // namespace StretchPlayer stretchplayer-0.503/src/Engine.hpp000066400000000000000000000102501142050324400171100ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef ENGINE_HPP #define ENGINE_HPP #include #include #include #include #include #include namespace RubberBand { class RubberBandStretcher; } namespace StretchPlayer { class EngineMessageCallback; class AudioSystem; class Engine { public: Engine(); ~Engine(); QString load_song(const QString& filename); void play(); void play_pause(); void stop(); bool playing() { return _playing; } void loop_ab(); bool looping() { return _loop_b > _loop_a; } float get_position(); // in seconds float get_length(); // in seconds void locate(double secs); float get_stretch() { return _stretch; } void set_stretch(float str) { if(str > 0.5 && str < 2.0) { _stretch = str; //_state_changed = true; } } int get_pitch() { return _pitch; } void set_pitch(int pit) { if(pit < -12) { _pitch = -12; } else if (pit > 12) { _pitch = 12; } else { _pitch = pit; } //_state_changed = true; } /** * Clipped to [0.0, 10.0] */ void set_volume(float gain) { if(gain < 0.0) gain = 0.0; if(gain > 10.0) gain = 10.0; _gain=gain; } float get_volume() { return _gain; } /** * Returns estimate of CPU load [0.0, 1.0] */ float get_cpu_load(); void subscribe_errors(EngineMessageCallback* obj) { _subscribe_list(_error_callbacks, obj); } void unsubscribe_errors(EngineMessageCallback* obj) { _unsubscribe_list(_error_callbacks, obj); } void subscribe_messages(EngineMessageCallback* obj) { _subscribe_list(_message_callbacks, obj); } void unsubscribe_messages(EngineMessageCallback* obj) { _unsubscribe_list(_message_callbacks, obj); } private: static int static_process_callback(uint32_t nframes, void* arg) { Engine *e = static_cast(arg); return e->process_callback(nframes); } int process_callback(uint32_t nframes); void _zero_buffers(uint32_t nframes); void _process_playing(uint32_t nframes); typedef std::set callback_seq_t; void _error(const QString& msg) const { _dispatch_message(_error_callbacks, msg); } void _message(const QString& msg) const { _dispatch_message(_message_callbacks, msg); } void _dispatch_message(const callback_seq_t& seq, const QString& msg) const; void _subscribe_list(callback_seq_t& seq, EngineMessageCallback* obj); void _unsubscribe_list(callback_seq_t& seq, EngineMessageCallback* obj); bool _playing; bool _state_changed; mutable QMutex _audio_lock; std::vector _left; std::vector _right; unsigned long _position; unsigned long _loop_a; unsigned long _loop_b; float _sample_rate; float _stretch; int _pitch; float _gain; std::auto_ptr _stretcher; std::auto_ptr _audio_system; mutable QMutex _callback_lock; callback_seq_t _error_callbacks; callback_seq_t _message_callbacks; }; // Engine class EngineMessageCallback { public: virtual ~EngineMessageCallback() { if(_parent) { _parent->unsubscribe_errors(this); } if(_parent) { _parent->unsubscribe_messages(this); } } virtual void operator()(const QString& message) = 0; private: friend class Engine; Engine *_parent; }; } // namespace StretchPlayer #endif // ENGINE_HPP stretchplayer-0.503/src/JackAudioSystem.cpp000066400000000000000000000103621142050324400207410ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "JackAudioSystem.hpp" #include #include #include #include #include namespace StretchPlayer { JackAudioSystem::JackAudioSystem() : _client(0) { _port[0] = 0; _port[1] = 0; } JackAudioSystem::~JackAudioSystem() { cleanup(); } int JackAudioSystem::init(QString * app_name, QString *err_msg) { QString name("StretchPlayer"), err; if(app_name) { name = *app_name; } _client = jack_client_open(name.toAscii(), JackNullOption, 0); if(!_client) { err = "Could not set up JACK"; goto init_bail; } _port[0] = jack_port_register( _client, "left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 ); if(!_port[0]) { err = "Could not set up left out"; goto init_bail; } _port[1] = jack_port_register( _client, "right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 ); if(!_port[1]) { err = "Could not set up right out"; goto init_bail; } return 0; init_bail: if(err_msg) { *err_msg = err; } return 0xDEADBEEF; } void JackAudioSystem::cleanup() { deactivate(); if( _port[0] ) { assert(_client); jack_port_unregister(_client, _port[0]); _port[0] = 0; } if( _port[1] ) { assert(_client); jack_port_unregister(_client, _port[1]); _port[1] = 0; } if(_client) { jack_client_close(_client); _client = 0; } } int JackAudioSystem::set_process_callback(process_callback_t cb, void* arg, QString* err_msg) { assert(_client); int rv = jack_set_process_callback( _client, cb, arg ); if(rv && err_msg) { *err_msg = "Could not set up jack callback."; } return rv; } int JackAudioSystem::activate(QString *err_msg) { assert(_client); assert(_port[0]); assert(_port[1]); jack_activate(_client); // Autoconnection to first two ports we find. const char** ports = jack_get_ports( _client, 0, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput ); int k, rv = 0; for( k=0 ; ports && ports[k] != 0 ; ++k ) { if(k==0) { rv = jack_connect( _client, jack_port_name(_port[0]), ports[k] ); } else if (k==1) { rv = jack_connect( _client, jack_port_name(_port[1]), ports[k] ); } else { break; } if( rv && err_msg ) { *err_msg = "Could not connect output ports"; } } if(k==0 && err_msg) { *err_msg = "There were no output ports to connect to."; rv = 1; } if(ports) { free(ports); } return rv; } int JackAudioSystem::deactivate(QString *err_msg) { int rv = 0; if(_client) { rv = jack_deactivate(_client); } return rv; } AudioSystem::sample_t* JackAudioSystem::output_buffer(int index) { jack_nframes_t nframes = output_buffer_size(index); if(index == 0) { assert(_port[0]); return static_cast( jack_port_get_buffer(_port[0], nframes) ); }else if(index == 1) { assert(_port[1]); return static_cast( jack_port_get_buffer(_port[1], nframes) ); } return 0; } uint32_t JackAudioSystem::output_buffer_size(int /*index*/) { if( !_client ) return 0; return jack_get_buffer_size(_client); } uint32_t JackAudioSystem::sample_rate() { if( !_client ) return 0; return jack_get_sample_rate(_client); } float JackAudioSystem::dsp_load() { if( !_client ) return -1; return jack_cpu_load(_client)/100.0; } } // namespace StretchPlayer stretchplayer-0.503/src/JackAudioSystem.hpp000066400000000000000000000035401142050324400207460ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef JACKAUDIOSYSTEM_HPP #define JACKAUDIOSYSTEM_HPP #include #include namespace StretchPlayer { /** * \brief Pure virtual interface to an audio driver API. * * This AudioSystem assumes a very simple system with two audio * outputs. It maintains those ports and buffers and the * connection of them. */ class JackAudioSystem : public AudioSystem { public: JackAudioSystem(); virtual ~JackAudioSystem(); /* Implementing all of AudioSystem's interface: */ virtual int init(QString * app_name, QString *err_msg = 0); virtual void cleanup(); virtual int set_process_callback(process_callback_t cb, void* arg, QString* err_msg = 0); virtual int activate(QString *err_msg = 0); virtual int deactivate(QString *err_msg = 0); virtual sample_t* output_buffer(int index); virtual uint32_t output_buffer_size(int index); virtual uint32_t sample_rate(); virtual float dsp_load(); private: jack_client_t *_client; jack_port_t* _port[2]; }; } // namespace StretchPlayer #endif // AUDIOSYSTEM_HPP stretchplayer-0.503/src/Marquee.cpp000066400000000000000000000102461142050324400173020ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "Marquee.hpp" #include #include #include namespace StretchPlayer { namespace Widgets { Marquee::Marquee(QWidget* parent) : QWidget(parent), _pos(0), _incr(5), _show_temporary(0), _show_temporary_first(3) { _scroll_timer.setInterval(42); _scroll_timer.setSingleShot(false); _wait_timer.setInterval(1500); _wait_timer.setSingleShot(true); connect( &_scroll_timer, SIGNAL(timeout()), this, SLOT(_scroll_incr()) ); connect( &_wait_timer, SIGNAL(timeout()), this, SLOT(_wait_over()) ); _draw_text(""); _scroll = false; } Marquee::~Marquee() { _scroll_timer.stop(); _wait_timer.stop(); } void Marquee::set_font(const QFont& font) { _font = font; } void Marquee::set_temporary(QString txt) { _scroll_timer.stop(); _temporary = txt; _show_temporary = _show_temporary_first; _draw_text(txt); _wait_timer.start(); } void Marquee::set_permanent(QString txt) { _permanent = txt; if(_show_temporary == 0) { _draw_text(txt); } } void Marquee::_scroll_incr() { _pos += _incr; if(_pos > _canvas->width()) { _scroll_timer.stop(); _pos = 0; _wait_timer.start(1500); } } void Marquee::_wait_over() { if( _show_temporary == 1 ) { _draw_text(_permanent); _pos = 0; _show_temporary = 0; } else if( _show_temporary > 0 ) { --_show_temporary; } if(_scroll == false) { _draw_text(_permanent); _pos = 0; _show_temporary = 0; return; } else { _scroll_timer.start(); } } void Marquee::_draw_text(const QString& txt) { QFontMetrics fm(_font); QSize size = fm.size(0, txt); int w = size.width(); int h = height(); _incr = fm.maxWidth() / 8; if( _incr <= 0 ) _incr = 1; if( width() > w ) { w = width(); _scroll = false; _scroll_timer.stop(); _wait_timer.start(3000); _pos = 0; } else { // w = w _scroll = true; _scroll_timer.stop(); _wait_timer.start(1500); _pos = 0; } _canvas.reset(new QPixmap(w*6/5, h) ); QPainter painter(_canvas.get()); painter.setBrush( palette().color(QPalette::Active, QPalette::Window) ); painter.setPen( palette().color(QPalette::Active, QPalette::Window) ); painter.drawRect( 0, 0, _canvas->width(), _canvas->height() ); painter.setBrush( palette().color(QPalette::Active, QPalette::WindowText) ); painter.setPen( palette().color(QPalette::Active, QPalette::WindowText) ); painter.setFont(_font); painter.drawText( 0, 0, w, h, Qt::TextSingleLine, txt ); } void Marquee::resizeEvent(QResizeEvent * /*event*/) { if( _show_temporary > 0 ) { _draw_text( _temporary ); } else { _draw_text( _permanent ); } if( _pos > _canvas->width() ) _pos = 0; } void Marquee::paintEvent(QPaintEvent * /*event*/) { QRect viewport(0, 0, width(), height()); QRect target; viewport.translate(_pos, 0); int clipped = 0; if( viewport.right() > _canvas->width() ) { clipped = viewport.right() - _canvas->width(); viewport.setRight( _canvas->width() ); } target = viewport; target.moveTo(0, 0); QPainter painter(this); painter.drawPixmap(target, *_canvas, viewport); if(clipped) { viewport.setRect(0, 0, clipped, height()); target.translate( target.width(), 0 ); target.setWidth( clipped ); painter.drawPixmap(target, *_canvas, viewport); } } } // namespace Widgets } // namespace StretchPlayer stretchplayer-0.503/src/Marquee.hpp000066400000000000000000000033461142050324400173120ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef MARQUEE_HPP #define MARQUEE_HPP #include #include #include #include #include class QImage; namespace StretchPlayer { namespace Widgets { class Marquee : public QWidget { Q_OBJECT public: Marquee(QWidget* parent = 0); virtual ~Marquee(); void set_font(const QFont& font); public slots: void set_temporary(QString); void set_permanent(QString); private: virtual void resizeEvent(QResizeEvent *event); virtual void paintEvent(QPaintEvent *event); private slots: void _scroll_incr(); void _wait_over(); private: void _draw_text(const QString& txt); private: QString _temporary; QString _permanent; std::auto_ptr _canvas; QTimer _scroll_timer; bool _scroll; QTimer _wait_timer; int _pos; int _incr; int _show_temporary; const int _show_temporary_first; QFont _font; }; } // namespace Widgets } // namespace StretchPlayer #endif // MARQUEE_HPP stretchplayer-0.503/src/PlayerSizes.cpp000066400000000000000000000054021142050324400201530ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "PlayerSizes.hpp" #include namespace StretchPlayer { PlayerSizes::PlayerSizes() : _scale(1.0), _grid(.25), _text(.125), _ppi(120.0), _width(470.0), _height(180.0) { } PlayerSizes::~PlayerSizes() { } float PlayerSizes::scale() { return _scale; } void PlayerSizes::scale(float val) { if( val < .1 ) { _scale = .1; } else { _scale = val; } } void PlayerSizes::set_scale_from(float width, float height) { float aspect = _height/_width; float w_aspect = height/width; if( w_aspect > aspect ) { _scale = width/_width; } else { _scale = height/_height; } } float PlayerSizes::ppi_setting() { return _ppi; } void PlayerSizes::ppi_setting(float val) { if( val < 60 ) { _ppi = 60; } else { _ppi = val; } } float PlayerSizes::preferred_width() { return _width; } float PlayerSizes::preferred_height() { return _height; } int PlayerSizes::height_for_width(int w) { return int( 0.5 + (w * _height / _width) ); } int PlayerSizes::width() { return int( 0.5 + (_width * _scale) ); } int PlayerSizes::height() { return int( 0.5 + (_height * _scale) ); } float PlayerSizes::widget_grid_size() { return _grid * _ppi * _scale; } void PlayerSizes::widget_grid_size(float inches) { if( inches < .09 ) { _grid = .09; } else { _grid = inches; } } float PlayerSizes::text_size() { return _text * _ppi * _scale; } void PlayerSizes::text_size(float inches) { if( inches < .06 ) { _text = .03; } else { _text = inches; } } float PlayerSizes::thicker_line() { return line() * 2.0; } float PlayerSizes::thick_line() { return line() * 1.5; } float PlayerSizes::line() { return widget_grid_size() / 16.0; } float PlayerSizes::thin_line() { return line() / 2.0; } } // namespace StretchPlayer stretchplayer-0.503/src/PlayerSizes.hpp000066400000000000000000000035221142050324400201610ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef PLAYERSIZES_HPP #define PLAYERSIZES_HPP namespace StretchPlayer { /** * \brief Class that manages basic widget sizes. */ class PlayerSizes { public: float scale(); void scale(float val); void set_scale_from(float width, float height); float ppi_setting(); void ppi_setting(float val); float preferred_width(); float preferred_height(); int width(); int height(); int height_for_width(int w); /** * Returns number of pixels for grid size. */ float widget_grid_size(); void widget_grid_size(float inches); float text_size(); void text_size(float inches_tall); float thicker_line(); float thick_line(); float line(); float thin_line(); private: float _scale; //< Raw scaling factor float _grid; //< inches float _text; //< inches, tall float _ppi; //< pixels per inch float _width; // < preferred, pixels float _height; // < preferred, pixels public: PlayerSizes(); ~PlayerSizes(); }; } // namespace StretchPlayer #endif // PLAYERSIZES_HPP stretchplayer-0.503/src/PlayerWidget.cpp000066400000000000000000000456511142050324400203130ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "PlayerWidget.hpp" #include "Engine.hpp" #include "StatusWidget.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" namespace StretchPlayer { namespace Details { class PlayerWidgetMessageCallback : public EngineMessageCallback { public: PlayerWidgetMessageCallback(PlayerWidget* w) : _widget(w) {} virtual ~PlayerWidgetMessageCallback() {} virtual void operator()(const QString& msg) { _widget->status_message(msg); QCoreApplication::processEvents(); } private: PlayerWidget* _widget; }; } PlayerWidget::PlayerWidget(QWidget *parent) : QMainWindow(parent) { setWindowFlags( Qt::Window | Qt::FramelessWindowHint ); #if (QT_VERSION >= 0x040500) && STRETCHPLAYER_USE_COMPOSITING #warning "Compositing is enabled" setAttribute( Qt::WA_TranslucentBackground ); _compositing = true; #else #warning "Compositing is dis-abled" _compositing = false; #endif setMinimumSize(_sizes.preferred_width()*2/3, _sizes.preferred_height()*2/3); QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Fixed); policy.setHeightForWidth(true); setSizePolicy(policy); setMouseTracking(true); resize(_sizes.preferred_width(), _sizes.preferred_height()); _setup_color_scheme(0); _load_icons(); _setup_actions(); _setup_widgets(); _setup_signals_and_slots(); _layout_widgets(); } PlayerWidget::~PlayerWidget() { } void PlayerWidget::load_song(const QString& filename) { QString name = _engine->load_song(filename); if(name.isEmpty()) { _status->song_name("No song loaded."); } else { _status->song_name(name); } } int PlayerWidget::heightForWidth(int w) { return _sizes.height_for_width(w); } void PlayerWidget::play_pause() { _engine->play_pause(); } void PlayerWidget::stop() { _engine->stop(); _engine->locate(0); } void PlayerWidget::ab() { _engine->loop_ab(); } void PlayerWidget::open_file() { _engine->stop(); QString filename = QFileDialog::getOpenFileName( this, "Open song file..." ); if( ! filename.isNull() ) { load_song(filename); } } void PlayerWidget::status_message(const QString& msg) { _status->message(msg); } void PlayerWidget::locate(float pos) { _engine->locate(pos * _engine->get_length()); } void PlayerWidget::pitch_inc() { _engine->set_pitch( _engine->get_pitch() + 1 ); } void PlayerWidget::pitch_dec() { _engine->set_pitch( _engine->get_pitch() - 1); } void PlayerWidget::speed_inc() { _engine->set_stretch( _engine->get_stretch() + .05 ); } void PlayerWidget::speed_dec() { _engine->set_stretch( _engine->get_stretch() - .05 ); } void PlayerWidget::volume_inc() { float gain = _from_fader(_volume->value() + 50); _engine->set_volume( gain ); } void PlayerWidget::volume_dec() { float gain = _from_fader(_volume->value() - 50); _engine->set_volume( gain ); } void PlayerWidget::stretch(int pos) { _engine->set_stretch( 0.5 + double(pos)/1000.0 ); } void PlayerWidget::volume(int vol) { _engine->set_volume( _from_fader(vol) ); } /** * "Traditional" fader mapping */ float PlayerWidget::_from_fader(int p_val) { float fader = float(p_val)/1000.0f; float gain; float db; if(fader == 0) { gain = 0.0f; } else if(fader < .04) { gain = fader * 1e-6f / .04f; } else if(fader < .16) { db = -60.0 + 20.0f * (fader-.04) / .12f; gain = exp10(db/10.0); } else if(fader < .52) { db = -40.0 + 10.0f * (fader-.16) / .12f; gain = exp10(db/10.0); } else { db = -10.0 + 15.0f * (fader-.52) / .48f; gain = exp10(db/10.0); } return gain; } /** * "Traditional" fader mapping */ int PlayerWidget::_to_fader(float gain) { if(gain == 0.0f) return 0; float fader; float db = 10.0 * log10(gain); if(db < -60.0) { fader = gain * .04f / 1e-6f; } else if(db < -40.0) { fader = .04f + ((db + 60.0f) * .12f / 20.0f); } else if(db < -10.0) { fader = .16f + ((db + 40.0f) * .12f / 10.0f); } else { fader = .52f + ((db + 10.0f) * .48f / 15.0f); } if( fader > 1.0 ) fader = 1.0f; return ::round(fader * 1000.0); } void PlayerWidget::reset() { stop(); _engine->set_pitch(0); _engine->set_stretch(1.0); } void PlayerWidget::update_time() { float pos = _engine->get_position(); _status->time(pos); float len = _engine->get_length(); _status->position(pos/len); float sch = _engine->get_stretch(); _status->speed(sch); int pit = _engine->get_pitch(); _status->pitch(pit); float cpu = _engine->get_cpu_load(); _status->cpu(cpu); float vol = _engine->get_volume(); _volume->setValue( _to_fader(vol) ); _status->volume( _volume->value() / 1000.0 ); _stretch->setValue( (sch-0.5) * 1000 ); _status->update(); } void PlayerWidget::resizeEvent(QResizeEvent * /*event*/) { _sizes.set_scale_from(width(), height()); _layout_widgets(); } void PlayerWidget::paintEvent(QPaintEvent * event) { QPainter painter(this); painter.setRenderHints(QPainter::Antialiasing); const QPalette& pal = palette(); float thickline = _sizes.thicker_line(); float border_rad = thickline * 4.0; float w = width(); float h = height(); if(_compositing) { QImage mask_img(width(), height(), QImage::Format_Mono); mask_img.fill(0xff); QPainter mask_ptr(&mask_img); mask_ptr.setBrush( QBrush( QColor(0, 0, 0) ) ); mask_ptr.drawRoundedRect( QRectF( 0, 0, w, h), border_rad+thickline/2.0, border_rad+thickline/2.0 ); QBitmap bmp = QBitmap::fromImage(mask_img); setMask( bmp ); } QBrush bg_brush( pal.color(QPalette::Active, QPalette::Window) ); QPen border_pen( pal.color(QPalette::Active, QPalette::Dark) ); border_pen.setWidthF(thickline); border_pen.setJoinStyle(Qt::RoundJoin); painter.setPen(border_pen); QRectF bg_rect = QRectF( thickline/2.0, thickline/2.0, w-thickline, h-thickline ); if(!_compositing) { painter.setBrush( pal.color(QPalette::Active, QPalette::Dark) ); painter.drawRect( 0, 0, width(), height() ); } painter.setBrush(bg_brush); painter.drawRoundedRect( bg_rect, border_rad, border_rad ); QWidget::paintEvent(event); } void PlayerWidget::mousePressEvent(QMouseEvent *event) { if(event->button() & Qt::LeftButton) { Qt::CursorShape cur = cursor().shape(); switch(cur) { case Qt::SizeAllCursor: _anchor = event->globalPos(); case Qt::SizeHorCursor: case Qt::SizeVerCursor: case Qt::SizeFDiagCursor: case Qt::SizeBDiagCursor: event->accept(); _drag_resize(cur, event); break; default: event->ignore(); } } else { event->ignore(); } } void PlayerWidget::mouseMoveEvent(QMouseEvent *event) { Qt::CursorShape cur = cursor().shape(); Qt::CursorShape loc = _which_cursor(event->pos()); if( (event->buttons() & Qt::LeftButton) && (cur != Qt::ArrowCursor) ) { _drag_resize(cur, event); } else if( cur != loc ) { event->accept(); QCursor new_cur(loc); setCursor(new_cur); } else { event->ignore(); } } void PlayerWidget::_setup_color_scheme(int profile) { QPalette p; QColor base, bright, light, mid, dark; switch(profile) { // case 0: // default case 1: // Blue bright.setRgb(0xff, 0xff, 0xff, 0xff); // white light.setRgb(0x76, 0xc6, 0xf5, 0xff); // light blue mid.setRgb(68, 141, 189, 0xff); // average dark.setRgb(0x12, 0x55, 0x85, 0xff); // dark blue base = light; break; default: // Yellow bright.setRgb(0xff, 0xff, 0xff, 0xff); //white light.setRgb(0xe5, 0xd7, 0x3a, 0xff); // yellow mid.setRgb(114, 107, 29, 0xff); // average dark.setRgb(0, 0, 0, 0xff); // black base = light; } p.setColorGroup(QPalette::Active, dark, // Window Text light, // button light, // light dark, // dark mid, // mid dark, // text bright, // bright text base, // base light // window ); setPalette(p); } void PlayerWidget::_load_icons() { _ico.play.addFile(":img/play.png"); _ico.stop.addFile(":img/stop.png"); _ico.ab.addFile(":img/ab.png"); _ico.help.addFile(":img/help.png"); _ico.quit.addFile(":img/quit.png"); _ico.plus.addFile(":img/plus.png"); _ico.minus.addFile(":img/minus.png"); _ico.open.addFile(":img/file.png"); } void PlayerWidget::_setup_actions() { memset(&_act, 0, sizeof(_act)); _act.play_pause = new QAction("P", this); _act.play_pause->setToolTip("Play/Pause [Space]"); _act.play_pause->setShortcut(Qt::Key_Space); _act.play_pause->setShortcutContext(Qt::ApplicationShortcut); _act.play_pause->setIcon( _ico.play ); addAction(_act.play_pause); connect(_act.play_pause, SIGNAL(triggered()), this, SLOT(play_pause())); _act.stop = new QAction("S", this); _act.stop->setToolTip("Stop [S]"); _act.stop->setShortcut(Qt::Key_S); _act.stop->setShortcutContext(Qt::ApplicationShortcut); _act.stop->setIcon( _ico.stop ); addAction(_act.stop); connect(_act.stop, SIGNAL(triggered()), this, SLOT(stop())); QList ab_shortcuts; ab_shortcuts << Qt::Key_Enter; ab_shortcuts << Qt::Key_Return; _act.ab = new QAction("AB", this); _act.ab->setToolTip("AB Repeat [Enter]"); _act.ab->setShortcuts(ab_shortcuts); _act.ab->setShortcutContext(Qt::ApplicationShortcut); _act.ab->setIcon( _ico.ab ); addAction(_act.ab); connect(_act.ab, SIGNAL(triggered()), this, SLOT(ab())); _act.open = new QAction("O", this); _act.open->setToolTip("Open [O]"); _act.open->setShortcut(Qt::Key_O); _act.open->setShortcutContext(Qt::ApplicationShortcut); _act.open->setIcon( _ico.open ); addAction(_act.open); connect(_act.open, SIGNAL(triggered()), this, SLOT(open_file())); _act.quit = new QAction("X", this); _act.quit->setToolTip("Quit [Esc]"); _act.quit->setShortcut(Qt::Key_Escape); _act.quit->setShortcutContext(Qt::ApplicationShortcut); _act.quit->setIcon( _ico.quit ); addAction(_act.quit); connect(_act.quit, SIGNAL(triggered()), this, SLOT(close())); QList inc_shortcuts; inc_shortcuts << Qt::Key_Plus; inc_shortcuts << Qt::Key_Equal; _act.pitch_inc = new QAction("+", this); _act.pitch_inc->setToolTip("Pitch Increase [+]"); _act.pitch_inc->setShortcuts(inc_shortcuts); _act.pitch_inc->setShortcutContext(Qt::ApplicationShortcut); _act.pitch_inc->setIcon( _ico.plus ); addAction(_act.pitch_inc); connect(_act.pitch_inc, SIGNAL(triggered()), this, SLOT(pitch_inc())); _act.pitch_dec = new QAction("-", this); _act.pitch_dec->setToolTip("Pitch Decrease [-]"); _act.pitch_dec->setShortcut(Qt::Key_Minus); _act.pitch_dec->setShortcutContext(Qt::ApplicationShortcut); _act.pitch_dec->setIcon( _ico.minus ); addAction(_act.pitch_dec); connect(_act.pitch_dec, SIGNAL(triggered()), this, SLOT(pitch_dec())); _act.speed_inc = new QAction("Faster", this); _act.speed_inc->setToolTip("Play faster [Right Arrow]"); _act.speed_inc->setShortcut(Qt::Key_Right); _act.speed_inc->setShortcutContext(Qt::ApplicationShortcut); addAction(_act.speed_inc); connect(_act.speed_inc, SIGNAL(triggered()), this, SLOT(speed_inc())); _act.speed_dec = new QAction("Slower", this); _act.speed_dec->setToolTip("Play slower [Left Arrow]"); _act.speed_dec->setShortcut(Qt::Key_Left); _act.speed_dec->setShortcutContext(Qt::ApplicationShortcut); addAction(_act.speed_dec); connect(_act.speed_dec, SIGNAL(triggered()), this, SLOT(speed_dec())); _act.vol_inc = new QAction("Louder", this); _act.vol_inc->setToolTip("Louder [Up]"); _act.vol_inc->setShortcut(Qt::Key_Up); _act.vol_inc->setShortcutContext(Qt::ApplicationShortcut); addAction(_act.vol_inc); connect(_act.vol_inc, SIGNAL(triggered()), this, SLOT(volume_inc())); _act.vol_dec = new QAction("Louder", this); _act.vol_dec->setToolTip("Quieter [Down]"); _act.vol_dec->setShortcut(Qt::Key_Down); _act.vol_dec->setShortcutContext(Qt::ApplicationShortcut); addAction(_act.vol_dec); connect(_act.vol_dec, SIGNAL(triggered()), this, SLOT(volume_dec())); _act.reset = new QAction("Reset", this); _act.reset->setToolTip("Reset all settings [Home]"); _act.reset->setShortcut(Qt::Key_Home); _act.reset->setShortcutContext(Qt::ApplicationShortcut); addAction(_act.reset); connect(_act.reset, SIGNAL(triggered()), this, SLOT(reset())); } void PlayerWidget::_setup_widgets() { _btn.play = new QToolButton(this); _btn.play->setDefaultAction(_act.play_pause); _btn.play->setAutoRaise(true); _btn.play->setContentsMargins(0, 0, 0, 0); _btn.play->setMaximumSize(256, 256); _btn.stop = new QToolButton(this); _btn.stop->setDefaultAction(_act.stop); _btn.stop->setAutoRaise(true); _btn.stop->setContentsMargins(0, 0, 0, 0); _btn.ab = new QToolButton(this); _btn.ab->setDefaultAction(_act.ab); _btn.ab->setAutoRaise(true); _btn.ab->setContentsMargins(0, 0, 0, 0); _btn.open = new QToolButton(this); _btn.open->setDefaultAction(_act.open); _btn.open->setAutoRaise(true); _btn.open->setContentsMargins(0, 0, 0, 0); _btn.quit = new QToolButton(this); _btn.quit->setDefaultAction(_act.quit); _btn.quit->setAutoRaise(true); _btn.quit->setContentsMargins(0, 0, 0, 0); _btn.pitch_inc = new QToolButton(this); _btn.pitch_inc->setDefaultAction(_act.pitch_inc); _btn.pitch_inc->setAutoRaise(true); _btn.pitch_dec = new QToolButton(this); _btn.pitch_dec->setDefaultAction(_act.pitch_dec); _btn.pitch_dec->setAutoRaise(true); _status = new StatusWidget(this, &_sizes); _stretch = new QSlider(Qt::Horizontal, this); _stretch->setMinimum(0); _stretch->setMaximum(1000); _stretch->setToolTip("Playback Speed [Left/Right Arrow]"); _volume = new QSlider(Qt::Vertical, this); _volume->setMinimum(0); _volume->setMaximum(1000); _volume->setToolTip("Volume [Up/Down]"); } void PlayerWidget::_layout_widgets() { int h, w; int margin; int grid; h = height(); w = width(); grid = _sizes.widget_grid_size() + .5; margin = _margin(); QSize grid_size(grid, grid); int n_ctrl_btns = 6; int btn_y = h - margin - grid; int btn_x = margin; // CONTROL BAR (BOTTOM) _btn.play->setIconSize(grid_size); _btn.play->setGeometry( btn_x, btn_y, grid, grid ); btn_x += grid; _btn.stop->setIconSize(grid_size); _btn.stop->setGeometry( btn_x, btn_y, grid, grid ); btn_x += grid; _btn.ab->setIconSize(grid_size); _btn.ab->setGeometry( btn_x, btn_y, grid, grid ); btn_x += grid; _stretch->setGeometry( btn_x, btn_y, w - 2*margin - n_ctrl_btns*grid, grid ); btn_x += _stretch->width(); _btn.pitch_dec->setIconSize(grid_size); _btn.pitch_dec->setGeometry( btn_x, btn_y, grid, grid ); btn_x += grid; _btn.pitch_inc->setIconSize(grid_size); _btn.pitch_inc->setGeometry( btn_x, btn_y, grid, grid ); btn_x += grid; _btn.open->setIconSize(grid_size); _btn.open->setGeometry( btn_x, btn_y, grid, grid ); btn_x += grid; // STATUS AND VERT CONTROLS _status->setGeometry( margin, margin, w - 2*margin - margin/2 - grid, h - 2*margin - margin/2 - grid ); _btn.quit->setIconSize(grid_size); _btn.quit->setGeometry( w - margin - grid, margin, grid, grid ); _volume->setGeometry( w - margin - grid, margin + grid, grid, h - 2*margin - 2*grid ); } void PlayerWidget::_setup_signals_and_slots() { _engine_callback.reset(new Details::PlayerWidgetMessageCallback(this)); _engine.reset(new Engine); _engine->subscribe_errors(_engine_callback.get()); _engine->subscribe_messages(_engine_callback.get()); connect(_stretch, SIGNAL(sliderMoved(int)), this, SLOT(stretch(int))); connect(_status, SIGNAL(locate(float)), this, SLOT(locate(float))); connect(_volume, SIGNAL(sliderMoved(int)), this, SLOT(volume(int))); QTimer* timer = new QTimer(this); timer->setSingleShot(false); timer->setInterval(200); connect(timer, SIGNAL(timeout()), this, SLOT(update_time())); timer->start(); } float PlayerWidget::_margin() { return _sizes.thicker_line() * 3.0; } /** * \selects correct cursor. * * Along left and top edges: move window. * Along bottom and right edges: resize window. * */ Qt::CursorShape PlayerWidget::_which_cursor(const QPoint& pos) { bool left = false; bool right = false; bool top = false; bool bottom = false; Qt::CursorShape rv = Qt::ArrowCursor; int margin = _sizes.thicker_line() * 3 / 2; if( pos.x() <= margin ) left = true; if( pos.x() >= width()-margin ) right = true; if( pos.y() <= margin ) top = true; if( pos.y() >= height()-margin ) bottom = true; // Check for corners int rad = 2*margin; if( pos.x() <= rad ) { if( pos.y() <= rad ) { left = true; top = true; } else if( pos.y() >= height()-rad ) { left = true; bottom = true; } } else if( pos.x() >= width()-rad ) { if( pos.y() <= rad ) { right = true; top = true; } else if( pos.y() >= height()-rad ) { right = true; bottom = true; } } if( left ) { rv = Qt::SizeAllCursor; } else if( right ) { if( top ) { rv = Qt::SizeAllCursor; } else if(bottom) { rv = Qt::SizeFDiagCursor; } else { rv = Qt::SizeHorCursor; } } else if( top ) { rv = Qt::SizeAllCursor; } else if( bottom ) { rv = Qt::SizeVerCursor; } return rv; } /** * Evokes resize events based on cursor type. * * Note the assumptions made with _which_cursor(); */ void PlayerWidget::_drag_resize(Qt::CursorShape cur, QMouseEvent* ev) { QRect win(pos().x(), pos().y(), width(), height()); QPoint gps = ev->globalPos(); switch(cur) { case Qt::SizeAllCursor: win.translate(gps - _anchor); _anchor = gps; break; case Qt::SizeHorCursor: // Right edge win.setRight( gps.x() ); break; case Qt::SizeVerCursor: win.setBottom( gps.y() ); break; case Qt::SizeFDiagCursor: win.setBottomRight( gps ); break; case Qt::SizeBDiagCursor: // Not used break; default: break; } setGeometry(win); } } // namespace StretchPlayer stretchplayer-0.503/src/PlayerWidget.hpp000066400000000000000000000065761142050324400203230ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef PLAYERWIDGET_HPP #define PLAYERWIDGET_HPP #include #include #include #include "PlayerSizes.hpp" class QToolButton; class QLabel; class QVBoxLayout; class QHBoxLayout; class QSlider; class QSpinBox; class QPaintEvent; class QStyle; namespace StretchPlayer { class Engine; class EngineMessageCallback; class StatusWidget; class PlayerWidget : public QMainWindow { Q_OBJECT public: PlayerWidget(QWidget *parent = 0); ~PlayerWidget(); void load_song(const QString& filename); virtual int heightForWidth(int w); public slots: void play_pause(); void stop(); void ab(); void open_file(); void update_time(); void locate(float); // [0.0, 1.0] void stretch(int); void volume(int); void pitch_inc(); void pitch_dec(); void speed_inc(); void speed_dec(); void volume_inc(); void volume_dec(); void status_message(const QString&); void reset(); protected: virtual void resizeEvent(QResizeEvent* event); virtual void paintEvent(QPaintEvent* event); virtual void mousePressEvent(QMouseEvent* event); virtual void mouseMoveEvent(QMouseEvent* event); //virtual void mouseReleaseEvent(QMouseEvent* event); private: void _setup_color_scheme(int profile); void _load_icons(); void _setup_actions(); void _setup_widgets(); void _layout_widgets(); void _setup_signals_and_slots(); Qt::CursorShape _which_cursor(const QPoint& pos); void _drag_resize(Qt::CursorShape cur, QMouseEvent* event); // Encode/decode volume fader float _from_fader(int val); int _to_fader(float val); float _margin(); private: struct icons_t { QIcon play; QIcon stop; QIcon ab; QIcon help; QIcon quit; QIcon plus; QIcon minus; QIcon open; } _ico; struct actions_t { QAction *play_pause; QAction *stop; QAction *ab; QAction *open; QAction *quit; QAction *pitch_inc; QAction *pitch_dec; QAction *speed_inc; QAction *speed_dec; QAction *vol_inc; QAction *vol_dec; QAction *reset; } _act; struct buttons_t { QToolButton *play; QToolButton *stop; QToolButton *ab; QToolButton *open; QToolButton *quit; QToolButton *pitch_inc; QToolButton *pitch_dec; } _btn; // Misc widgets QStyle *_style; StatusWidget *_status; QSlider *_stretch; QSlider *_volume; PlayerSizes _sizes; std::auto_ptr _engine; std::auto_ptr _engine_callback; // State variables QPoint _anchor; // for window moves bool _compositing; }; // PlayerWidget } // namespace StretchPlayer #endif // PLAYERWIDGET_HPP stretchplayer-0.503/src/RingBuffer.hpp000066400000000000000000000147031142050324400177430ustar00rootroot00000000000000/* Copyright (C) 2000 Paul Davis & Benno Senoner 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* This file came from the Ardour sources, SVN Rev 3435 2008-06-02. Changed file name and added Tritium namespaces and include guards. - Gabriel Beddingfield 2009-04-17, 2009-11-25 */ #ifndef TRITIUM_RINGBUFFER_HPP #define TRITIUM_RINGBUFFER_HPP #include #include namespace Tritium { template class RingBuffer { public: RingBuffer (guint sz) { // size = ffs(sz); /* find first [bit] set is a single inlined assembly instruction. But it looks like the API rounds up so... */ guint power_of_two; for (power_of_two = 1; 1U< r) { return ((r - w + size) & size_mask) - 1; } else if (w < r) { return (r - w) - 1; } else { return size - 1; } } guint read_space () { guint w, r; w = g_atomic_int_get (&write_idx); r = g_atomic_int_get (&read_idx); if (w > r) { return w - r; } else { return (w - r + size) & size_mask; } } T *buffer () { return buf; } guint get_write_idx () const { return g_atomic_int_get (&write_idx); } guint get_read_idx () const { return g_atomic_int_get (&read_idx); } guint bufsize () const { return size; } protected: T *buf; guint size; mutable gint write_idx; mutable gint read_idx; guint size_mask; }; template guint RingBuffer::read (T *dest, guint cnt) { guint free_cnt; guint cnt2; guint to_read; guint n1, n2; guint priv_read_idx; priv_read_idx=g_atomic_int_get(&read_idx); if ((free_cnt = read_space ()) == 0) { return 0; } to_read = cnt > free_cnt ? free_cnt : cnt; cnt2 = priv_read_idx + to_read; if (cnt2 > size) { n1 = size - priv_read_idx; n2 = cnt2 & size_mask; } else { n1 = to_read; n2 = 0; } memcpy (dest, &buf[priv_read_idx], n1 * sizeof (T)); priv_read_idx = (priv_read_idx + n1) & size_mask; if (n2) { memcpy (dest+n1, buf, n2 * sizeof (T)); priv_read_idx = n2; } g_atomic_int_set(&read_idx, priv_read_idx); return to_read; } template guint RingBuffer::write (T *src, guint cnt) { guint free_cnt; guint cnt2; guint to_write; guint n1, n2; guint priv_write_idx; priv_write_idx=g_atomic_int_get(&write_idx); if ((free_cnt = write_space ()) == 0) { return 0; } to_write = cnt > free_cnt ? free_cnt : cnt; cnt2 = priv_write_idx + to_write; if (cnt2 > size) { n1 = size - priv_write_idx; n2 = cnt2 & size_mask; } else { n1 = to_write; n2 = 0; } memcpy (&buf[priv_write_idx], src, n1 * sizeof (T)); priv_write_idx = (priv_write_idx + n1) & size_mask; if (n2) { memcpy (buf, src+n1, n2 * sizeof (T)); priv_write_idx = n2; } g_atomic_int_set(&write_idx, priv_write_idx); return to_write; } template void RingBuffer::get_read_vector (RingBuffer::rw_vector *vec) { guint free_cnt; guint cnt2; guint w, r; w = g_atomic_int_get (&write_idx); r = g_atomic_int_get (&read_idx); if (w > r) { free_cnt = w - r; } else { free_cnt = (w - r + size) & size_mask; } cnt2 = r + free_cnt; if (cnt2 > size) { /* Two part vector: the rest of the buffer after the current write ptr, plus some from the start of the buffer. */ vec->buf[0] = &buf[r]; vec->len[0] = size - r; vec->buf[1] = buf; vec->len[1] = cnt2 & size_mask; } else { /* Single part vector: just the rest of the buffer */ vec->buf[0] = &buf[r]; vec->len[0] = free_cnt; vec->len[1] = 0; } } template void RingBuffer::get_write_vector (RingBuffer::rw_vector *vec) { guint free_cnt; guint cnt2; guint w, r; w = g_atomic_int_get (&write_idx); r = g_atomic_int_get (&read_idx); if (w > r) { free_cnt = ((r - w + size) & size_mask) - 1; } else if (w < r) { free_cnt = (r - w) - 1; } else { free_cnt = size - 1; } cnt2 = w + free_cnt; if (cnt2 > size) { /* Two part vector: the rest of the buffer after the current write ptr, plus some from the start of the buffer. */ vec->buf[0] = &buf[w]; vec->len[0] = size - w; vec->buf[1] = buf; vec->len[1] = cnt2 & size_mask; } else { vec->buf[0] = &buf[w]; vec->len[0] = free_cnt; vec->len[1] = 0; } } } // namespace Tritium #endif // TRITIUM_RINGBUFFER_HPP stretchplayer-0.503/src/StatusWidget.cpp000066400000000000000000000156451142050324400203420ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "StatusWidget.hpp" #include "ThinSlider.hpp" #include "PlayerSizes.hpp" #include "Marquee.hpp" #include #include #include #include #include #include #include #include #include #include #include #include namespace StretchPlayer { StatusWidget::StatusWidget(QWidget *parent, PlayerSizes *sizes) : QWidget(parent), _sizes(sizes) { // Using REVERSE colors of parent. _update_palette(); _position = new Widgets::ThinSlider(this); _position->setMinimum(0); _position->setMaximum(1000); _position->setOrientation(Qt::Horizontal); _message = new Widgets::Marquee(this); _message->set_permanent("No file loaded."); QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred); setSizePolicy(policy); connect(_position, SIGNAL(sliderMoved(int)), this, SLOT(_changing_position(int))); } StatusWidget::~StatusWidget() { } void StatusWidget::position(float pos) { _position->setValue( pos * 1000.0 ); } void StatusWidget::time(float time) { int min = (int)(time/60.0); float sec = time - min*60.0; _time = QString("%1:%2") .arg(int(min), 2, 10, QChar('0')) .arg(double(sec), 4, 'f', 1, QChar('0')); } void StatusWidget::speed(float val) { val *= 100.0; _speed = QString("SPEED: %1%") .arg(val, 3, 'f', 0); } void StatusWidget::pitch(int p) { _pitch = QString("PITCH: %1") .arg(int(p)); } void StatusWidget::volume(float g) { g *= 100.0; _volume = QString("VOL: %1%") .arg(g, 3, 'f', 0, ' '); } void StatusWidget::cpu(float c) { c *= 100.0; _cpu = QString("CPU: %1%") .arg(c, 3, 'f', 0, ' '); } void StatusWidget::message(QString msg) { _message->set_temporary( msg ); } void StatusWidget::song_name(QString msg) { _message->set_permanent( msg ); } void StatusWidget::_changing_position(int pos) { float p = float(pos) / 1000.0; emit locate(p); } void StatusWidget::resizeEvent(QResizeEvent * /*event*/) { float w, h, margin, radius; w = width(); h = height(); radius = _sizes->thicker_line() * 2.0; margin = radius; _bg_zone.setRect( 0, 0, w, h ); _position->set_line_widths( _sizes->thin_line(), _sizes->thicker_line() ); QSize pos_sz = _position->sizeHint(); _position->setGeometry( margin, h - margin - pos_sz.height(), w - 2*margin, pos_sz.height() ); // Since that's been drawn... discout it from the // height and calculate all the text. h -= pos_sz.height(); _message_zone.setRect( margin, h - h/5 - margin, w-2*margin, h/5 ); _message->setGeometry(_message_zone); h -= _message_zone.height(); _time_zone.setRect( margin, margin, w*2/3, _message_zone.y() ); _stats_zone.setRect( _time_zone.right() + 2*margin, _time_zone.y(), w - 3*margin - _time_zone.right(), _time_zone.height() ); // Size the fonts... _large_font.setPixelSize( _time_zone.height() * 9 / 10 ); _large_font.setStretch( 100 ); _small_font.setPixelSize( _stats_zone.height() * 7 / 10 / 4 ); _small_font.setStretch( 100 ); _small_font.setWeight(QFont::Bold); QFontMetrics large_m( _large_font ); QFontMetrics small_m( _small_font ); int stretch; stretch = 100.0 * _time_zone.width() / large_m.width("99:99.9"); _large_font.setStretch(stretch); stretch = 100.0 * _stats_zone.width() / small_m.width(".SPEED: 100%"); _small_font.setStretch(stretch); _message_font = _small_font; _message_font.setStretch(100); _message->set_font(_message_font); } void StatusWidget::paintEvent(QPaintEvent * /*event*/) { // Using REVERSE colors of parent. _update_palette(); QPainter painter(this); painter.setRenderHints(QPainter::Antialiasing); painter.setBackgroundMode(Qt::TransparentMode); QBrush brush( palette().color(QPalette::Active, QPalette::Window ) ); QPen pen( palette().color(QPalette::Active, QPalette::Dark) ); int radius = _sizes->thicker_line() * 2.0; painter.setBrush(brush); painter.setPen(pen); painter.drawRoundedRect( _bg_zone, radius, radius ); // Change pen color to draw text. pen.setColor( palette().color(QPalette::Active, QPalette::WindowText) ); painter.setPen(pen); brush.setColor( palette().color(QPalette::Active, QPalette::WindowText) ); painter.setBrush(brush); // Audit the font sizes. Only change them if there is a problem. QFontMetrics large_m( _large_font ); QFontMetrics small_m( _small_font ); int stretch; int twid; twid = large_m.width(_time); if( twid > 0 ) { stretch = 100.0 * _time_zone.width() / large_m.width(_time); if(stretch < _large_font.stretch() && stretch > 10 ) { _large_font.setStretch(stretch); } } twid = small_m.width(_speed); if( twid > 0 ) { stretch = 100.0 * _stats_zone.width() / small_m.width(_speed); if(stretch < _small_font.stretch() && stretch > 10 ) { _small_font.setStretch(stretch); } } painter.setFont(_large_font); painter.drawText(_time_zone, _time); painter.setFont(_small_font); painter.setRenderHints(QPainter::TextAntialiasing, false); QRect stat = _stats_zone; stat.setHeight( stat.height() / 4 ); painter.drawText(stat, _speed); stat.moveTo( stat.x(), stat.bottom() ); painter.drawText(stat, _pitch); stat.moveTo( stat.x(), stat.bottom() ); painter.drawText(stat, _cpu); stat.moveTo( stat.x(), stat.bottom() ); painter.drawText(stat, _volume); //painter.setFont(_message_font); //painter.drawText(_message_zone, _message); } void StatusWidget::_update_palette() { QPalette p(parentWidget()->palette()); QColor base, bright, light, mid, dark; base = p.color(QPalette::Active, QPalette::Dark); bright = p.color(QPalette::Active, QPalette::BrightText); light = p.color(QPalette::Active, QPalette::Light); mid = p.color(QPalette::Active, QPalette::Mid); dark = p.color(QPalette::Active, QPalette::Dark); p.setColorGroup( QPalette::Active, bright, // Window Text dark, // Button light, // light dark, // dark mid, // mid light, // text light, // bright text base, // base dark // window ); setPalette(p); } } // namespace StretchPlayer stretchplayer-0.503/src/StatusWidget.hpp000066400000000000000000000041701142050324400203360ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef STATUS_HPP #define STATUS_HPP #include #include #include #include class QPushButton; class QLabel; class QVBoxLayout; class QHBoxLayout; class Slider; class QSpinBox; class QPaintEvent; namespace StretchPlayer { class PlayerSizes; namespace Widgets { class ThinSlider; class Marquee; } class StatusWidget : public QWidget { Q_OBJECT public: StatusWidget(QWidget *parent, PlayerSizes *sizes); ~StatusWidget(); public slots: void position(float); void time(float); void speed(float); void pitch(int); void volume(float); void cpu(float); void message(QString); void song_name(QString); signals: void locate(float); // [0.0, 1.0] private slots: void _changing_position(int); private: virtual void resizeEvent(QResizeEvent *event); virtual void paintEvent(QPaintEvent *event); void _update_palette(); private: QString _time; QString _speed; QString _pitch; QString _volume; QString _cpu; QFont _large_font; QFont _small_font; QFont _message_font; QRect _bg_zone; QRect _time_zone; QRect _stats_zone; QRect _message_zone; Widgets::ThinSlider *_position; Widgets::Marquee *_message; PlayerSizes *_sizes; }; // StatusWidget } // namespace StretchPlayer #endif // PLAYERWIDGET_HPP stretchplayer-0.503/src/ThinSlider.cpp000066400000000000000000000110361142050324400177460ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "ThinSlider.hpp" #include #include #include namespace StretchPlayer { namespace Widgets { ThinSlider::ThinSlider(QWidget* parent) : QAbstractSlider(parent), _thin(1.0), _thick(3.0) { } ThinSlider::~ThinSlider() {} void ThinSlider::init() { QSizePolicy sp(QSizePolicy::Expanding, QSizePolicy::Fixed, QSizePolicy::Slider); setSizePolicy(sp); } QSize ThinSlider::sizeHint() const { if(orientation() == Qt::Horizontal) { return QSize(85, 2 * _thick); } return QSize(2 * _thick, 85); } QSize ThinSlider::minimumSizeHint() const { return sizeHint(); } void ThinSlider::set_line_widths(float thin, float thick) { if(thin < .1) thin = .1; if(thick < .1) thick = .1; _thin = thin; _thick = thick; if( orientation() == Qt::Horizontal ) { setMinimumHeight(_thick); } else { setMinimumWidth(_thick); } } void ThinSlider::mousePressEvent(QMouseEvent *ev) { if(maximum() == minimum() || (ev->buttons() ^ ev->button())) { ev->ignore(); return; } if( ! (ev->button() & Qt::LeftButton) ) { ev->ignore(); return; } ev->accept(); setSliderDown(true); float pos; if( orientation() == Qt::Horizontal ) { pos = float(ev->x()) / (width() - _thick); } else { pos = float(ev->y()) / (height() - _thick); } if( pos < 0.0 ) pos = 0.0; if( pos > 1.0 ) pos = 1.0; setSliderPosition( pos * (maximum()-minimum()) + minimum() ); } void ThinSlider::mouseMoveEvent(QMouseEvent *ev) { if( ! (ev->buttons() & Qt::LeftButton) ) { ev->ignore(); return; } ev->accept(); float pos; if( orientation() == Qt::Horizontal ) { pos = float(ev->x()) / (width() - _thick); } else { pos = float(ev->y()) / (height() - _thick); } if( pos < 0.0 ) pos = 0.0; if( pos > 1.0 ) pos = 1.0; setSliderPosition( pos * (maximum()-minimum()) + minimum() ); } void ThinSlider::mouseReleaseEvent(QMouseEvent *ev) { if( ! (ev->button() & Qt::LeftButton) ) { ev->ignore(); return; } ev->accept(); float pos; if( orientation() == Qt::Horizontal ) { pos = float(ev->x()) / (width() - _thick); } else { pos = float(ev->y()) / (height() - _thick); } if( pos < 0.0 ) pos = 0.0; if( pos > 1.0 ) pos = 1.0; setSliderPosition( pos * (maximum()-minimum()) + minimum() ); setSliderDown(false); } void ThinSlider::paintEvent(QPaintEvent * /*event*/) { QPointF start, end, pos; float pos_val; pos_val = float(value() - minimum()) / maximum(); if( orientation() == Qt::Horizontal ) { // All Y coords are the same start.setY( height()/2.0 ); end.setY( start.y() ); pos.setY( start.y() ); start.setX( _thick/2.0 ); end.setX( width() - _thick/2.0 ); pos.setX( _thick/2.0 + pos_val * (width()-_thick) ); } else { // Qt::Vertical // All X coords are the same start.setX( width() / 2.0 ); end.setX( start.x() ); pos.setX( start.x() ); start.setY( _thick/2.0 ); end.setY( height() - _thick ); pos.setY( pos_val * height() ); } QPainter painter(this); painter.setRenderHints(QPainter::Antialiasing); painter.setBackgroundMode(Qt::TransparentMode); QColor thin_color( palette().color(QPalette::Active, QPalette::WindowText) ); thin_color.setAlphaF(0.25); QColor thick_color( palette().color(QPalette::Active, QPalette::WindowText) ); QPen line_pen( thin_color ); line_pen.setWidthF(_thin); line_pen.setJoinStyle(Qt::RoundJoin); line_pen.setCapStyle(Qt::RoundCap); painter.setPen(line_pen); painter.drawLine(start, end); line_pen.setColor(thick_color); line_pen.setWidthF(_thick); painter.setPen(line_pen); painter.drawPoint(start); painter.drawLine(start, pos); } } // namespace Widgets } // namespace StretchPlayer stretchplayer-0.503/src/ThinSlider.hpp000066400000000000000000000032011142050324400177460ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef THINSLIDER_HPP #define THINSLIDER_HPP #include class QWidget; namespace StretchPlayer { namespace Widgets { class ThinSlider : public QAbstractSlider { public: ThinSlider(QWidget* parent = 0); virtual ~ThinSlider(); /** * Set the line widths in pixels. This sets the preferred * widget size... but the widget is still expandable. */ void set_line_widths(float thin, float thick); public: virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; private: void init(); virtual void paintEvent(QPaintEvent *event); virtual void mousePressEvent(QMouseEvent *ev); virtual void mouseMoveEvent(QMouseEvent *ev); virtual void mouseReleaseEvent(QMouseEvent *ev); private: float _thin; float _thick; }; } // namespace Widgets } // namespace StretchPlayer #endif // THINSLIDER_HPP stretchplayer-0.503/src/icons.svg000066400000000000000000000311061142050324400170310ustar00rootroot00000000000000 image/svg+xml A/B ? stretchplayer-0.503/src/img/000077500000000000000000000000001142050324400157505ustar00rootroot00000000000000stretchplayer-0.503/src/img/ab.png000066400000000000000000000104751142050324400170470ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATx{]Uu?GBbcD@  4yEB0VԆaq:":::U>PF,yԢ3 bC-R,;{:g{ssu>{UeP^ 1>@s 1>ǘ;PD8Tz30>^I]fTڤ:- \f"71 < =+"28 c;܅2`pQS "`J=:}r`\s "skq̏ccX|EUܗj_Ψ/NU4CW zn^xS=]gUL g,`OgjPܪ;L gd2wpݝTR-5[\+DT c9  |Nk_]c[(vϤҳ83KnJd-ItXHU_Fj[ ]f[f3|V8< ^UN0Zێ9_gkowK~kR݈aX+0.,߷X2pH 2~=pn݌ɹ1`g \]|]+~7V=_fh ڌ ,Cʾ b .p*?%1LE8ˢSfZB0]~Mv؃/1;1u3B!X> ])K l/ѺAAsZ-śMn(8mu3!8ۏnՏXAqNb, xn,݉<a,\ZDdnm>`Tz"rp$-Thǰ3~g>NѾJil-q,CU)(|Xl;p1,(h'p`*QXț 8sg(6sHhר'NԂ.e4ؘ pGP ,2AU)^?cE'fDd(K~AJU=ږYx` 0?V5ycB)Zc'ohM,6۰^+AmpIOUXa\,!"r>n'0n`\mbM)^u`fA3Hlz}YcbXSBc\Fs*nT5\^AG_~%"_Z% + m<2cpGB%qy7p]zWV |hpTN[ uTc w}FKM;._2N "VNU+ .qi;jzE*"CJq"{ wm[16F@UC|}P,T,U9C~D䨜vhb˿g~-q4Jky\0Ti6 иۿsrU})WUqrQ\^&3E8PZ*!ihK0}m6"+"?ƙɳ z3Xhܞw֪@}mm_", npg!mw3hI4@ K%ś59wVmq7}"lNg"vxgpZ[hܖw:o^AVYGm'8M"\D&my `wNDpw^.WPDd#p|b+SV6a<[wK8}XD&uX=Kď&{s_k() <Wz8Ic *d%ߠqs$[g;ԪUiU0"4DB  "Si$jU}!!U $2oY EOyv3)d!/.=sqaX]AݮsJ%^%ͩC8_d[{xDi+gb|^jbOew+Wy"-?AjK:.Mun!t-ђDnF9wqՏ[#? 3ؚ"m2<-C͐WGT㷎/H=R: "r*3(XN{Ynk2kU|b9k'3uJM:+m L~S>-38!%p#)'^HO'Z4'_W9JDn6*CS>GT&G? l1Um+"p lt܀kU]|%}>UcǛh!w8#(#u>7:U}g\j ܞ6ߏcT;?ieP*N&SRҡAtQUYbVu ~=GBb 3: Ja`J 4yy{ gmګp%>'+"yf]h#UE9PCF ƧSu]')! X;3㜃߲]/)-vaw`"|X`L|,WLzF<ݑI a |[# tnho'BqW-:b("2w"B)*PUK0mwﯸ$=[JTy&HJR;ltO=$gHh4Dd> qh@>:| vц}42Vʠ+ 0e6em*EW @r~#\swbc(kqoxm'Riіch݆}58?X'ójH "skqD/+p=kOS$ eSA|M Wԍ4Dd .E*!DVEsV aY =+Y,0ǝ=U m<Z0j 8ܽ|IHD^%KispIڤ)T F Ѷ9@c }9=/aiQ&IENDB`stretchplayer-0.503/src/img/file.png000066400000000000000000000030121142050324400173710ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATx=U'P (!X,)},$MPM%"{M@p-ՍM֯1lBč="yyst{.o~?ΝyOT$.[@2,)@pRI'N  8)@pRI'N  8)@pRI"SD^"sr"rׇ2b}/@DuDY[CdL~G4 RճCd,X/0'&tpA kKЃ VF%`75ϫ/]:H~ׁ[%Gk/j>oÚ_+*nu'hO.,_VµDD:2XUknlo-agVꎕ͟nlm0F @+:pbpAMN깊Zmhdw@Dnv"o7m"8_W ]ڷH-2>zdw} u8|RNk4#醈26'kߝ~Ug)-sNO/n-@?LW%7R i6c IU/Z,?? pZUruOHz "ctx,c=LX㌡л'2'N)q!HJ "K@HJ(V0?0j* &3U3}}G%chV=zT!X3 .y6 asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATx_lU?- (U) YوW `VFxaQJDQM *bDH@m@%ME-T~0*{f{r_f99s* Kʶ vIP$(q8JD%N"'mہ04pp=0L*\\z0p^UCTH1$Dw32 mgIUsˈo`G\ J"2 X lٝRJA@D"ov/ΌEl ",s-}@FR"+0۶/8<;l;2X @Df} êfۑs"$"yhxNZEvbb` pUGS]6H4Rz΍"򢈘NZyJ ")޽iTXG2g}2o,#vQ[ T;{ @D6DYf^qU4jVj -@*  7BTu8n_% ~>܋s#Ħb )்M+6[[}w,oa`oFfZIaq $J`w&鿓w`.ν6GJ1w|D J[Ćv n*"0a„d8{,}}}rCCCNVUOs3lFdaƌPSSө=줽6imme 8~]>ɫpb+ϔ1w\,lnpihh?&aΨ <>c!)dtب\Nm۫=^veD9'+h*҅ j}}Ed/r9}uĉ6EB WQUpzBNoF[ qׂG&Mbʔ)QjQl&(`}űcnNo ~Mw)>s655ƍuŊZUU嫬*}衇A=4xd}3&^ݶm._\Ǐoӧ믿þEpIZ 3.~ץKjyyy㏾Enݺ0L SE8~_>iӴ˗:;;5NG} Sm E~-++s`_PU7o^~E@o_Kk֬g׸qQ:G}iӦ+?X񙌕e<ʓuvu|[@1-uH3СC!yrA81MĠfnV_I'NMLMF8>7N[ZZ|y>NsoitZ{=_?r՜ M?~رWO>~u߁XXYfC|֛߳&D *3g|~EY}=aBŠ"ɓu׮]O??^3!1H$rJO?T 6!T$T7!}'5JYX |flV X ڄ:bP6n8ݸqc^6{AEɓ/.{zLl *bn@Mᆱ_~u}D#[n_~WM#w=js/feTJK_ w!3 ,aŋ}wQ32 ,DPCC>|X+**lȌ$ :ԩS!zb#(+|loooXa?|qAE']16L `uP? ^LBxWÑ;xW4F;a,qb6&>T՜+|ݻӱ|MDFz[xTሔSOm&͞W? Dlql]<ʳT8ȝ(9~ ~ +F6IqB 0UUOx=W Uf"^ ~x DXt>y2E]d%>76aijK@1 *F`ssw:g Ϩ;oI0"n0<[A`:;V5egPJ`n.RǧBfd|X,ĩ7`(DdΚbٲe6.&UeBy?_H 0}hDd ( jhVHq6֧20)Rr!d# {:첊U.Cȏ+Ld-"^25#,I,)q\p>c$m|}*I/Xiّ݊لۏ<`D[|yk^PwP l4 Եv!-HDd&oۗ <4.XoFmz' RUS!f-HDDp]O|t~V#,8>KAՋ9 V7[vg4pgxK~mHDX,}0Dz,q`0Y.`&}*7p g&[) FDu Z`"0pm{Jsl0ΊۇڻFQ ;$DO"'@IP$(q8A\4FIENDB`stretchplayer-0.503/src/img/minus.png000066400000000000000000000015671142050324400176220ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATx?LQRE/RD+@(UTBIV"*?lޝ'wf3ܳVU(׎EZ,g 3p@8g 3p@8g 3p@8g 3p@8g 3p@8g 3p@8gvN`km8zx 6=U5VW.LoU5>`| 1pdGKd^?c9kMp> wZ[>{{T{TUz{^_&[kWz{_gzPp Z;׆180t'3Cz|%/37_ snjЁvx^Ug ~im蜶ݝ1w5MPU:8L-f"X߀=#غ]CNWzNW}$d:d >&__]bߺ .p X3`6\|/@8g 3p@8g 3p@8g 3p@8g 3p@8g 3p@8g 3p@8GjFfIENDB`stretchplayer-0.503/src/img/play.png000066400000000000000000000034011142050324400174210ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<~IDATxُU2<ʟ1V4f0_~Zsk tzb pIZpކ630d !:òmȖ1BndC'KySc3vs1LXr)L W;H. 9I &rwZ1 0bLJ! 4jc 0Tҏ$ ߁$-$i. }q ׯj.`6d pŸAM & >(s,ֲ^|(Gkm_i`,0:NͲP9s7B`)܏pEUwB+wI.~asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATxϋVU?OT4P šU 6"7 '&p)͌ i\I#+m񴸯P{~g7y=׹0bıXq,8@ cı<80BIiQF̽6bIhQ1{Z`-efٴ8Xq,8@ cıXq,8@ cıXq,8@ cıXq,8 \CF&LcKg9+g Fm[zq6WQk < Ag8죫ЋC (ൂ (` ,[AY@ޗ-. (zAY#/f콛y`qd83:J< asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< XIDATxOh]U?bME%AtDJˆ>nj!n36D jaPk ZJ]<+ 5JEںj1m,˘4߹~.=~<=$Qs* W@UpUtN ̬ y;p3p75*pW_wKϫya!6`3޹k9$0|,s&<G<9!pLҷ9R`f= po\/I-INU3e8$idVS#VgQ`fORt.N$DWTfuࡢs $+:%Edffv8KIΚ3.:`0maVh""SE&Q`f p3>0fhղ 6{ PC >v{}edn=svnIt nF)7ljmPWGFSU8 OI H{mYI=Fe~=CRp 8a]b_0+[*]]پJ:yQW+|g=r\1t )Wy'ظq#===lܸ.:7|ce``-[p뭷rqy.^g$]sI>MOOFZXXѣGUՊz]3337q0I -mgnݪk422R}Y{֭Y@7p!M'RM^)߿Ϊ/m{8`FcMiuwwm@f2qijZ\\LU4).ҚmlN8hwT4)/IYr8"RSNe.T,KX\R|%II@e$g+k:k<;vp+/Kґ#GO{ZƓO>9y$SSS\p%ǼϞ={\t˗/{믿I_cfx%"l3LP-]IwLg"O+*d(nv':]n>4Ofۀ@DE`LXFMEefׁ%>^tDT\Izx.8OMOKz8&!`Hv)/e`l>I6]TZ6]䍥\')cIW]m2.nM$_nh*pW_HoIy!/%ZWTW@UpUt*:\JQ xIENDB`stretchplayer-0.503/src/img/stop.png000066400000000000000000000014011142050324400174370ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<~IDATx1NAGD!DRPr 79π2 -Gq*[R"ΆkOD1>#I ]|ZIENDB`stretchplayer-0.503/src/main.cpp000066400000000000000000000031741142050324400166310ustar00rootroot00000000000000/* * Copyright(c) 2009 by Gabriel M. Beddingfield * * 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 Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "config.h" #include #include "PlayerWidget.hpp" #include #include #include int main(int argc, char* argv[]) { QApplication app(argc, argv); std::auto_ptr pw; std::cout << "StretchPlayer version " STRETCHPLAYER_VERSION ", Copyright 2010 Gabriel M. Beddingfield\n" << "StretchPlayer comes with ABSOLUTELY NO WARRANTY;\n" << "This is free software, and you are welcome to redistribute it\n" << "under terms of the GNU Public License (ver. 2 or later)\n" << std::endl; pw.reset(new StretchPlayer::PlayerWidget); app.setStyle( new QPlastiqueStyle ); pw->show(); if(argc > 1) { QString fn(argv[1]); std::cout << "Loading file " << argv[1] << std::endl; pw->load_song(fn); } app.exec(); return 0; } stretchplayer-0.503/src/stretchplayer.qrc000066400000000000000000000004611142050324400205750ustar00rootroot00000000000000 img/play.png img/stop.png img/ab.png img/help.png img/quit.png img/plus.png img/minus.png img/file.png stretchplayer-0.503/stretchplayer.desktop.in000066400000000000000000000004471142050324400213030ustar00rootroot00000000000000[Desktop Entry] Name=StretchPlayer Comment=Audio file player with time stretch Exec=stretchplayer Icon=@CMAKE_INSTALL_PREFIX@/share/stretchplayer/icons/stretchplayer-icon-48x48.png Terminal=false MimeType=application/x-stretchplayer; Type=Application Categories=AudioVideo;Audio;X-Sound;X-Jack;