Computer Science Canada Media Player Help |
Author: | Anonymous [ Thu Jun 22, 2006 4:23 pm ] | ||
Post subject: | Media Player Help | ||
Ok, here is a media player I'm making so it doesn't hog up as much power as Windows Media Player. But I'm having one small problem. I'm using setscreen("text"), and I was wondering how do I locate when I ask the user to enter a song back in the same position in "Selective mode", so I can remove the "Press Any Key To Exit, and just have the "Play which song" looping in 1 spot, and maybe have a press q to quit thing., so the user can switch tracks. PS: It's still in proggress, I will make it more fancy maybe later on and add buttons or something.
|
Author: | Anonymous [ Thu Jun 22, 2006 4:34 pm ] |
Post subject: | |
Also, how would I locate so I can remove the .mp3 when I display the files in "Sequential and Selective" modes. Times like this I wish there was an edit button... Cause I had to delete my first post and this post once each to edit them. |
Author: | aldreneo [ Thu Jun 22, 2006 6:48 pm ] | ||||||||
Post subject: | |||||||||
Sorry, don't have an answer for you....But I agree this section of the forums needs an edit button...You would not beleve how many times I see someone correct a problem with his or her code such as something like this:
or
or
or
|
Author: | Delos [ Thu Jun 22, 2006 7:02 pm ] | ||
Post subject: | |||
If you mean using locate() as in:
then I'm afraid that won't work in text-mode. There's a reason why it's called that ! Locate's are essentially a graphical manipulation of the screen, hence you have to do them in graphics mode. I don't see any problem with using graphics-mode over pure-text, since it offers your that flexibility while maintaining the minimalistic style of text-only. @Edit button question - and just as many times as you've seen such questions, we've heard this same question. The answer is simple - not likely. It was removed a while ago for reasons of wanton abuse. That's pretty much all there is to it...but of course there still is that ever-useful Preview button whose use would somewhat diminish the need of an Edit button... |
Author: | Dan [ Thu Jun 22, 2006 7:24 pm ] |
Post subject: | Re: Media Player Help |
vahnx wrote: Ok, here is a media player I'm making so it doesn't hog up as much power as Windows Media Player.
Sorry to break it to you but a "hello world" program in turing with a loop of any kind that dose not exit right away will take up as much if not more power then windows media player cpu wise. Memeory wise it might be close but turing loads alot of undeed things, esptaly when made in to an exe. |
Author: | Clayton [ Thu Jun 22, 2006 8:35 pm ] | ||
Post subject: | |||
@Delos: it most certainly does
will output Hello World at the top left hand corner of the screen. I think you are thinking of locatexy, which locates in pixels, not columns and rows, which is what text mode uses , one character takes up one row and one column (ie. "L" at (1,1) will take up column 1 and row 1), in text mode instead of using maxx and maxy you use maxrow, and maxcol |
Author: | Delos [ Thu Jun 22, 2006 9:13 pm ] | ||
Post subject: | |||
Curious. This does not work:
And neither does your code. You'd better double check to make sure. It crashes with: Error.LastMsg wrote: Output from "Text.Locate" cannot be sent to a text window. |
Author: | Clayton [ Thu Jun 22, 2006 9:54 pm ] |
Post subject: | |
hm, that is weird, it works on my computer, i dont know why it wouldnt on yours, good luck finding out why |
Author: | Anonymous [ Thu Jun 22, 2006 10:39 pm ] |
Post subject: | |
=(, Maybe instead of text I could use graphics... I will needa find out how to scroll tho, using the scrolly commandy thingy, whatever. |
Author: | Delos [ Fri Jun 23, 2006 9:13 am ] |
Post subject: | |
SuperFreak82 wrote: hm, that is weird, it works on my computer, i dont know why it wouldnt on yours, good luck finding out why
Though it should make no difference, what version of Turing are you running? |
Author: | Anonymous [ Fri Jun 23, 2006 11:44 am ] | ||
Post subject: | Back To My Media Player... | ||
Ok, here is my Media Player So Far. I was wondering, how exactly do I scroll? I'm new to this GUI.Scroll thing, and I'm trying to use the increments, but the Help menu doesn't give me an example of GUI.**ScrollButtonFull. Also, after I'm done scrolling, how would I allow the user to still Input, then if they don't want an Input, they can still scroll without having to enter an Input. Because once I have my Input statement, it doesn't allow me to scroll because it's waiting for an input.
|
Author: | Delos [ Fri Jun 23, 2006 12:26 pm ] |
Post subject: | |
GUI scrolling must be done with GUI objects. Right now, you're working with text objects. I'm afraid you can't have both - you have to choose. Either the minimalistic and functional advantage of text, or the prettiness and brain-busting of GUI. If you do decide to go for the latter, my advice to you is not to use the Turing GUI. You are a competent enough programmer to create your own GUI - in fact, this will essentially allow you to get as close to the above mentioned compromise as possible. Creating a scroll box won't be too difficult, as far as such things go. Simply have a flexy array of each line, and some mouse-activated arrows that allow you to determine which lines are displayed. As a related aside - one of the primary reasons why I discourage Turing GUI use is its own issues with itself. You've likely heard of instances where one programme causes another to have a hissie fit, but in Turing's case, one object in the GUI is incompatible with another. I forget exactly which ones were involved, but I think it was a text box and a text field - put them together wrongly and they simply wouldn't work. These sorts of problems are avoidable if you can recreate your own customizable content. Check out Cervantes' custom text fields if you want a great example of what custom GUI looks like. (AFAIK, the S-Engine isn't custom GUI, it's just the standard one skinned - but I may be wrong). |
Author: | Anonymous [ Fri Jun 23, 2006 10:40 pm ] | ||
Post subject: | Ok All Good So Far | ||
I was wondering, what's wrong with line 97 of this code. If you remove the Return on Music.PlayFileReturn, it works fine when you type the ID number. Otherwords, it doesn't play the song at all. (The message you get is true because the song you entered was a number if it's Music.PlayFileReturn.) I use mostly text mode.
|
Author: | Anonymous [ Fri Jun 23, 2006 10:53 pm ] |
Post subject: | |
PS: I need to use PlayFileReturn so you can end the song at any time. Also, Music.PlayFile works fine, except for the fact I want to be able to end the song right away. I don't know why Music.PlayFileReturn would act up like this, could it be a Turing bug? |
Author: | Anonymous [ Tue Jul 04, 2006 11:07 pm ] |
Post subject: | |
Can anyone help me, it's been over a week and still no help. |
Author: | Cervantes [ Wed Jul 05, 2006 8:59 am ] |
Post subject: | |
SuperFreak82 and Delos: Regardless of how locate works for either of you in text mode, the fact is that it shouldn't work in text mode. Text mode is supposed to be like running your Turing program through the command line: all you can do is output text, line by line. No fancy graphics, no fancy text relocation. vahnx: I'm having trouble reproducing your bug. Also, you should let the user specify where his music files are. Frankly, my windows partition is on F:\, and even if I changed it to that, I still don't keep my music files in ~\My Documents\My Music. |
Author: | Anonymous [ Wed Jul 05, 2006 9:18 pm ] | ||
Post subject: | |||
Ok for reassurance about the bug I recieve, I'm using Turing 4.1. Look down to line 97 where all the "////////////////" stick out. Excecute my code and press '2' then '2' to get into text mode and selective. Put a few songs in the directory, and it should see them. Each song has a number that represents it. When it says "Play which song?", enter a number that corrisponds with a song. It wont recognize it! But now, change "Music.PlayFileReturn" to "Music.PlayFile", and enter the same number you entered before which corrisponded with the song! Explain that to me please... Music.PlayFileReturn won't see the file, and Music.PlayFile does... (PS Let me use the EDIT feature in the help menu, I prieview and it looks fine, and I dont notice errors in my posts til like 10 minutes later and stuff, I deleted copied and re-put html for this post 3 times now, and it happens lots. I wont abuse it like newbies to the site, I dont feel embarassed about why I need help and wouldnt edit my original help topics, I just need it to touch up spelling errors and wrong code posted)
|
Author: | Cervantes [ Wed Jul 05, 2006 9:32 pm ] | ||||
Post subject: | |||||
vahnx wrote: (PS Let me use the EDIT feature in the help menu, I prieview and it looks fine, and I dont notice errors in my posts til like 10 minutes later and stuff, I deleted copied and re-put html for this post 3 times now, and it happens lots. I wont abuse it like newbies to the site, I dont feel embarassed about why I need help and wouldnt edit my original help topics, I just need it to touch up spelling errors and wrong code posted) Help menu? Anyways, I don't think it would be easy to give just you access to this, without making you a mod, which would only allow you to edit your posts because you can edit everybody's posts. As for your code, I can now get the bug. However, I get the same, "File does not exist" message regardless of whether I'm using Music.PlayFile or Music.PlayFileReturn? Could you explain these lines of code?
Specifically, the for loop. It looks extremely inefficient. First, why not move that if strintok outside of the for loop? song is not altered by any code in that for loop, so the conditional strintok (song) doesn't ever change, so why recalculate it over and over again? Second, why do you have a for loop in the first place? How about something like this:
That should be identical, except without all the needless iteration. |
Author: | Anonymous [ Thu Jul 06, 2006 11:23 pm ] |
Post subject: | |
I have no idea why I did that. Im losing my Turing skills I think, lol. I havent been using it for while. |