PlayModule with loop

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

PlayModule with loop

Post by Lebostein »

... :roll:
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

:roll:
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Post by Lebostein »

I hope your :roll: means a new constant #PB_Module_Loop for the changed command PlayModule(#Module [, Flags]) ... I hope ...
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post by Foz »

Two methods spring to mind - one cross platform and the other windows only.

Cross Platform:
Hold a database stating the length in milliseconds of each module. Use a timer and SetModulePosition(0) when the time is hit.

Windows Only (not tried it as I have linux), but in theory should work...):
Use the DirectX Sound dll to check if sound is still playing, if not, then SetModulePosition(0).
See here: http://www.purebasic.fr/english/viewtop ... 673#222673
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Lebostein wrote:I hope your :roll: means a new constant #PB_Module_Loop for the changed command PlayModule(#Module [, Flags]) ... I hope ...
I think his " :roll: " means, you should be able to post at least one complete sentence if you wish something.
it is at least unpolite to put three words in a headline and only a "nerved" smily in the post.
so you see, Fred is friendly enough to give you a hint instead of just ignoring your affront....
oh... and have a nice day.
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Post by Lebostein »

Why I should repeat the headline in the thread? I don't need more words to describe my wish (I'am a man of few words, anyway).

PS: is this :roll: a nerved smily? I have choosed this cause the smily looks up to the title and then he smiles ... sorry for this disaccord

@Foz: yes, this is the solution, that I use at the moment (see the code). But my intention to post my ideas and wishes here is a better PB ... when I need a workaround, then I use the "Coding Questions" board... thank you anyhow (sorry for my english)

Code: Select all

If GetModulePosition(#mod) = 255 And GetModuleRow(#mod) = 0: SetModulePosition(#mod, 0): EndIf
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

With the beta it should loop now, if you put a command in your module to do so. And yes 'rolling' is a nerved smiley.
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Post by Lebostein »

Thank You! Sorry for the nerved smiley. I will look for a manual for smilies ... :D
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

:roll:
Ahhh Fred... 100% accurate as always! :wink:
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

@Lebostein:
http://www.purebasic.fr/english/viewtopic.php?t=33769
and now it is very well fixed :D
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post by Foz »

It is a method, I'll give you that. Not my preferred one, but hey, I'm not the developer of PB. :)

Now I'll have to hunt out all the different tracker programs so I can add this... I've got Modplug Tracker, so my MOD files should be sorted.

Can anyone suggest good IT, XM and S3M trackers?

*** EDIT:
I'll just shut up now. Modplug Tracker also handles all of my other formats as well. I didn't realise that...
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Re: PlayModule with loop

Post by Lebostein »

Sorry for this 4.5 year old thread. But now, with the new ModPlug library, is there a possibility play a module in loop?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PlayModule with loop

Post by ts-soft »

A module with loop would loop without any flag.
A module without loop can't loop.

So simple use a module with loop or edit the module and set to loop.
Looping is a feature of module!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Re: PlayModule with loop

Post by Lebostein »

ts-soft wrote:A module with loop would loop without any flag.
A module without loop can't loop.

So simple use a module with loop or edit the module and set to loop.
Looping is a feature of module!
OK. Would be nice if this would be a side note in the documentation...
Post Reply