Currently a user can select a song on my Qt application and play it using his default media player. I have implemented this using QDesktopServices::openUrl().
However I want the user to be able to select multiple songs and enque them in his media player. With the current implementation as soon as the user selects the second song the first song stops and the second one starts to play.
What would be the best way to do this?
I'm afraid, enqueueing songs cannot be done, using QDesktopServices::openUrl() only. I see two main ways to do that:
You can adjust your player to enqueue all songs, opened with QDesktopServices::openUrl() (which is practically equivalent to double clicking in your file magager).
Most players I know have parameters, which tell them to enqueue listed file(s). For example, deadbeef can be launched with parameter --queue. You can use QProcess::startDetached to launch the player with parameters.
In both ways you need to know the exact player, you are using.
If your player supports MPRIS (if it's a media player which is expected to be integrated to a modern Unix desktop, it does), the addTrack method of the D-BUS MPRIS interface for track list manipulation should help you. You might want to call QDesktopServices::openUrl on the first file to make sure that a player is running before you invoke that.
Related
Having some trouble with getting audio to stop playing when you enter a specified room. I've tried a few different ways, including coding it completely using if statements and audio_play_sound/audio_stop_sound and audio_play_music/audio_stop_music, but both of those didn't work and just layered the music over and over until it created a mess of sound.
Currently, I've tried to do it this way, but upon entering the room the music just keep playing and won't stop.
Anyone know how to get this to work?
I'm using the latest version of Gamemaker.
Cheers
Your issue is that the audio_stop_sound() method accepts an instance of the sound, rather than the name of your sound object.
I'm doing this without Game Maker Studio here to verify the code, but the best way to do this is to save the index returned when you start a sound, and use that index later on to stop it.
For example to start your sound (called MainMenuTheme):
global.MENU_SOUND = audio_play_sound(MainMenuTheme, 1, 1);
Then to stop it
if (audio_is_playing(global.MENU_SOUND))
{
audio_stop_sound(global.MENU_SOUND);
}
Basically when you start a looping sound, store its index in a global variable so you are able to stop it when you need to, from a different screen or object.
I have a plan of writing a small command line tool that does the following (without getting into details):
Listen for input stream (a tail of some files)
Parse incoming data and update screen information real-time (like the top command does for example)
Untill the application is being quited (CTLR + C) it will be updating (not appending!) the information on the screen.
I prefer to work with the Symfony console.
Since they have for example the progress-bar I expect it to be doable, since the progress-bar does update the screen. (However, I don't need an actual progressbar).
Keep listening for an input stream and keep updating when information comes in is something I am not sure about to be possible in this manner.
I can't find enough information on how to do this. Does anyone know if this is possible and what components I would need to:
Listen for input stream and trigger an event when information comes in
Update screen information
Any help would be appreciated.
Update:
For now I built the tool without using any framework. I wrote it myself by using this "Listening for incoming streams" example and this "setting cursor position" example (and ofcourse this referenced overview of commands).
However I still would like to know whether and how this would be possible using Symfony's console components.
Recently, I've add the user agent string when the guests submit the form to the database. There is a report that is generated weekly containing various statistics. I want to add the device and maybe the browser information to the report.
I was pondering that I would create a new database table that would hold all the know user agent strings and have two extra fields, one for the device info, and maybe the browser in the other one. However, I cannot find a site that you can download the strings. Would any one know of a place?
If that can not be done, I was thinking of a .net alternative. How would I go into doing that in .net?
2 ways to do it:
If you are using ASPNET MVC, you could use the default this.Request.Browser within the controller method call (contains quite a lot of info, example here),
You can also use 51Degrees, which has a light and a complete device db to match devices capabilities
My Flex client app has got some data from the back end (RemoteObjects, BlazeDS, Spring). Client has got all the data it needs, it now needs to put some information in a CSV format and make it available for download.
Using Flex 3 for this. Any ideas?
Thanks,
Sri
If you are compiling for Flash Player 10 then you can call the FileReference.save() function to save to the local file-system:
http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/net/FileReference.html#save()
Just make sure you take note of this section:
In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an Error exception. This limitation does not apply to AIR content in the application sandbox.
The only other alternative if you can't compile for Flash Player 10 is to send the data to the server and have the user download it from there as a CSV.
You can do this with the FileReference.download() in a simlar manner to save():
http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/net/FileReference.html#download()
Unfortunately you cannot do it. You have to use FileReference+URLRequest, you cannot create on the fly a file available for download in Flash Player.
One workaround is to display your data in a text file and allow the user to do copy/paste. Of course, it works only if you have a small amount of information.
I am currently using powerbuilder 6.5
In my application, i want to make a code where any change in one window should reflet another window.Two windows are using the same table. if we channge in one window it is not reflecting in another window if the other window is opened earlier. what cani do?
It might help to know a little more about what you are trying to accomplish. Are both windows open at the same time on a single user's screen? Or is one window available to one user and the second being viewed by a separate user waiting to see the updates?
By themselves, the datawindows won't retrieve automatically on updates to the underlying table. In fact, if you have configured the datawindows properly, the update rules should provide some concurrency protection and will not let the second dw update the same table after the first updates. DataWindow2 will sense there's been a change and will try to prevent clobbering the DataWindow1's changes. But again, this may not be an issue if in your context the second window is read-only.
You could have the first window finish its update then check for the existence of the second window and have it retrieve. Even better, use a non-visual business object as an intermediate handler (and also keep nasty cross-window communication code out of the GUI). When the first window's update is successful have it tell the business object it's done, and the object can then tell the second window to retrieve. But there would need to be more done if your second window is updateable.
Use the datawindow ShareData method to share the content of the two datawindows (you do mean datawindow when you say table, right?).
BTW, I feel for you, having to use that PB 6.5 dinosaur. OTOH, we've just migrated from PB 10 to shiny new PB 11.5, and it has the worst IDE I have ever used. As a programmer, I'm embarrassed to see such am awful software. Sybase should be ashamed of themselves, releasing such a lousy product.
# eran
No i meant table only.
Two windows are using different datawindow and for these datawindow it is using same table.
So if we change in one window it wont reflect that change in other window if it opened one.