Re: [SailfishDevel] Playing a wav in Sailfish
Hi João I have just made a little demo project, importing QtMultimediaKit 1.1, and a SoundEffect Component. I added a Button component to the Column to play the sound when clicked. My Demo works, I get a swish sound when the button is clicked. You will find the code of my FirstPage at the bottom of this mail. Create a new demo project, and paste my code into the FirstPage. Note I copied my wav to the pages folder (alongside FirstPage). Please substitute your own wav file - I grabbed the first one I could find on the train. Put you wav in the Pages folder. Do you get any sound at all from the Emulator? For instance on a demo new project with the PullDownMenu you should get a distinct click sound when the menu opens. On the known issues page https://sailfishos.org/wiki/SDK_Alpha_Known_Issues#Emulator I found this: The sound is not enabled in the Emulator. Fix: Shutdown the emulator; Open virtualbox manager; Pick SailfishOS Emulator, Pick Settings, pick Audio, Enable audio (default driver). Accept. Start Emulator. The Pulley menus make a sound for testing purposes. Assuming that you do get sound, do you have QtMultimedia installed? Connect to the SDK by SSH and search for QtMultimedia with zipper: zypper se multi I get this: S | Name | Zusammenfassung | Typ --+--++-- | libdeclarative-multimedia| Qt Mobility Multimedia QML plugin | Paket | libqtmultimediakit1 | Qt Mobility MultimediaKit module | Paket i | multi_c_rehash | A c_rehash implementation in C | Paket | multi_c_rehash-debuginfo | Debug information for package multi_c_rehash | Paket | multi_c_rehash-debugsource | Debug sources for package multi_c_rehash | Paket Repeat with the the Emulator: If you don't get anything like this then you will have to install QtMultimedia. Chris //Start FirstPage.qml import QtQuick 1.1 import Sailfish.Silica 1.0 import QtMultimediaKit 1.1 Page { id: page // To enable PullDownMenu, place our content in a SilicaFlickable SilicaFlickable { anchors.fill: parent // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView PullDownMenu { MenuItem { text: Show Page 2 onClicked: pageStack.push(Qt.resolvedUrl(SecondPage.qml)) } } // Tell SilicaFlickable the height of its content. contentHeight: childrenRect.height // Place our content in a Column. The PageHeader is always placed at the top // of the page, followed by our content. Column { width: page.width spacing: theme.paddingLarge PageHeader { title: UI Template } Label { x: theme.paddingLarge text: Hello Sailors color: theme.secondaryHighlightColor font.pixelSize: theme.fontSizeLarge } Button { text: Sound onClicked: mySound.play() } } SoundEffect { id: mySound //substitue your own wav file here, and copy it to the pages directory! //this is the first one I could find while experimenting on the train source: 92909__Robinhood76__01526_swoosh_2.wav } } } //End FirstPage.qml Zitat von joao morgado joaodeusmorg...@yahoo.com: Hi I'm porting a app from Meego/Symbian, I need to play a wav file. I used importQtMultimediaKit1.1 and SoundEffect element. I tought QtMultimediaKit was only available in Meego / Symbian, but my app runs fine in the emulator, so I guess I'm good to go. I don't hear any sound, I'm assuming it's a emulator limitation, can please someone confirm that ? Thanks João de Deus ___ SailfishOS.org Devel mailing list
Re: [SailfishDevel] Make cover page equal to First page
Hi, I never tried it, but I guess If you don't want an cover to be shown, comment out the cover property in main.qml. No cover set, should mean no cover can be seen. :) Or you create a cover with a timer and it's also update, like on your real page. Gabriel. -- Von meinem Nokia N9 gesendet Joona Petrell schrieb am 14.06.13 07:26: Hi João, Application cover should have it's own UI, because it has different layout dimensions than the full-screen application page, different background (often CoverBackground) and in most cases should have cover actions. Cover and a page can share an UI component, provided that UI component somehow handles the layout differences, e.g. CoverBackground { TimerItem { coverMode: true } CoverActionList { ... } } vs. Page { TimerItem { coverMode: false } }. Binding initialPage property to cover property is not ok. Cheers, Joona -- *From:* devel-boun...@lists.sailfishos.org [ devel-boun...@lists.sailfishos.org] on behalf of joao morgado [ joaodeusmorg...@yahoo.com] *Sent:* 14 June 2013 05:38 *To:* devel@lists.sailfishos.org *Subject:* [SailfishDevel] Make cover page equal to First page Hi again The app that I'm portin from Meego, it's a timer, so I need the cover to look the same has the first page, so the user can see the time running in the cover, just like in the first page. So, I did: ApplicationWindow { initialPage: FirstPage { } cover: initialPage //Qt.resolvedUrl(cover/CoverPage.qml) } This works but when the app is in cover mode, the timer freezes, (unlike the meego N9 version, who keep running) and something gets messed up in the simulator, because when clicking the cover to return to first page, the app doesnt appear anymore, only the sailfish background. Any ideias ? Regards João de Deus ___ SailfishOS.org Devel mailing list ___ SailfishOS.org Devel mailing list