수다닷컴

  • 해외여행
    • 괌
    • 태국
    • 유럽
    • 일본
    • 필리핀
    • 미국
    • 중국
    • 기타여행
    • 싱가폴
  • 건강
    • 다이어트
    • 당뇨
    • 헬스
    • 건강음식
    • 건강기타
  • 컴퓨터
    • 프로그램 개발일반
    • C언어
    • 비주얼베이직
  • 결혼생활
    • 출산/육아
    • 결혼준비
    • 엄마이야기방
  • 일상생활
    • 면접
    • 취업
    • 진로선택
  • 교육
    • 교육일반
    • 아이교육
    • 토익
    • 해외연수
    • 영어
  • 취미생활
    • 음악
    • 자전거
    • 수영
    • 바이크
    • 축구
  • 기타
    • 강아지
    • 제주도여행
    • 국내여행
    • 기타일상
    • 애플
    • 휴대폰관련
  • 프로그램 개발일반
  • C언어
  • 비주얼베이직

노래재생바의 오류를 정확히 알았습니다..

보물선

2023.04.01


일단 첫번째 노래가 3분 : 30초의 노래고두번째 노래가 3분 : 10초 의 노래라고 치면
첫번째 노래가 재생되고 재생바가 3분 30초까지 갑니다.잘되구요두번째 노래가 재생되면 3분 10초인데 3분 10초까지 가서 재생바가 끝가지가야하는데
3분 30초에서 다음으로 넘어가니 3분 30초의 슬라이더바가 값이 계속 지정되잇는지
3분 10초 지점에서 끝나되 나머지 20초부분은 빈공간으로 됩니다.
반대로
3분 10초의 노래를 먼저 하고 하면 3분10초까지 재생바가끝가지 잘갑니다근데 3분 30초의 노래를 하면 3분 10초에서 재생바가 끝나버려서 20초가 안되니 오류가 나버립니다.
소스 아래 동봉합니다..몇번이고 해결해봣지만 어디부분이 오류인지 모르겠습니다..
Private Sub Check3_Click()If Check3.Value = 1 ThenMsgBox 한곡반복재생을 멈추시려면 체크를 해제하신후 멈추시면 됩니다., vbInformation, 한곡재생ElseEnd IfEnd Sub
Private Sub Command1_Click()
CD1.Filter = 재생가능한파일|*.mp3;*.wav|모든파일|*.*CD1.CancelError = FalseCD1.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorerCD1.ShowOpen
If LstCheck(List2, CD1.FileName) = True ThenMsgBox 이미 리스트에 있는 노래입니다., vbInformation, 중복Elseadd_ListEnd If
Frame1.Caption = 노래 목록 & List1.ListCount & 개
End SubFunction add_List()sFile = Split(CD1.FileName, Chr(0))If UBound(sFile) 0 ThenFor i = 1 To UBound(sFile)List1.AddItem sFile(i)List2.AddItem sFile(0) & \ & sFile(i)Next iElseList1.AdList1.AddItem Left(CD1.FileTitle, Len(CD1.FileTitle) - 4)List2.AddItem CD1.FileNameEnd IfEnd Function
Private Sub Command2_Click()
If List1.List(i) = ThenMsgBox 노래목록을 불러와 주시기 바랍니다., vbInformation, 목록Else
If WindowsMediaPlayer1.URL = ThenMsgBox 노래를 선택해 주시기 바랍니다, vbInformation, 선택ElseTimer1.Enabled = TrueIf Command2.Caption = ▶ ThenWindowsMediaPlayer1.Controls.playCommand2.Caption = ⅡCommand2.ToolTipText = 일시정지Timer2.Enabled = TrueElseIf Command2.Caption = Ⅱ ThenWindowsMediaPlayer1.Controls.pauseCommand2.ToolTipText = 재생Command2.Caption = ▶End IfEnd IfEnd IfEnd Sub
Private Sub Command3_Click()WindowsMediaPlayer1.Controls.stopTimer1.Enabled = FalseLabel1.Caption = 00:00/00:00Command2.Caption = ▶End Sub
Private Sub Command4_Click()On Error Resume NextList1.ListIndex = List1.ListIndex - 1List2.ListIndex = (List2.ListIndex - 1) + 1End Sub
Private Sub Command5_Click()
On Error Resume NextList1.ListIndex = List1.ListIndex + 1List2.ListIndex = (List2.ListIndex - 1) + 1
End Sub
Private Sub Command6_Click()List1.ClearList2.ClearFrame1.Caption = 노래 목록End Sub
Private Sub Command7_Click()On Error Resume NextList1.RemoveItem List1.ListIndexList2.RemoveItem List2.ListIndexEnd SubPrivate Sub Command9_Click()If Command9.Caption = ▶▶ ThenWindowsMediaPlayer1.Controls.fastForwardCommand9.Caption = ◀◀Command9.ToolTipText = 빨리감기정지Timer2.Enabled = TrueElseIf Command9.Caption = ◀◀ ThenCommand9.ToolTipText = 빨리감기WindowsMediaPlayer1.Controls.playCommand9.Caption = ▶▶End IfEnd SubPrivate Sub Slider1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)WindowsMediaPlayer1.settings.volume = Slider1.ValueEnd Sub
Private Sub Slider2_Change()WindowsMediaPlayer1.Controls.currentPosition = Slider2.ValueEnd Sub
Private Sub Timer2_Timer()
If Label1.Caption 00:00/00:00 ThenSlider2.Max = WindowsMediaPlayer1.currentMedia.durationTimer2.Enabled = FalseEnd If
End Sub
Private Sub WindowsMediaPlayer1_PlayStateChange(ByVal NewState As Long)
If Check1.Value = 1 Then
If NewState = wmppsMediaEnded ThenIf List1.ListCount = List1.ListIndex + 1 ThenList1.ListIndex = 0List2.ListIndex = 0Exit SubEnd IfList2.ListIndex = List1.ListIndex + 1WindowsMediaPlayer1.URL = List2.List(List2.ListIndex)End IfElseEnd If
If Check3.Value = 1 ThenOn Error Resume NextWindowsMediaPlayer1.Controls.playElse
If NewState = wmppsMediaEnded ThenIf List1.ListCount = List1.ListIndex + 1 ThenList1.ListIndex = 0List2.ListIndex = 0Timer1.Enabled = FalseLabel1.Caption = 00:00/00:00Command2.Caption = ▶Exit SubEnd IfList1.ListIndex = List1.ListIndex + 1List2.ListIndex = (List2.ListIndex - 1) + 1WindowsMediaPlayer1.URL = List2.List(List2.ListIndex)End IfLabel2.Caption = 재생 중인 음악 :End If
End Sub
Private Sub List1_Click()
List2.ListIndex = List1.ListIndexWindowsMediaPlayer1.URL = List2.List(List2.ListIndex)WindowsMediaPlayer1.Controls.stopCommand2.Caption = ▶
End SubFunction LstCheck(LstBox As ListBox, StrChk As String) As Boolean If LstBox.ListCount = 0 Then LstCheck = False Exit Function End IfDim i As IntegerFor i = 0& To LstBox.ListCount - 1& If LstBox.List(i) = StrChk Then LstCheck = True Exit Function End IfNext iLstCheck = FalseEnd Function
Private Sub Timer1_Timer()
Label1.Caption = WindowsMediaPlayer1.Controls.currentPositionString & / & WindowsMediaPlayer1.currentMedia.durationStringSlider2.SelStart = WindowsMediaPlayer1.Controls.currentPositionIf WindowsMediaPlayer1.playState = wmppsReady Then WindowsMediaPlayer1.Controls.playLabel2.Caption = 재생 중인 음악 : & List1.List(List1.ListIndex)
If Check2.Value = 1 ThenWindowsMediaPlayer1.settings.mute = TrueElseWindowsMediaPlayer1.settings.mute = FalseEnd IfEnd Sub

신청하기





COMMENT

댓글을 입력해주세요. 비속어와 욕설은 삼가해주세요.

번호 제 목 글쓴이 날짜
2704558 전체 변수 선언 방법? (1) 사자자리 2025-08-11
2704530 여러분 급해요.. 시윤 2025-08-11
2704498 위대한 수다님들 질문하나할게요 (운영체제관련) (3) 아리에스 2025-08-10
2704474 사용자명 확인하기 예님 2025-08-10
2704446 블랙리스트 (3) 마루한 2025-08-10
2704392 비베 책 추천점해주세요~ 이플 2025-08-09
2704366 정말 궁금해서 물어봅니다 . agine 2025-08-09
2704339 서버on off 질문 (1) 2gether 2025-08-09
2704312 Microsoft Tabbed Dialog Control 6.0 질문 영미 2025-08-09
2704256 사이트 접속자... (1) 계획자 2025-08-08
2704228 채팅방 사이트 로그인소스하고 채팅방 접속소스좀.. (1) 초롱꽃 2025-08-08
2704197 커맨더 버튼 색깔변경 여자 2025-08-08
2704170 winhttp로 웹연동을 할수 있나요? (4) 나길 2025-08-07
2704063 고수분들 답변좀요 ~~~ 볼수록매력 2025-08-06
2704036 커맨드버튼 입체감 살리는법 알찬바로 2025-08-06
2704006 msgbox 내용 텍스트 박스로 출력하기 (2) 조으다 2025-08-06
2703955 네크워크 어댑터관련 질문입니당. 별햇님 2025-08-05
2703925 지금 매우 비효율적인 방법을 쓰고있는데요 쉬운방법 없을까요? (2) 리네 2025-08-05
2703870 리스트에있는것을클릭하고다운하기.... 핫자두 2025-08-05
2703838 어떻게 해야되나요? 환히찬 2025-08-04
<<  이전  1 2 3 4 5 6 7 8 9 10  다음  >>

수다닷컴 | 여러분과 함께하는 수다토크 커뮤니티 수다닷컴에 오신것을 환영합니다.
사업자등록번호 : 117-07-92748 상호 : 진달래여행사 대표자 : 명현재 서울시 강서구 방화동 890번지 푸르지오 107동 306호
copyright 2011 게시글 삭제 및 기타 문의 : clairacademy@naver.com