diff --git a/AudioPlayer/.cproject b/AudioPlayer/.cproject new file mode 100644 index 0000000..583cd4b --- /dev/null +++ b/AudioPlayer/.cproject @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AudioPlayer/.project b/AudioPlayer/.project new file mode 100644 index 0000000..e3b0f24 --- /dev/null +++ b/AudioPlayer/.project @@ -0,0 +1,96 @@ + + + Template_Test + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + Device-Debug + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + true + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + Device-Debug + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + com.rim.tad.tools.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + com.rim.tad.tools.qml.core.qmlFileBuilder + + + + + com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder + + + + + + com.rim.tad.tools.wst.jsdt.core.jsNature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + com.qnx.tools.ide.bbt.core.bbtnature + org.eclipse.cdt.core.ccnature + com.rim.tad.tools.qml.core.qmlNature + + diff --git a/AudioPlayer/.settings/org.eclipse.cdt.core.prefs b/AudioPlayer/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 0000000..ce74f19 --- /dev/null +++ b/AudioPlayer/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,33 @@ +eclipse.preferences.version=1 +environment/project/com.qnx.qcc.toolChain.153361029/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.153361029/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.153361029/CPULIST/value=x86 +environment/project/com.qnx.qcc.toolChain.153361029/VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.153361029/VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.153361029/VARIANTLIST/value=g +environment/project/com.qnx.qcc.toolChain.153361029/append=true +environment/project/com.qnx.qcc.toolChain.153361029/appendContributed=true +environment/project/com.qnx.qcc.toolChain.222246400/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.222246400/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.222246400/CPULIST/value=arm +environment/project/com.qnx.qcc.toolChain.222246400/EXCLUDE_VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.222246400/EXCLUDE_VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.222246400/EXCLUDE_VARIANTLIST/value=r +environment/project/com.qnx.qcc.toolChain.222246400/append=true +environment/project/com.qnx.qcc.toolChain.222246400/appendContributed=true +environment/project/com.qnx.qcc.toolChain.410036280/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.410036280/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.410036280/CPULIST/value=arm +environment/project/com.qnx.qcc.toolChain.410036280/VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.410036280/VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.410036280/VARIANTLIST/value=g +environment/project/com.qnx.qcc.toolChain.410036280/append=true +environment/project/com.qnx.qcc.toolChain.410036280/appendContributed=true +environment/project/com.qnx.qcc.toolChain.482438370/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.482438370/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.482438370/CPULIST/value=arm +environment/project/com.qnx.qcc.toolChain.482438370/EXCLUDE_VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.482438370/EXCLUDE_VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.482438370/EXCLUDE_VARIANTLIST/value=p +environment/project/com.qnx.qcc.toolChain.482438370/append=true +environment/project/com.qnx.qcc.toolChain.482438370/appendContributed=true diff --git a/AudioPlayer/Makefile b/AudioPlayer/Makefile new file mode 100644 index 0000000..fa2bd07 --- /dev/null +++ b/AudioPlayer/Makefile @@ -0,0 +1,6 @@ +QMAKE_TARGET = Template_Test +PROJECT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) +I18N_DIR := $(PROJECT_DIR)/translations + +include mk/cs-base.mk + diff --git a/AudioPlayer/README.md b/AudioPlayer/README.md new file mode 100644 index 0000000..611c7c8 --- /dev/null +++ b/AudioPlayer/README.md @@ -0,0 +1,37 @@ +Audio Player +Create a dropdown list to play audio sounds from within your applications. + +Sample Description: +This sample demonstrates how to use a dropdown to play your own custom sounds within a BlackBerry Cascades application. + + + +Multiple dialogsRequirements: +BlackBerry Native SDK for BlackBerry 10.0.9 or later +One of the following: +BlackBerry Alpha Device +BlackBerry Alpha Device Simulator +Importing a project into the Native SDK: +From the the Sample apps page, download and extract the sample application. +Launch the Native SDK. +On the File menu, click Import. +Expand General, and select Existing Projects into Workspace. Click Next. +Browse to the location where you extracted the sample app, and click OK. The sample project should display in the the Projects section. +Click Finish to import the project into your workspace. +Requirements: + +BlackBerry 10 Native SDK Beta + +Running the example: + +Download the sample from http://github.com/blackberry. +Launch BlackBerry 10 Native SDK Beta, and from the File menu, select Import. +Expand General, and select Existing Projects into Workspace. Click Next. +Browse to the location where you extracted the sample file, and then click OK. +The sample project should display in the the Projects section. Click Finish to import the project into your workspace. +In the Project Explorer pane, Right-click the the project (for example hellocascades) and select Build Project. +In the Project Explorer pane, Right-click the the project (for example hellocascades) and select Run As > BlackBerry C/C++ Application. +The application will now install and launch on your device if not you might have to set up your environment: http://developer.blackberry.com/cascades/documentation/getting_started/setting_up.html + +Disclaimer THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/AudioPlayer/Template_Test.pro b/AudioPlayer/Template_Test.pro new file mode 100644 index 0000000..f803266 --- /dev/null +++ b/AudioPlayer/Template_Test.pro @@ -0,0 +1,8 @@ +APP_NAME = Template_Test + +CONFIG += qt warn_on cascades10 + + +LIBS += -lbbmultimedia + +include(config.pri) diff --git a/AudioPlayer/assets/images/pause_btn1.png b/AudioPlayer/assets/images/pause_btn1.png new file mode 100644 index 0000000..09db72f Binary files /dev/null and b/AudioPlayer/assets/images/pause_btn1.png differ diff --git a/AudioPlayer/assets/images/play_btn1.png b/AudioPlayer/assets/images/play_btn1.png new file mode 100644 index 0000000..d73459d Binary files /dev/null and b/AudioPlayer/assets/images/play_btn1.png differ diff --git a/AudioPlayer/assets/images/stop_btn1.png b/AudioPlayer/assets/images/stop_btn1.png new file mode 100644 index 0000000..fca7e15 Binary files /dev/null and b/AudioPlayer/assets/images/stop_btn1.png differ diff --git a/AudioPlayer/assets/main.qml b/AudioPlayer/assets/main.qml new file mode 100644 index 0000000..eb855be --- /dev/null +++ b/AudioPlayer/assets/main.qml @@ -0,0 +1,85 @@ +// Default empty project template +import bb.cascades 1.0 +//Media Player control Import +import bb.multimedia 1.0 + +// creates one page with a label +Page { + //Attached Objects + attachedObjects: [ + + MediaPlayer { + //ID of media player + id: myPlayer + //Source of where your media is selected from + //We will use a drop down for this + sourceUrl: soundSelectorDropdown.selectedValue + + + } + ] + //Main Container + Container { + //Container for dropdown + Container { + layout: StackLayout { + orientation: LayoutOrientation.TopToBottom + } + //Center all components on page + horizontalAlignment: HorizontalAlignment.Center + //Create our drop down to hold selections + DropDown { + id: soundSelectorDropdown //Id that goes in sourceURL + title: "Sounds" + //Next Create List of sounds + Option { + text : "Fan 1" + description : "" //This is optional component + value : "asset:///music/fan1.wav" //Where the file located + } + Option { + text : "Fan 2" + description : "" + value : "asset:///music/fan2.wav" + } + } //End Drop Down + }//End Drop Down Container + + //Media Player Controls + Container { + //We want these side by side + //So we use a stacklayout orientation left to right + layout: StackLayout { + orientation: LayoutOrientation.LeftToRight + } + horizontalAlignment: HorizontalAlignment.Center + topPadding: 20.0 //Added to give some space + ImageButton {//Play Button + id: systemSoundPlayButton // + defaultImageSource: "images/play_btn1.png" //Source where image button is + onClicked: { + myPlayer.play() //Calls our media player and gives command of Play + } + minHeight: 100.0 + } // End Play Button + ImageButton { //Pause Button + id: customSoundPlayButton2 + defaultImageSource: "images/pause_btn1.png" //Source where image button is + onClicked: { + myPlayer.pause() //Calls our media player and gives command of Pause + } + minHeight: 100.0 + }//End Pause Button + ImageButton { + id: customSoundPlayButton3 + defaultImageSource: "images/stop_btn1.png" //Source where image button is + onClicked: { + myPlayer.stop() //Calls our media player and gives command of Pause + } + minHeight: 100.0 + } //End Stop Button + + }//End Media Player Controls Container + } //End Main Container +} + diff --git a/AudioPlayer/assets/music/fan1.wav b/AudioPlayer/assets/music/fan1.wav new file mode 100644 index 0000000..8b70b57 Binary files /dev/null and b/AudioPlayer/assets/music/fan1.wav differ diff --git a/AudioPlayer/assets/music/fan2.wav b/AudioPlayer/assets/music/fan2.wav new file mode 100644 index 0000000..af4c035 Binary files /dev/null and b/AudioPlayer/assets/music/fan2.wav differ diff --git a/AudioPlayer/bar-descriptor.xml b/AudioPlayer/bar-descriptor.xml new file mode 100644 index 0000000..4072099 --- /dev/null +++ b/AudioPlayer/bar-descriptor.xml @@ -0,0 +1,102 @@ + + + + + + + + com.example.Template_Test + + + Template_Test + + + 1.0.0 + + + 1 + + + + + + The Template_Test application + + + + + + Example Inc. + + + + + + none + false + + + + core.games + + armle-v7 + Template_Test + + + Qnx/Cascades + armle-v7 + Template_Test.so + + + armle-v7 + Template_Test + + + x86 + Template_Test + + + + + icon.png + + + icon.png + assets + + + + + + + + run_native + + + diff --git a/AudioPlayer/config.pri b/AudioPlayer/config.pri new file mode 100644 index 0000000..491ce82 --- /dev/null +++ b/AudioPlayer/config.pri @@ -0,0 +1,26 @@ +# Auto-generated by IDE. All changes by user will be lost! +# Created at 1/13/13 1:39 AM + +BASEDIR = $$_PRO_FILE_PWD_ + +INCLUDEPATH += \ + $$BASEDIR/src + +SOURCES += \ + $$BASEDIR/src/TemplateTest.cpp \ + $$BASEDIR/src/main.cpp + +HEADERS += \ + $$BASEDIR/src/TemplateTest.hpp + +CONFIG += precompile_header +PRECOMPILED_HEADER = $$BASEDIR/precompiled.h + +lupdate_inclusion { + SOURCES += \ + $$BASEDIR/../assets/*.qml +} + +TRANSLATIONS = \ + $${TARGET}.ts + diff --git a/AudioPlayer/icon.png b/AudioPlayer/icon.png new file mode 100644 index 0000000..dab6e7a Binary files /dev/null and b/AudioPlayer/icon.png differ diff --git a/AudioPlayer/precompiled.h b/AudioPlayer/precompiled.h new file mode 100644 index 0000000..adba6a9 --- /dev/null +++ b/AudioPlayer/precompiled.h @@ -0,0 +1,2 @@ +// This file is used to store precompiled headers. +// It is intentionally left blank. It is up to you to decide which headers should be included here. diff --git a/AudioPlayer/src/TemplateTest.cpp b/AudioPlayer/src/TemplateTest.cpp new file mode 100644 index 0000000..7a1ebf0 --- /dev/null +++ b/AudioPlayer/src/TemplateTest.cpp @@ -0,0 +1,22 @@ +// Default empty project template +#include "TemplateTest.hpp" + +#include +#include +#include + +using namespace bb::cascades; + +TemplateTest::TemplateTest(bb::cascades::Application *app) +: QObject(app) +{ + // create scene document from main.qml asset + // set parent to created document to ensure it exists for the whole application lifetime + QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this); + + // create root object for the UI + AbstractPane *root = qml->createRootObject(); + // set created root object as a scene + app->setScene(root); +} + diff --git a/AudioPlayer/src/TemplateTest.hpp b/AudioPlayer/src/TemplateTest.hpp new file mode 100644 index 0000000..e702201 --- /dev/null +++ b/AudioPlayer/src/TemplateTest.hpp @@ -0,0 +1,23 @@ +// Default empty project template +#ifndef TemplateTest_HPP_ +#define TemplateTest_HPP_ + +#include + +namespace bb { namespace cascades { class Application; }} + +/*! + * @brief Application pane object + * + *Use this object to create and init app UI, to create context objects, to register the new meta types etc. + */ +class TemplateTest : public QObject +{ + Q_OBJECT +public: + TemplateTest(bb::cascades::Application *app); + virtual ~TemplateTest() {} +}; + + +#endif /* TemplateTest_HPP_ */ diff --git a/AudioPlayer/src/main.cpp b/AudioPlayer/src/main.cpp new file mode 100644 index 0000000..398ea95 --- /dev/null +++ b/AudioPlayer/src/main.cpp @@ -0,0 +1,31 @@ +// Default empty project template +#include +#include +#include + +#include +#include +#include +#include "TemplateTest.hpp" + +using namespace bb::cascades; + +Q_DECL_EXPORT int main(int argc, char **argv) +{ + // this is where the server is started etc + Application app(argc, argv); + + // localization support + QTranslator translator; + QString locale_string = QLocale().name(); + QString filename = QString( "Template_Test_%1" ).arg( locale_string ); + if (translator.load(filename, "app/native/qm")) { + app.installTranslator( &translator ); + } + + new TemplateTest(&app); + + // we complete the transaction started in the app constructor and start the client event loop here + return Application::exec(); + // when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children) +} diff --git a/AudioPlayer/translations/Makefile b/AudioPlayer/translations/Makefile new file mode 100644 index 0000000..7bd9d5d --- /dev/null +++ b/AudioPlayer/translations/Makefile @@ -0,0 +1,12 @@ +QMAKE_TARGET = Template_Test +LUPDATE = $(QNX_HOST)/usr/bin/lupdate +LRELEASE = $(QNX_HOST)/usr/bin/lrelease + +update: $(QMAKE_TARGET).pro FORCE + $(LUPDATE) $(QMAKE_TARGET).pro + +release: $(QMAKE_TARGET).pro $(QMAKE_TARGET).ts + $(LRELEASE) $(QMAKE_TARGET).pro + +FORCE: + diff --git a/AudioPlayer/translations/Template_Test.pro b/AudioPlayer/translations/Template_Test.pro new file mode 100644 index 0000000..6246a2d --- /dev/null +++ b/AudioPlayer/translations/Template_Test.pro @@ -0,0 +1 @@ +include (../Template_Test.pro) diff --git a/AudioPlayer/translations/Template_Test.ts b/AudioPlayer/translations/Template_Test.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/AudioPlayer/translations/Template_Test.ts @@ -0,0 +1,4 @@ + + + +