I have to make an MP3 player that can work on 3 different ways.
- You click, it plays, you click again, it pauses
- You hold down the mouse, it plays, you release the mouse, it pauses
- A timer, you can set up a timer to pause it up to 60 seconds, with a scrollbar or something appearing to select a amount of seconds to play until it pauses.
I figured I can do the playing options in a groupbox but I have no idea how to do any of this.
Also, I'm not supposed to use a button to play and pause, I have to do this all by clicking the form itself. But I have no idea how to do all of this.
Also, when the form starts it has to open a map in which you can select MP3's, but I can't get this to work either. If someone can help me, you have my eternal gratitude.
Jump to Post
Take a look in the Object Inspector at the events for the form. It has OnClick, OnMouseDown, OnMouseUp events that you can use to start/pause/stop the play. The Shift parameter to the OnMouseDown and OnMouseUp event handlers tells you which mouse button was pressed so you could use the left …
Jump to Post
Simon, that is a nice and simple approach, better in many ways than changing the event handler. I should have seen that but I focused too much on Michaël's syntax errors rather than his logic. Good catch anyway.
One trivial issue with this code is that the TMediaPlayer already keeps …
All 7 RepliesReply to this topic
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.