노래재생바의 오류를 정확히 알았습니다..
보물선
일단 첫번째 노래가 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
| 번호 | 제 목 | 글쓴이 | 날짜 |
|---|---|---|---|
| 2752057 | 비주얼베이직도 오토핫키처럼 | 연블랙 | 2026-10-20 |
| 2752032 | 폴더 안에 있는 파일 전체 삭제기 만드는... ㅜㅠ | 징징몬 | 2026-10-20 |
| 2752001 | 웹호스팅연결 | 핀아 | 2026-10-20 |
| 2751918 | 라벨 질문 | 천사 | 2026-10-19 |
| 2751889 | 오른쪽 하단에 옵션 넣는것들이 없어짐... | 키클 | 2026-10-19 |
| 2751858 | dll 인젝터 만드는데 오류가 뜨네요.. 수정할 곳이 어디인가요? (1) | 내담 | 2026-10-18 |
| 2751740 | 커맨드 버튼 질문 | 개럭시 | 2026-10-17 |
| 2751716 | 정말궁금하네요 이름변경법.. (1) | 모든 | 2026-10-17 |
| 2751656 | 비베 고수님 도와주세요 (1) | 민아 | 2026-10-17 |
| 2751554 | 버튼누를시.. (3) | 오미자 | 2026-10-16 |
| 2751529 | 사진파일 속성 캐오기. (4) | 회전력 | 2026-10-15 |
| 2751446 | 주소이동 만드는것 질문요 | 고독 | 2026-10-15 |
| 2751413 | 컴퓨터종료 모든 OS에서 되는소스 | 펴라 | 2026-10-14 |
| 2751383 | 아이콘 없는 exe파일에 아이콘넣는방법 뭔가요?? (1) | 볼수록매력 | 2026-10-14 |
| 2751329 | 타이머와 command버튼으로 shap움직이기 관련 질문이요!! | 비사벌 | 2026-10-14 |
| 2751302 | FreeLibraryAndExitThread API 활용법좀... (2) | 횃불 | 2026-10-13 |
| 2751274 | 어떤값을 어떻게 대입해야되는지좀 알려주세요 | 낮선검객 | 2026-10-13 |
| 2751245 | 트레이 아이콘으로 바꾸기 어떻게 하나요..? | 꿈빛 | 2026-10-13 |
| 2751189 | 비베 인증확인후 주소... (4) | 큰힘 | 2026-10-12 |
| 2751160 | Pid 구하는법좀... (1) | 루라 | 2026-10-12 |
