Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Animation pausing and volume issues?

Author
Message
Confused1612
14
Years of Service
User Offline
Joined: 9th Feb 2012
Location:
Posted: 28th Mar 2012 03:26
I am in a class teaching the basics of DarkBasic Pro. Earlier this semester we made a program that would play an audio file along with the ability to pause/resume, mute/unmute, play from beginning, and adjust volume up and down. This week we had to make a basic game, but she also gave us a chance to earn some bonus points by converting the music player to play a video clip instead and she wants us to have the same abilities as above.

I thought this should work but for some reason it doesn't work except for the play from beginning. Can anyone tell me what is wrong with my code?
Confused1612
14
Years of Service
User Offline
Joined: 9th Feb 2012
Location:
Posted: 28th Mar 2012 17:31
Anybody?
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Mar 2012 00:05
I'm surprised no-one has already answered this for you. It's usually very quick off the mark for responses... Unless some don't know..

Video payback as far as I know has extremely limited functionality. ie. PLAY, STOP. That's it I believe. Unless there is a plugin. (I wanted to do one a while ago but as usual got distracted). From beyond Direct X 9 video playback was not supported.

Actually, I believe it may be time for some one to get a plugin together that can turn DBP into a media player.

Sorry I couldn't help...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 29th Mar 2012 06:04 Edited at: 29th Mar 2012 06:05
um it works fine with a few changes, i am in a rush to go so i havent cleaned this up, but you can go back to using no backdrop if you like, i just needed to read fps properly so i could set suitable increments for volume so its got boundaries and doesnt change at the frame rate of max frames - my machine does it over 1000fps so with your code it went from 0 to 100 in 1 press
edit - read remmed out notes to see differences in code

Confused1612
14
Years of Service
User Offline
Joined: 9th Feb 2012
Location:
Posted: 29th Mar 2012 08:16
Thanks, this has pause/resume working but volume up/down and mute/unmute still don't work. I don't get errors when I try to adjust volume, just nothing at all happens. Any ideas?
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 29th Mar 2012 09:52
hmmm - it works fine for me, only the pause didnt work for me and the restart anim only sometimes worked with your first snippet. I suggest you check all your volume levels in your playback software - 1 level can affect another ie if your media players at 50% volume and divx at another then the result can be a comined result - doesnt happen for me with win7 at all but used to happen a lot with xp which i found bloody annoying to say the least. failing that all i can think of is direct x needs updating or maybe the dbp you use needs upgrading - Im using u7.5
Confused1612
14
Years of Service
User Offline
Joined: 9th Feb 2012
Location:
Posted: 29th Mar 2012 14:23
I am on a Windows 7 machine and I am not using any special playback software. I am using the free version and it says I am up to date, which according to the "About DarkBasic Professional" is version 1.071. Maybe that is the problem, anybody with the free version care to try this out and see if it works for them? If not maybe they removed that from the free version.
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 29th Mar 2012 14:40 Edited at: 29th Mar 2012 14:45
does the free one allow for upgrades? idk worth a try though;
http://www.thegamecreators.com/?m=view_product&id=2000&page=upgrade7-61
choose what update you want from blue highlighted text if no luck with latest(assuming free version can be upgraded) some things may be broke in 1 and not another, nature of fixes, hard to say what as i havent been keeping up with it, 7.5 does for me, havent tried 7.6
Edit - bit of a stab in the dark but maybe its codecs? do you have codecs that play most dvds and animation files? like i said a stab in the dark as you obviously have visual, but i do recall some claimed to be "all in 1" type codec packs dont have actually all codecs there an i do remember playing some older dvds once and there was no sound until i switched codec packs
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Mar 2012 14:41
U77 HERE

seriously it is not that difficult... it is a sticky right at the top...

James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 29th Mar 2012 14:49
be aware though that 7.7 as its a release candidate, this defo works for me on 7.5 i would say try this instead - but then if it runs fine and works under 7.7 for mr valentine then ignore me
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Mar 2012 15:20 Edited at: 29th Mar 2012 15:24
pause play mute [up for unmute] and volume is strangely limited cant put it lower lol...

no issues on U77 for me I even loaded a .mp4 and it loads a second screen to play it so I have to use the first window to use the controls... maybe this is the issue you are facing? try to run it in window mode and check to see if your video loads in a second window I do not know on older releases as I always use up to date software...

EDIT

I need some food lol, ok looked closer at your code indeed M and U work fine, I can not see any on screen data but I can play pause etc and I realised you limited the sound, so no issues much here aside from not being able to see the on screen text...

James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 29th Mar 2012 15:51
up for unmute? are you sure the volume wasnt already at 85 - it starts at 85(i put limit in based on helpfile - if you wanted volume any lower then mute would be used anyway for ease) maybe your keyboard isnt a standard one or you have it setup as american? what you say suggests an issue with the keystates which i have never had issues with before at all
i dont think Confused has issues with the avi appearing and playing just the sound and actions related to playback etc, i altered it so i could read frames per second as the original method doesnt allow for that as the backdrop was off so the readout becomes scrambled quickly, i needed to see the fps because it had to be capped without using the sync rate commnad as that command stops visual playback from appearing unless the sync rate is 0, however i forgot that using text with a capped framerate will auto cap it to around 30fps anyway, original code ran at over 1000 fps for me so when i press up once volume is at max straight away whereas with a smaller increment/decrement on lower fps makes slower more suitable transition, obviously you would use the value of 15 to work out percentage and put a nice little slide bar there instead, its weird how the volume isnt audable below 85 yet support is for value to zero, but thats what the helpfile says :o
I just tried fullscreen, everything works for me still, I even tried different ides on the off chance but no cookies, everything works still
Confused you might wanna recheck your keystates - did you get them from information or did you test them yourself? ie run following and press relevant keys - number shows on screen of keystate value for that key
sync on
do
cls
set cursor 0,0
print scancode()
sync
loop
Confused1612
14
Years of Service
User Offline
Joined: 9th Feb 2012
Location:
Posted: 29th Mar 2012 16:15
It looks like I should be able to update. I tried it on a VM I have at work and it updated fine, so I will update when I get home and let you know whether or not that fixes my issues.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Mar 2012 16:29
James H, huh?

nothing wrong with my KB, I just did not read your code fully, just added my own .svi and .mp4 files, I did update my last posting...

James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 29th Mar 2012 16:33
lol i had the page open ages and didnt refresh and didnt see your edit, I also been up all night hehe sorry bud
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Mar 2012 16:35
thats OK

This is interesting code so I took the effort to try it out, but I am certain there are easider ways to do this, I recall from the Hands On Dark Basic Pro [sheesh] books that the commands for playback control were simple and there is even DVD playback controls in DBPro...

Confused1612
14
Years of Service
User Offline
Joined: 9th Feb 2012
Location:
Posted: 30th Mar 2012 20:14
I updated to 7.61 and it works, sort of. I had one project "Movie Player" that consisted of my original code I posted, then I had the code posted above by James H in a separate project called "Test Animation." Anyway, the "Test Animation" project works perfectly, so I made the necessary changes to the "Movie Player" project but it still didn't work. So, I copied the entire code from the "Test Animation" and pasted it over the code used in "Movie Player" but it still didn't work. Identical code and identical video, anyone have any ideas why one works but not the other? I will probably just end up submitting the "Test Animation" project because it works but I just don't know why the other one doesn't.
Confused1612
14
Years of Service
User Offline
Joined: 9th Feb 2012
Location:
Posted: 30th Mar 2012 20:17
When I get off work I plan to start a brand new project, copy the code and movie over from the "Test Animation" project and see if that works. I will post back after I do to let you know.

Login to post a reply

Server time is: 2026-07-09 21:19:21
Your offset time is: 2026-07-09 21:19:21