Search found 17 matches

by khalidel
Fri Apr 26, 2019 4:09 pm
Forum: Coding Questions
Topic: mci status
Replies: 7
Views: 1623

Re: mci status

Hi,

a fast coded test:

#Filename$ = "c:\tmp\bkk.wav"



mciSendString_("close MediaFile", #Null, 0, #Null)


error = mciSendString_("open " + #DQUOTE$ + #FileName$ + #DQUOTE$ + " alias MediaFile", #Null, 0, #Null)
If error = 0

error = mciSendString_("play MediaFile", #Null, 0, #Null)
If ...
by khalidel
Fri Apr 26, 2019 12:32 pm
Forum: Coding Questions
Topic: mci status
Replies: 7
Views: 1623

Re: mci status

So you mean not debug,
you mean:

Show me a working example code which makes use of the status mciSendString_() parameter.

Is this correct?

You know that this will never work with the Demo version of PB?

debug is to correct wrong code of a program. yes, i know that. am not on demo. i want to ...
by khalidel
Fri Apr 26, 2019 11:26 am
Forum: Coding Questions
Topic: mci status
Replies: 7
Views: 1623

Re: mci status

Sorry, no.

Because this code is not working.
So what should I debug :?:

hello, to debug means make it work using mci_status_mode and mci_mode_play or pause using the correct pb code. i found examples in other programming languages but not in pb. the aim is to pause a sound when it's played and ...
by khalidel
Thu Apr 25, 2019 9:55 pm
Forum: Coding Questions
Topic: mci status
Replies: 7
Views: 1623

mci status

hello friends, please can someone debug this piece of code

If file
IF mci("status "+file) = mci_mode_play
mci("pause "+file)
elseif mci("status "+file) = mci_mode_pause
mci("resume "+file)
endif
endif


i don't know how to combine mci_status_mode with the constant mci_mode_play or pause to work ...
by khalidel
Wed Apr 03, 2019 12:16 pm
Forum: General Discussion
Topic: question about mci
Replies: 14
Views: 3710

Re: question about mci

Life is much easier with the full version and having direct access to API commands.
Best to buy full version :)


#Lib=0

Procedure.i Mci(command.s)
buffer.s=Space(256)
ProcedureReturn CallFunction(#Lib,"mciSendStringW",@command,@buffer,256,0)
EndProcedure

If OpenLibrary(#Lib, "winmm.dll ...
by khalidel
Wed Apr 03, 2019 11:30 am
Forum: General Discussion
Topic: question about mci
Replies: 14
Views: 3710

Re: question about mci

User_Russian wrote:
khalidel wrote:but have you tested it because it is still not accepted in demo.
Yes. I tested in demo 5.50 Win x86 and 5.70 Win x86. The code compiled without errors and worked fine.
sorry you are right. it works well with demo. best regards
by khalidel
Tue Apr 02, 2019 9:47 pm
Forum: General Discussion
Topic: question about mci
Replies: 14
Views: 3710

Re: question about mci

Prototype mciSendString(lpszCommand.p-unicode, *lpszReturnString=0, *cchReturn=0, *hwndCallback=0)

If OpenLibrary(0, "winmm.dll")
mci.mciSendString = GetFunction(0, "mciSendStringW")
If mci
File.s = OpenFileRequester("", "", "Music|*.wav;*.mp3", 0)
If File
mci(~"open \""+File+~"\" type ...
by khalidel
Sun Mar 31, 2019 4:21 pm
Forum: Coding Questions
Topic: waitprogram and programrunning
Replies: 4
Views: 1627

Re: waitprogram and programrunning

very nice. thank you very much. i adapt this code to mine with some changes and it works fine. i change delay(100) to delay(1000) and i use the procedure to count elapsed time, then i add some calculations to case thread to get minutes and seconds.
by khalidel
Sat Mar 30, 2019 9:55 pm
Forum: Coding Questions
Topic: waitprogram and programrunning
Replies: 4
Views: 1627

waitprogram and programrunning

hey programmers, i run a program with runprogram and i want to show a waiting message like "please wait) because waitprogram freezes the system and i tried with while but still blocking.

p = RunProgram("prog.exe", "/?", "", #PB_program_open|#pb_program_hide)
if p
while programrunning(p ...
by khalidel
Sat Mar 30, 2019 1:07 pm
Forum: General Discussion
Topic: question about mci
Replies: 14
Views: 3710

Re: question about mci

hello friends, thank you. so can you help with this uncomplete code

Code: Select all

openlibrary(0, "winmm.dll")
callfunction(0, "mcisendstring")
mci("play")
mci("stop")
closelibrary(0)
please debug this code to work on demo.
regards
by khalidel
Wed Mar 27, 2019 10:38 am
Forum: General Discussion
Topic: question about mci
Replies: 14
Views: 3710

Re: question about mci

Olliv wrote:You cannot use them without buying the license.
thank you for your reply
by khalidel
Wed Mar 27, 2019 12:01 am
Forum: General Discussion
Topic: question about mci
Replies: 14
Views: 3710

question about mci

hello pb family, i am a new user of pb just one month and i often face this term mci so : 1/ what is mci? 2/ can i use it as pb demo user? 3/ if yes, how can i use it?
best regards
by khalidel
Sun Mar 24, 2019 11:33 am
Forum: Coding Questions
Topic: add loaded image to drawimage
Replies: 9
Views: 2085

Re: add loaded image to drawimage

When playing with images or drawings I allways prefer to see what is going on.

Create a window with an image gadget to load your created image. Allways run the code with debugger enabled.

This code creates a window loads bouquet.jpg shows what you have drawn then saves into the same folder as the ...
by khalidel
Sun Mar 24, 2019 12:52 am
Forum: Coding Questions
Topic: add loaded image to drawimage
Replies: 9
Views: 2085

Re: add loaded image to drawimage

@khalidel
Try the next snippet
Your image will be saved into your Home Directory because maybe you are not authorized to Save in your Current Directory

UseJPEGImageDecoder()
UseJPEGImageEncoder()
LoadImage(0, "bouquet.jpg")

If CreateImage(1, 600, 600,24,$FFFFFF)
StartDrawing(ImageOutput(1 ...
by khalidel
Sat Mar 23, 2019 10:22 pm
Forum: Coding Questions
Topic: add loaded image to drawimage
Replies: 9
Views: 2085

Re: add loaded image to drawimage

Does the loading succeed? can you see it in the library viewer? (enable the debugger)
UseJPEGImageDecoder()
LoadImage(0, "bouquet.jpg") ; image existing at the same folder

Debug IsImage(0)
ShowLibraryViewer("image", 0)
CallDebugger

If CreateImage(1, 600, 600) And StartDrawing(ImageOutput(1 ...