mp3 player

Just starting out? Need help? Post your questions and find answers here.
Bong-Mong
User
User
Posts: 35
Joined: Sat Jan 03, 2004 6:53 pm

mp3 player

Post by Bong-Mong »

this is what i been dong,
http://www.geocities.com/metrogta2004/index.html
please can you help me get it to compile standards

i want to have a button on window_0,
when button is press new window opens called Fader, and window_0 duplicates its self, so i then will have 3x windows open.
2x players, 1 fader window.
fader window only had three functions,

trackbarplayer1 = volume
trackbarplayer2 = volume
fadertrackbar controls trackbarplayer1/trackbarplayer2

Code: Select all

Enumeration 
  #Window_0 
EndEnumeration 

;- Gadget Constants 
; 
Enumeration 
  #TrackBar_fade 
  #TrackBar_lplayer 
  #TrackBar_rplayer 
EndEnumeration 

OpenWindow(#Window_0, 310, 74, 545, 259,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "bongmong") 
CreateGadgetList(WindowID()) 
TrackBarGadget(#TrackBar_fade, 90, 100, 370, 80, 0, 100) 
SetGadgetState(#TrackBar_fade,50) 
TrackBarGadget(#TrackBar_lplayer, 20, 30, 70, 220, 0, 100, #PB_TrackBar_Vertical) 
SetGadgetState(#TrackBar_lplayer,50) 
TrackBarGadget(#TrackBar_rplayer, 500, 30, 70, 220, 0, 100, #PB_TrackBar_Vertical) 
SetGadgetState(#TrackBar_rplayer,50) 
Repeat 
  EventID = WaitWindowEvent() 
  Select EventID 
    Case #PB_EventGadget 
      Select EventGadgetID() 
        Case #TrackBar_fade 
          result = GetGadgetState(#TrackBar_fade) 
          SetGadgetState(#TrackBar_lplayer,result) 
          SetGadgetState(#TrackBar_rplayer,100-result) 
      EndSelect 
  EndSelect 
Until EventID = #PB_EventCloseWindow
my player is fine when opened twice, no strings conflick.
i have tried for a few days by adding all the code for window_0 again under the Case #duplicate in window_0,

it worked but conflicked.

so im hoping for a button on window_0 to open fader bar and duplicate window_0, the faderbar needs to be able to setgadgetstate on playerleft and playerright

is it coded into one, or can i use addon's
Last edited by Bong-Mong on Fri Jan 16, 2004 2:35 pm, edited 1 time in total.
1.3AMD, 2x 256 sdr, 32 AGP
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

*post redundant, as the above has been changed*
Last edited by LarsG on Fri Jan 16, 2004 2:59 pm, edited 1 time in total.

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

here is my code i posted earlier for cloning a window exactly--hope this helps:

Code: Select all


; PureBasic Visual Designer v3.82 build 1344 

Global window,button,frame 
;- Window Constants 
; 
Enumeration 
  #Window_0 
EndEnumeration 

;- Gadget Constants 
; 
Enumeration 
  #Button_0 
  #Frame3D_0 
EndEnumeration 

window=#Window_0   ;set our variable starting with the original values 
button=#Button_0   ; 
frame=#Frame3D_0   ; 
Procedure Open_Window_0() 
  Windowtext$="Window" +" " + Str(window+1) 
  If OpenWindow(window, 216, 0, 600, 300,  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar , Windowtext$) 
    If CreateGadgetList(WindowID()) 
      ButtonGadget(button, 80, 100, 120, 40, "Clone Me!!!") 
      Frame3DGadget(frame, 30, 60, 230, 140, "Button") 
      
    EndIf 
  EndIf 
  window=window+1 ;now we add 1 to the values we set before so we dont reuse them 
  button=button+2 ; we make sure we step 1 above the follwing frame gadget value 
  frame=frame+2   ; 

EndProcedure 

Open_Window_0() 

Repeat 
  
  Event = WaitWindowEvent() 
  
  If Event = #PB_EventGadget 
    
    ;Debug "WindowID: " + Str(EventWindowID()) 
    
    GadgetID = EventGadgetID() 
    
    For a=0 To button Step 2 ;since #button_0 = 0 at the beginning, we have to step 2 values above because 
      If GadgetID=a         ;frame3d_0 is always button+1 
          Open_Window_0() 
        EndIf 
      Next 

    
  EndIf 
  
Until Event = #PB_EventCloseWindow 

End 

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
Bong-Mong
User
User
Posts: 35
Joined: Sat Jan 03, 2004 6:53 pm

Post by Bong-Mong »

i was ment to send you a message saying thanks.

i tried the code and it works, i have been tring to use it since the post.
but not sure how to use this in my code,
because im loading files to strings,
will each player need a different string?
and i will need to disable some gadgets on cloned window,
1.3AMD, 2x 256 sdr, 32 AGP
Post Reply