質問編集履歴

11

文の見直し

2018/04/25 11:19

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -296,6 +296,40 @@
296
296
 
297
297
  End Sub
298
298
 
299
+ ’再生
300
+
301
+ Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
302
+
303
+ player.StartPlayback()
304
+
305
+ End Sub
306
+
307
+
308
+
309
+ Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
310
+
311
+ player.PausePlayback()
312
+
313
+
314
+
315
+ End Sub
316
+
317
+
318
+
319
+ Private Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
320
+
321
+ player.ResumePlayback()
322
+
323
+ End Sub
324
+
325
+
326
+
327
+ Private Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click
328
+
329
+ player.StopPlayback()
330
+
331
+ End Sub
332
+
299
333
  End Class
300
334
 
301
335
 

10

修正

2018/04/25 11:18

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,17 +10,7 @@
10
10
 
11
11
  ##教えてほしい事
12
12
 
13
- 公式サイトからのコードを使ってます。
14
-
15
- リストボックスとテキストボックスを追加しました。
16
-
17
- 以前の投稿でリストボックスとテキストボックスを使いました。
18
-
19
- Zplayerからリストボックスに開いた曲を再生可能にしたい事です。
20
-
21
- ##元の参考したコードを追加しただけです。
22
-
23
- リストボックスとテキストボックス追加まし
13
+ リストボックスを選択する再生した
24
14
 
25
15
  ```
26
16
 
@@ -320,25 +310,51 @@
320
310
 
321
311
  ```
322
312
 
313
+ Dim IntSelectIndexPre As Integer = 0
314
+
315
+ Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
316
+
323
- ListBox1.SelectedIndex = player.StartPlayback
317
+ If ListBox1.SelectedItem <> "" Then
318
+
319
+ TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedItem)
320
+
321
+ End If
322
+
323
+ If IntSelectIndexPre = ListBox1.SelectedIndex Then
324
+
325
+ Exit Sub
326
+
327
+ End If
328
+
329
+ IntSelectIndexPre = ListBox1.SelectedIndex
330
+
331
+ '※
332
+
333
+
334
+
335
+
336
+
337
+ Timer1.Start()
338
+
339
+ Timer2.Start()
340
+
341
+ player.StartPlayback()
324
342
 
325
343
  ```
326
344
 
327
- リストを選択すると押され後消える現状
345
+ ##試し結果
346
+
328
-
347
+ ※の部分
348
+
349
+ player.AddFile(a(ListBox1.SelectedIndex), TStreamFormat.sfAutodetect)
350
+
329
- ```
351
+ ---
330
-
331
- player.StartPlayback()
352
+
332
-
333
-
334
-
335
- ```
336
-
337
- こちらも既に再生してと思われ出来ません
353
+ いろいろ試してやった所全くリストボックスを選択はされんですが選択後の
338
-
354
+
339
- くはないと思うんですが…
355
+ 再生がしないの無理なんでしょうか?
340
-
356
+
341
- 教えてください。
357
+ お願します
342
358
 
343
359
  ##開発バージョン
344
360
 

9

一文字修正

2018/04/25 10:51

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -286,7 +286,7 @@
286
286
 
287
287
  If ListBox1.SelectedItem <> "" Then
288
288
 
289
- TextBox1.Text = System.IO.Path.GetFileName(ListBox2.SelectedItem)
289
+ TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedItem)
290
290
 
291
291
  End If
292
292
 

8

文の追加

2018/04/24 12:38

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -254,66 +254,58 @@
254
254
 
255
255
  'リストボックスとテキストボックス追加しました。
256
256
 
257
- 'リストボックスとテキストボックスに表示されます。
257
+ 'リストボックスとテキストボックスに表示されます。(ボタン18)
258
258
 
259
259
  ElseIf LoadMode = 3 Then
260
260
 
261
+
262
+
261
- file = OpenFileDialog1.SafeFileNames
263
+ If Not (player.AddFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
262
-
263
- a = OpenFileDialog1.FileNames
264
+
264
-
265
- For b As Integer = 0 To file.Length - 1
265
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
266
+
266
-
267
+ Exit Sub
268
+
269
+ End If
270
+
271
+
272
+
273
+ showinfo()
274
+
267
- ListBox1.Items.Add(file(b))
275
+ player.StartPlayback()
268
-
276
+
277
+
278
+
269
- Next
279
+ End Sub
280
+
270
-
281
+ '曲を選択、リスト選択可能※
282
+
271
- ListBox1.SelectedIndex = 0
283
+ Dim IntSelectIndexPre As Integer = 0
284
+
272
-
285
+ Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
286
+
287
+ If ListBox1.SelectedItem <> "" Then
288
+
273
- TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedItem)
289
+ TextBox1.Text = System.IO.Path.GetFileName(ListBox2.SelectedItem)
274
290
 
275
291
  End If
276
292
 
277
- If Not (player.AddFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
293
+ If IntSelectIndexPre = ListBox1.SelectedIndex Then
278
-
279
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
294
+
280
-
281
- Exit Sub
295
+ Exit Sub
282
-
296
+
283
- End If
297
+ End If
284
-
285
-
286
-
298
+
287
- showinfo()
299
+ IntSelectIndexPre = ListBox1.SelectedIndex
288
-
300
+
289
- player.StartPlayback()
301
+ Timer1.Start()
302
+
303
+ Timer2.Start()
290
304
 
291
305
 
292
306
 
293
307
  End Sub
294
308
 
295
- '曲を選択、リスト選択可能※
296
-
297
- Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
298
-
299
- If ListBox1.SelectedItem <> "" Then
300
-
301
- 'ここにplayerを・・・
302
-
303
- TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedItem)
304
-
305
- Timer1.Start()
306
-
307
- Timer2.Start()
308
-
309
-
310
-
311
- Else
312
-
313
- End If
314
-
315
- End Sub
316
-
317
309
  End Class
318
310
 
319
311
 

7

一部修正

2018/04/24 12:09

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -86,24 +86,52 @@
86
86
 
87
87
  '''
88
88
 
89
-
90
-
91
89
  Public Delegate Sub SetTextCallback(ByVal text As String)
92
90
 
93
- Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
94
-
95
- LoadMode = 0
96
-
97
- OpenFileDialog1.ShowDialog()
98
-
99
-
91
+ 'addfileopenfiledialog複数開けます。
92
+
93
+ Dim a As String()
94
+
95
+ Dim file As String()
96
+
97
+ Private Sub Button18_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
98
+
99
+ LoadMode = 3
100
+
101
+ OpenFileDialog1.FileName = ""
102
+
103
+ OpenFileDialog1.Multiselect = True
104
+
105
+ OpenFileDialog1.Title = "開くファイルを指定"
106
+
107
+ OpenFileDialog1.Filter = "All Supported Files|*.mp3;*.mp2;*.mp1;*.ogg;*.oga;*.flac;*.wav;*.ac3;*.aac|Mp3 Files|*.mp3|Mp2 Files|*.mp2|Mp1 Files|*.mp1|Ogg Files|*.ogg|FLAC files|*.flac|Wav files|*.wav|AC-3|*.ac3|AAC|*.aac"
108
+
109
+ OpenFileDialog1.FilterIndex = 1
110
+
111
+ OpenFileDialog1.RestoreDirectory = True
112
+
113
+ If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
114
+
115
+ file = OpenFileDialog1.SafeFileNames
116
+
117
+ a = OpenFileDialog1.FileNames
118
+
119
+ For b As Integer = 0 To file.Length - 1
120
+
121
+ ListBox1.Items.Add(file(b))
122
+
123
+ Next
124
+
125
+ ListBox1.SelectedIndex = 0
126
+
127
+ TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedItem)
128
+
129
+
130
+
131
+ End If
100
132
 
101
133
  End Sub
102
134
 
103
- Dim a As String()
104
-
105
- Dim file As String()
106
-
107
135
  Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
108
136
 
109
137
  OpenFileDialog1.Multiselect = True

6

文の修正とコードを修正しました

2018/04/24 11:50

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,170 +10,318 @@
10
10
 
11
11
  ##教えてほしい事
12
12
 
13
+ 公式サイトからのコードを使ってます。
14
+
15
+ リストボックスとテキストボックスを追加しました。
16
+
17
+ 以前の投稿でリストボックスとテキストボックスを使いました。
18
+
19
+ Zplayerからリストボックスに開いた曲を再生可能にしたい事です。
20
+
21
+ ##元の参考したコードを追加しただけです。
22
+
13
- リストボックスには表示されました。
23
+ リストボックスとテキストボックス追加しました。
14
-
15
- 次の問題が発生しました。
24
+
16
-
17
- ---
25
+ ```
18
-
19
- 開いたファイルを選択しても不可に(エラー:Unknown file format.)
26
+
20
-
21
- ちょっと困りました。※2(コード書きます)
22
-
23
-
24
-
25
- 申し訳ございませんが宜しくお願い致します。
26
-
27
-
28
-
29
- ##dllが必要
30
-
31
-
32
-
33
- libZPlay-2.02-SDK (2.12 MB) -
34
-
35
- この中に入ってたlibezplay.dllをプロジェクト名フォルダのdebug¥にいれる
36
-
37
-
38
-
39
- ##修正したコード
40
-
41
- ```ここに言語を入力
42
-
43
- Imports Song_Music_Player.libZPlay
27
+ Imports MI_LIBZPLAY_AUDIO.libZPlay
28
+
29
+
44
30
 
45
31
  Public Class Form1
46
32
 
47
- 'Track1=AxWindowsMediaPlayer1
48
-
49
- Dim strFileName1 As String
50
-
51
- 'Track2=AxWindowsMediaPlayer2
52
-
53
- Dim strFileName2 As String
54
-
55
- 'LibZplayer
56
-
57
- Dim s22 As String
58
-
59
-
60
-
61
- '省略
62
-
63
- Private history3 As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase)
64
-
65
- 'Zplayeropenfiledialog
66
-
67
- Private Sub OpenFileDialog3_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog3.FileOk
68
-
69
-
70
-
71
- '省略
72
-
73
- ElseIf LoadMode = 3 Then
74
-
75
- '変更
76
-
77
- For Each strFilePath As String In OpenFileDialog3.FileNames
78
-
79
- s22 = IO.Path.GetFileName(strFilePath)
80
-
81
- TrC00.Items.Add(s22)
82
-
83
- If Not (player.AddFile(OpenFileDialog3.FileName, TStreamFormat.sfAutodetect)) Then
84
-
85
-
86
-
87
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
88
-
89
- Exit Sub
90
-
91
- TrC00.SelectedIndex = 0
92
-
93
- End If
33
+
34
+
35
+ Private player As ZPlay
36
+
37
+ Private LoadMode As Integer
38
+
39
+ Private ReverseMode As Boolean
40
+
41
+ Private Echo As Boolean
42
+
43
+ Private VocalCut As Boolean = False
44
+
45
+ Private SideCut As Boolean = False
46
+
47
+
48
+
49
+ Private NextSong As Boolean = False
50
+
51
+
52
+
53
+ Private FadeFinished As Boolean = False
54
+
55
+
56
+
57
+ ' need this for managed stream
58
+
59
+ Private fStream As System.IO.FileStream = Nothing
60
+
61
+ Private br As System.IO.BinaryReader = Nothing
62
+
63
+ Private BufferCounter As Integer
64
+
65
+
66
+
67
+ Private CallbackFunc As TCallbackFunc
68
+
69
+
70
+
71
+ Private BlockSlideLeft As Boolean = False
72
+
73
+ Private BlockSlideRight As Boolean = False
74
+
75
+
76
+
77
+ ''' <summary>
78
+
79
+ ''' Text callback
80
+
81
+ ''' </summary>
82
+
83
+ ''' <param name="text"></param>
84
+
85
+ ''' <remarks></remarks>
86
+
87
+ '''
88
+
89
+
90
+
91
+ Public Delegate Sub SetTextCallback(ByVal text As String)
92
+
93
+ Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
94
+
95
+ LoadMode = 0
96
+
97
+ OpenFileDialog1.ShowDialog()
98
+
99
+
100
+
101
+ End Sub
102
+
103
+ Dim a As String()
104
+
105
+ Dim file As String()
106
+
107
+ Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
108
+
109
+ OpenFileDialog1.Multiselect = True
110
+
111
+
112
+
113
+ If LoadMode = 0 Then
114
+
115
+ player.Close()
116
+
117
+ If Not (player.OpenFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
118
+
119
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
120
+
121
+ Exit Sub
122
+
123
+ End If
124
+
125
+ ElseIf LoadMode = 1 Then
126
+
127
+ player.Close()
128
+
129
+
130
+
131
+ Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
132
+
133
+
134
+
135
+ Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
136
+
137
+ Dim numBytes As Long = fInfo.Length
138
+
139
+ Dim fStream As New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
140
+
141
+ Dim br As New System.IO.BinaryReader(fStream)
142
+
143
+ Dim stream_data() As Byte = Nothing
144
+
145
+
146
+
147
+ stream_data = br.ReadBytes(CInt(Fix(numBytes)))
148
+
149
+ If Not (player.OpenStream(True, False, stream_data, CUInt(numBytes), format)) Then
150
+
151
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
152
+
153
+ End If
154
+
155
+
156
+
157
+ br.Close()
158
+
159
+ fStream.Close()
160
+
161
+ ElseIf LoadMode = 2 Then
162
+
163
+ player.Close()
164
+
165
+
166
+
167
+ Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
168
+
169
+ BufferCounter = 0
170
+
171
+
172
+
173
+ Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
174
+
175
+ Dim numBytes As UInteger = CUInt(fInfo.Length)
176
+
177
+ If br IsNot Nothing Then
178
+
179
+ br.Close()
180
+
181
+ End If
182
+
183
+ If fStream IsNot Nothing Then
184
+
185
+ fStream.Close()
186
+
187
+ End If
188
+
189
+
190
+
191
+ br = Nothing
192
+
193
+ fStream = Nothing
194
+
195
+
196
+
197
+ fStream = New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
198
+
199
+ br = New System.IO.BinaryReader(fStream)
200
+
201
+ Dim stream_data() As Byte = Nothing
202
+
203
+ Dim small_chunk As UInteger = 0
204
+
205
+ small_chunk = CType(Math.Min(100000, numBytes), UInteger)
206
+
207
+ ' read small chunk of data
208
+
209
+ stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
210
+
211
+ ' open stream
212
+
213
+ If Not (player.OpenStream(True, True, stream_data, CUInt(stream_data.Length), format)) Then
214
+
215
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
216
+
217
+ End If
218
+
219
+
220
+
221
+ ' read more data and push into stream
222
+
223
+ stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
224
+
225
+ player.PushDataToStream(stream_data, CUInt(stream_data.Length))
226
+
227
+ 'リストボックスとテキストボックス追加しました。
228
+
229
+ 'リストボックスとテキストボックスに表示されます。
230
+
231
+ ElseIf LoadMode = 3 Then
232
+
233
+ file = OpenFileDialog1.SafeFileNames
234
+
235
+ a = OpenFileDialog1.FileNames
236
+
237
+ For b As Integer = 0 To file.Length - 1
238
+
239
+ ListBox1.Items.Add(file(b))
94
240
 
95
241
  Next
96
242
 
243
+ ListBox1.SelectedIndex = 0
244
+
245
+ TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedItem)
246
+
97
247
  End If
98
248
 
249
+ If Not (player.AddFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
250
+
251
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
252
+
253
+ Exit Sub
254
+
255
+ End If
256
+
257
+
258
+
99
- Showinfo()
259
+ showinfo()
100
260
 
101
261
  player.StartPlayback()
102
262
 
263
+
264
+
265
+ End Sub
266
+
103
- '↑以下のコード修正しました。
267
+ '選択、リスト選択可能
268
+
104
-
269
+ Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
270
+
271
+ If ListBox1.SelectedItem <> "" Then
272
+
105
- '↓同じファイルが開けないようする
273
+ 'ここplayerを・・・
106
-
107
- Dim files = OpenFileDialog3.FileNames
274
+
108
-
109
- Dim conflict = files.Where(AddressOf history3.Contains)
275
+ TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedItem)
110
-
111
-
112
-
113
- If conflict.Any() Then
276
+
114
-
115
- e.Cancel = True
277
+ Timer1.Start()
116
-
278
+
117
- Dim fileNames = conflict.Select(AddressOf System.IO.Path.GetFileName)
279
+ Timer2.Start()
118
-
119
- MessageBox.Show("同じファイルがあります。" & vbCrLf & String.Join(vbCrLf, fileNames), "競合", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
280
+
281
+
120
282
 
121
283
  Else
122
284
 
123
- Array.ForEach(files, AddressOf history3.Add)
124
-
125
285
  End If
126
286
 
127
287
  End Sub
128
288
 
129
- '※2
130
-
131
- 'ZPlayerをリストボックスから選択は可能ですが、
132
-
133
- 'Zplayerのメリット見ても、プレイリストがない為無理です
134
-
135
- '※エラー:Unknown file format.と表示されました。
136
-
137
- Dim IntSelectIndexPre1 As Integer = 0
138
-
139
-
140
-
141
- Private Sub TrC00_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TrC00.SelectedIndexChanged
142
-
143
- If TrC00.SelectedItem <> "" Then
144
-
145
- Song_text.Text = System.IO.Path.GetFileName(TrC00.SelectedItem)
146
-
147
- End If
148
-
149
- If IntSelectIndexPre1 = TrC00.SelectedIndex Then
150
-
151
- Exit Sub
152
-
153
- End If
154
-
155
- IntSelectIndexPre1 = TrC00.SelectedIndex
156
-
157
- player.AddFile(OpenFileDialog3.FileName(TrC00.SelectedIndex), TStreamFormat.sfAutodetect)
158
-
159
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
160
-
161
-
162
-
163
- player.StartPlayback()
164
-
165
- End Sub
166
-
167
289
  End Class
168
290
 
291
+
292
+
169
- ---
293
+ ```
170
-
294
+
171
- ##修正
295
+ ##追加したコードの動作結果
172
-
296
+
173
- 元の参考しコードのツールボックスの名前を変更し、具体的修正しました。
297
+ 開いらリストボックスとテキストボックス表示されました。
298
+
174
-
299
+ 開いたファイルを選択すると曲を再生したいですが※の部分に
300
+
175
-
301
+ ```
302
+
303
+ ListBox1.SelectedIndex = player.StartPlayback
304
+
305
+ ```
306
+
307
+ リストを選択すると押された後消える現状
308
+
309
+ ```
310
+
311
+ player.StartPlayback()
312
+
313
+
314
+
315
+ ```
316
+
317
+ こちらも既に再生していると思われ、出来ません
318
+
319
+ できなくはないと思うんですが…
320
+
321
+ 教えてください。
176
322
 
177
323
  ##開発バージョン
178
324
 
179
325
  Vistual Studio2017 VB
326
+
327
+ サイトのプロジェクト使用しています。

5

文字の追加と修正

2018/04/24 10:24

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,203 +10,21 @@
10
10
 
11
11
  ##教えてほしい事
12
12
 
13
- その1:playerでファイルを開くとリストボックスに表示さい事
13
+ リストボックスに表示されまし
14
14
 
15
- 2:playerをリストボックスに表示させ
15
+ 問題が発生しまし
16
16
 
17
+ ---
17
18
 
19
+ 開いたファイルを選択しても不可に(エラー:Unknown file format.)
20
+
21
+ ちょっと困りました。※2(コード書きます)
18
22
 
19
23
 
20
24
 
21
25
  申し訳ございませんが宜しくお願い致します。
22
26
 
23
- ##元のサイトにあった参考です
24
27
 
25
- ```ZPlayer
26
-
27
- Imports MI_LIBZPLAY_AUDIO.libZPlay
28
-
29
-
30
-
31
- Public Class Form1
32
-
33
-
34
-
35
- Private player As ZPlay
36
-
37
- Private LoadMode As Integer
38
-
39
- Private ReverseMode As Boolean
40
-
41
- Private Echo As Boolean
42
-
43
- Private VocalCut As Boolean = False
44
-
45
- Private SideCut As Boolean = False
46
-
47
-
48
-
49
- Private NextSong As Boolean = False
50
-
51
-
52
-
53
- Private FadeFinished As Boolean = False
54
-
55
-
56
-
57
- ' need this for managed stream
58
-
59
- Private fStream As System.IO.FileStream = Nothing
60
-
61
- Private br As System.IO.BinaryReader = Nothing
62
-
63
- Private BufferCounter As Integer
64
-
65
-
66
-
67
- Private CallbackFunc As TCallbackFunc
68
-
69
-
70
-
71
- Private BlockSlideLeft As Boolean = False
72
-
73
- Private BlockSlideRight As Boolean = False
74
-
75
-
76
-
77
- ''' <summary>
78
-
79
- ''' Text callback
80
-
81
- ''' </summary>
82
-
83
- ''' <param name="text"></param>
84
-
85
- ''' <remarks></remarks>
86
-
87
- Public Delegate Sub SetTextCallback(ByVal text As String)
88
-
89
- Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
90
-
91
- If LoadMode = 0 Then
92
-
93
- player.Close()
94
-
95
- If Not (player.OpenFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
96
-
97
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
98
-
99
- Exit Sub
100
-
101
- End If
102
-
103
- ElseIf LoadMode = 1 Then
104
-
105
- player.Close()
106
-
107
-
108
-
109
- Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
110
-
111
-
112
-
113
- Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
114
-
115
- Dim numBytes As Long = fInfo.Length
116
-
117
- Dim fStream As New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
118
-
119
- Dim br As New System.IO.BinaryReader(fStream)
120
-
121
- Dim stream_data() As Byte = Nothing
122
-
123
- stream_data = br.ReadBytes(CInt(Fix(numBytes)))
124
-
125
- If Not (player.OpenStream(True, False, stream_data, CUInt(numBytes), format)) Then
126
-
127
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
128
-
129
- End If
130
-
131
- br.Close()
132
-
133
- fStream.Close()
134
-
135
- ElseIf LoadMode = 2 Then
136
-
137
- player.Close()
138
-
139
- Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
140
-
141
- BufferCounter = 0
142
-
143
- Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
144
-
145
- Dim numBytes As UInteger = CUInt(fInfo.Length)
146
-
147
- If br IsNot Nothing Then
148
-
149
- br.Close()
150
-
151
- End If
152
-
153
- If fStream IsNot Nothing Then
154
-
155
- fStream.Close()
156
-
157
- End If
158
-
159
- br = Nothing
160
-
161
- fStream = Nothing
162
-
163
- fStream = New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
164
-
165
- br = New System.IO.BinaryReader(fStream)
166
-
167
- Dim stream_data() As Byte = Nothing
168
-
169
- Dim small_chunk As UInteger = 0
170
-
171
- small_chunk = CType(Math.Min(100000, numBytes), UInteger)
172
-
173
- ' read small chunk of data
174
-
175
- stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
176
-
177
- ' open stream
178
-
179
- If Not (player.OpenStream(True, True, stream_data, CUInt(stream_data.Length), format)) Then
180
-
181
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
182
-
183
- End If
184
-
185
- ' read more data and push into stream
186
-
187
- stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
188
-
189
- player.PushDataToStream(stream_data, CUInt(stream_data.Length))
190
-
191
- ElseIf LoadMode = 3 Then
192
-
193
- If Not (player.AddFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
194
-
195
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
196
-
197
- Exit Sub
198
-
199
- End If
200
-
201
- End If
202
-
203
- showinfo()
204
-
205
- player.StartPlayback()
206
-
207
- End Sub
208
-
209
- ```
210
28
 
211
29
  ##dllが必要
212
30
 
@@ -214,49 +32,147 @@
214
32
 
215
33
  libZPlay-2.02-SDK (2.12 MB) -
216
34
 
217
- この中に入ってたlibezplay.dllを
35
+ この中に入ってたlibezplay.dllをプロジェクト名フォルダのdebug¥にいれる
218
36
 
219
- C:\Users\User\Documents\Visual Studio 2017\Projects\プロジェクト名\プロジェクト名\bin\Debug\Libzplay.dllに入れます。
220
37
 
221
- VBフォルダの中にlibZPlay.vbを追加しました。
222
38
 
223
- ##修正したコードおよびエラー
39
+ ##修正したコード
224
40
 
225
41
  ```ここに言語を入力
226
42
 
227
- Dim val As Integer = OpenFileDialog1.FileNames.Length
43
+ Imports Song_Music_Player.libZPlay
228
44
 
229
- openfiledialog1
45
+ Public Class Form1
230
46
 
231
- ```
47
+ 'Track1=AxWindowsMediaPlayer1
232
48
 
233
- エラー
49
+ Dim strFileName1 As String
234
50
 
235
- System.NullReferenceException
51
+ 'Track2=AxWindowsMediaPlayer2
236
52
 
237
- HResult=0x80004003
53
+ Dim strFileName2 As String
238
54
 
55
+ 'LibZplayer
56
+
57
+ Dim s22 As String
58
+
59
+
60
+
61
+ '省略
62
+
63
+ Private history3 As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase)
64
+
65
+ 'Zplayeropenfiledialog
66
+
67
+ Private Sub OpenFileDialog3_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog3.FileOk
68
+
69
+
70
+
71
+ '省略
72
+
73
+ ElseIf LoadMode = 3 Then
74
+
75
+ '変更
76
+
77
+ For Each strFilePath As String In OpenFileDialog3.FileNames
78
+
79
+ s22 = IO.Path.GetFileName(strFilePath)
80
+
81
+ TrC00.Items.Add(s22)
82
+
83
+ If Not (player.AddFile(OpenFileDialog3.FileName, TStreamFormat.sfAutodetect)) Then
84
+
85
+
86
+
87
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
88
+
89
+ Exit Sub
90
+
91
+ TrC00.SelectedIndex = 0
92
+
93
+ End If
94
+
95
+ Next
96
+
97
+ End If
98
+
99
+ Showinfo()
100
+
101
+ player.StartPlayback()
102
+
103
+ '↑以下のコードを修正しました。※1
104
+
105
+ '↓同じファイルが開けないようにする
106
+
107
+ Dim files = OpenFileDialog3.FileNames
108
+
109
+ Dim conflict = files.Where(AddressOf history3.Contains)
110
+
111
+
112
+
113
+ If conflict.Any() Then
114
+
115
+ e.Cancel = True
116
+
117
+ Dim fileNames = conflict.Select(AddressOf System.IO.Path.GetFileName)
118
+
119
+ MessageBox.Show("同じファイルがあります。" & vbCrLf & String.Join(vbCrLf, fileNames), "競合", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
120
+
121
+ Else
122
+
123
+ Array.ForEach(files, AddressOf history3.Add)
124
+
125
+ End If
126
+
127
+ End Sub
128
+
129
+ '※2
130
+
131
+ 'ZPlayerをリストボックスから選択は可能ですが、
132
+
133
+ 'Zplayerのメリット見ても、プレイリストがない為無理です
134
+
239
- Message=オブジェクト参照がオブジェクト インスタンスに設定されていせん
135
+ '※エラー:Unknown file format.と表示されました。
136
+
137
+ Dim IntSelectIndexPre1 As Integer = 0
138
+
139
+
140
+
141
+ Private Sub TrC00_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TrC00.SelectedIndexChanged
142
+
143
+ If TrC00.SelectedItem <> "" Then
144
+
145
+ Song_text.Text = System.IO.Path.GetFileName(TrC00.SelectedItem)
146
+
147
+ End If
148
+
149
+ If IntSelectIndexPre1 = TrC00.SelectedIndex Then
150
+
151
+ Exit Sub
152
+
153
+ End If
154
+
155
+ IntSelectIndexPre1 = TrC00.SelectedIndex
156
+
157
+ player.AddFile(OpenFileDialog3.FileName(TrC00.SelectedIndex), TStreamFormat.sfAutodetect)
158
+
159
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
160
+
161
+
162
+
163
+ player.StartPlayback()
164
+
165
+ End Sub
166
+
167
+ End Class
240
168
 
241
169
  ---
242
170
 
243
- ```ここに言語を入力
171
+ ##修正
244
172
 
245
- openfiledialog1
173
+ 元の参考したコードのツールボックスの名前を変更し、具体的に修正しました。
246
174
 
247
- Dim val As Integer = OpenFileDialog1.FileNames.Length
248
175
 
249
- ```
250
-
251
- エラー
252
-
253
- System.IndexOutOfRangeException
254
-
255
- HResult=0x80131508
256
-
257
- Message=インデックスが配列の境界外です。
258
-
259
- ---
260
176
 
261
177
  ##開発バージョン
262
178
 

4

修正

2018/04/23 14:08

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -220,9 +220,43 @@
220
220
 
221
221
  VBフォルダの中にlibZPlay.vbを追加しました。
222
222
 
223
-
223
+ ##修正したコードおよびエラー
224
+
224
-
225
+ ```ここに言語を入力
226
+
225
-
227
+ Dim val As Integer = OpenFileDialog1.FileNames.Length
228
+
229
+ openfiledialog1
230
+
231
+ ```
232
+
233
+ エラー
234
+
235
+ System.NullReferenceException
236
+
237
+ HResult=0x80004003
238
+
239
+ Message=オブジェクト参照がオブジェクト インスタンスに設定されていません
240
+
241
+ ---
242
+
243
+ ```ここに言語を入力
244
+
245
+ openfiledialog1
246
+
247
+ Dim val As Integer = OpenFileDialog1.FileNames.Length
248
+
249
+ ```
250
+
251
+ エラー
252
+
253
+ System.IndexOutOfRangeException
254
+
255
+ HResult=0x80131508
256
+
257
+ Message=インデックスが配列の境界外です。
258
+
259
+ ---
226
260
 
227
261
  ##開発バージョン
228
262
 

3

修正

2018/04/23 11:59

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -14,256 +14,200 @@
14
14
 
15
15
  その2:playerをリストボックスに表示させたい
16
16
 
17
- 元参考したコードを使って、
18
-
19
- ```ここに言語を入力
20
-
21
- Dim s22 As String
22
-
23
- OpenFileDialog1_FileOk
24
-
25
- 'リストボックスを複数開く
26
-
27
- OpenFileDialog3.FileName = ""
28
-
29
- OpenFileDialog3.Title = ""
30
-
31
- OpenFileDialog3.Filter = "All Supported Files|*.mp3;*.mp2;*.mp1;*.ogg;*.oga;*.flac;*.wav;*.ac3;*.aac|Mp3 Files|*.mp3|Mp2 Files|*.mp2|Mp1 Files|*.mp1|Ogg Files|*.ogg|FLAC files|*.flac|Wav files|*.wav|AC-3|*.ac3|AAC|*.aac"
32
-
33
- OpenFileDialog3.Multiselect = True
34
-
35
- OpenFileDialog3.Title = "開くファイルを指定"
36
-
37
- OpenFileDialog3.FilterIndex = 1
38
-
39
- OpenFileDialog3.RestoreDirectory = True
40
-
41
- If OpenFileDialog3.ShowDialog() = DialogResult.OK Then
42
-
43
- For Each strFilePath As String In OpenFileDialog3.FileNames
44
-
45
- s22 = IO.Path.GetFileName(strFilePath)
46
-
47
- listbox1.Items.Add(s22)
48
-
49
- 'zplayerリストボックスに表示
50
-
51
-
52
-
53
- player.Close()
54
-
55
-
56
-
57
- Listbox1.SelectedIndex = 0
58
-
59
- Next
60
-
61
- 'テキスト表示
62
-
63
- Song_text.Text = System.IO.Path.GetFileName(listbox1.SelectedItem)
17
+
18
+
19
+
20
+
21
+ 申し訳ございませんが宜しくお願い致します。
22
+
23
+ ##元のサイトにあった参考です
24
+
25
+ ```ZPlayer
26
+
27
+ Imports MI_LIBZPLAY_AUDIO.libZPlay
28
+
29
+
30
+
31
+ Public Class Form1
32
+
33
+
34
+
35
+ Private player As ZPlay
36
+
37
+ Private LoadMode As Integer
38
+
39
+ Private ReverseMode As Boolean
40
+
41
+ Private Echo As Boolean
42
+
43
+ Private VocalCut As Boolean = False
44
+
45
+ Private SideCut As Boolean = False
46
+
47
+
48
+
49
+ Private NextSong As Boolean = False
50
+
51
+
52
+
53
+ Private FadeFinished As Boolean = False
54
+
55
+
56
+
57
+ ' need this for managed stream
58
+
59
+ Private fStream As System.IO.FileStream = Nothing
60
+
61
+ Private br As System.IO.BinaryReader = Nothing
62
+
63
+ Private BufferCounter As Integer
64
+
65
+
66
+
67
+ Private CallbackFunc As TCallbackFunc
68
+
69
+
70
+
71
+ Private BlockSlideLeft As Boolean = False
72
+
73
+ Private BlockSlideRight As Boolean = False
74
+
75
+
76
+
77
+ ''' <summary>
78
+
79
+ ''' Text callback
80
+
81
+ ''' </summary>
82
+
83
+ ''' <param name="text"></param>
84
+
85
+ ''' <remarks></remarks>
86
+
87
+ Public Delegate Sub SetTextCallback(ByVal text As String)
88
+
89
+ Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
90
+
91
+ If LoadMode = 0 Then
92
+
93
+ player.Close()
94
+
95
+ If Not (player.OpenFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
96
+
97
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
98
+
99
+ Exit Sub
100
+
101
+ End If
102
+
103
+ ElseIf LoadMode = 1 Then
104
+
105
+ player.Close()
106
+
107
+
108
+
109
+ Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
110
+
111
+
112
+
113
+ Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
114
+
115
+ Dim numBytes As Long = fInfo.Length
116
+
117
+ Dim fStream As New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
118
+
119
+ Dim br As New System.IO.BinaryReader(fStream)
120
+
121
+ Dim stream_data() As Byte = Nothing
122
+
123
+ stream_data = br.ReadBytes(CInt(Fix(numBytes)))
124
+
125
+ If Not (player.OpenStream(True, False, stream_data, CUInt(numBytes), format)) Then
126
+
127
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
128
+
129
+ End If
130
+
131
+ br.Close()
132
+
133
+ fStream.Close()
134
+
135
+ ElseIf LoadMode = 2 Then
136
+
137
+ player.Close()
138
+
139
+ Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
140
+
141
+ BufferCounter = 0
142
+
143
+ Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
144
+
145
+ Dim numBytes As UInteger = CUInt(fInfo.Length)
146
+
147
+ If br IsNot Nothing Then
148
+
149
+ br.Close()
150
+
151
+ End If
152
+
153
+ If fStream IsNot Nothing Then
154
+
155
+ fStream.Close()
156
+
157
+ End If
158
+
159
+ br = Nothing
160
+
161
+ fStream = Nothing
162
+
163
+ fStream = New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
164
+
165
+ br = New System.IO.BinaryReader(fStream)
166
+
167
+ Dim stream_data() As Byte = Nothing
168
+
169
+ Dim small_chunk As UInteger = 0
170
+
171
+ small_chunk = CType(Math.Min(100000, numBytes), UInteger)
172
+
173
+ ' read small chunk of data
174
+
175
+ stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
176
+
177
+ ' open stream
178
+
179
+ If Not (player.OpenStream(True, True, stream_data, CUInt(stream_data.Length), format)) Then
180
+
181
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
182
+
183
+ End If
184
+
185
+ ' read more data and push into stream
186
+
187
+ stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
188
+
189
+ player.PushDataToStream(stream_data, CUInt(stream_data.Length))
190
+
191
+ ElseIf LoadMode = 3 Then
192
+
193
+ If Not (player.AddFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
194
+
195
+ MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
196
+
197
+ Exit Sub
198
+
199
+ End If
64
200
 
65
201
  End If
66
202
 
67
-
203
+ showinfo()
204
+
205
+ player.StartPlayback()
206
+
207
+ End Sub
68
208
 
69
209
  ```
70
210
 
71
- ##現在作成中
72
-
73
- 上のコードをどのように修正したらいいがわかりません
74
-
75
-
76
-
77
- 申し訳ございませんが宜しくお願い致します。
78
-
79
- ##元のサイトにあった参考です
80
-
81
- ```ZPlayer
82
-
83
- Imports MI_LIBZPLAY_AUDIO.libZPlay
84
-
85
-
86
-
87
- Public Class Form1
88
-
89
-
90
-
91
- Private player As ZPlay
92
-
93
- Private LoadMode As Integer
94
-
95
- Private ReverseMode As Boolean
96
-
97
- Private Echo As Boolean
98
-
99
- Private VocalCut As Boolean = False
100
-
101
- Private SideCut As Boolean = False
102
-
103
-
104
-
105
- Private NextSong As Boolean = False
106
-
107
-
108
-
109
- Private FadeFinished As Boolean = False
110
-
111
-
112
-
113
- ' need this for managed stream
114
-
115
- Private fStream As System.IO.FileStream = Nothing
116
-
117
- Private br As System.IO.BinaryReader = Nothing
118
-
119
- Private BufferCounter As Integer
120
-
121
-
122
-
123
- Private CallbackFunc As TCallbackFunc
124
-
125
-
126
-
127
- Private BlockSlideLeft As Boolean = False
128
-
129
- Private BlockSlideRight As Boolean = False
130
-
131
-
132
-
133
- ''' <summary>
134
-
135
- ''' Text callback
136
-
137
- ''' </summary>
138
-
139
- ''' <param name="text"></param>
140
-
141
- ''' <remarks></remarks>
142
-
143
- Public Delegate Sub SetTextCallback(ByVal text As String)
144
-
145
- Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
146
-
147
- If LoadMode = 0 Then
148
-
149
- player.Close()
150
-
151
- If Not (player.OpenFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
152
-
153
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
154
-
155
- Exit Sub
156
-
157
- End If
158
-
159
- ElseIf LoadMode = 1 Then
160
-
161
- player.Close()
162
-
163
-
164
-
165
- Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
166
-
167
-
168
-
169
- Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
170
-
171
- Dim numBytes As Long = fInfo.Length
172
-
173
- Dim fStream As New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
174
-
175
- Dim br As New System.IO.BinaryReader(fStream)
176
-
177
- Dim stream_data() As Byte = Nothing
178
-
179
- stream_data = br.ReadBytes(CInt(Fix(numBytes)))
180
-
181
- If Not (player.OpenStream(True, False, stream_data, CUInt(numBytes), format)) Then
182
-
183
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
184
-
185
- End If
186
-
187
- br.Close()
188
-
189
- fStream.Close()
190
-
191
- ElseIf LoadMode = 2 Then
192
-
193
- player.Close()
194
-
195
- Dim format As TStreamFormat = player.GetFileFormat(OpenFileDialog1.FileName)
196
-
197
- BufferCounter = 0
198
-
199
- Dim fInfo As New System.IO.FileInfo(OpenFileDialog1.FileName)
200
-
201
- Dim numBytes As UInteger = CUInt(fInfo.Length)
202
-
203
- If br IsNot Nothing Then
204
-
205
- br.Close()
206
-
207
- End If
208
-
209
- If fStream IsNot Nothing Then
210
-
211
- fStream.Close()
212
-
213
- End If
214
-
215
- br = Nothing
216
-
217
- fStream = Nothing
218
-
219
- fStream = New System.IO.FileStream(OpenFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
220
-
221
- br = New System.IO.BinaryReader(fStream)
222
-
223
- Dim stream_data() As Byte = Nothing
224
-
225
- Dim small_chunk As UInteger = 0
226
-
227
- small_chunk = CType(Math.Min(100000, numBytes), UInteger)
228
-
229
- ' read small chunk of data
230
-
231
- stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
232
-
233
- ' open stream
234
-
235
- If Not (player.OpenStream(True, True, stream_data, CUInt(stream_data.Length), format)) Then
236
-
237
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
238
-
239
- End If
240
-
241
- ' read more data and push into stream
242
-
243
- stream_data = br.ReadBytes(CInt(Fix(small_chunk)))
244
-
245
- player.PushDataToStream(stream_data, CUInt(stream_data.Length))
246
-
247
- ElseIf LoadMode = 3 Then
248
-
249
- If Not (player.AddFile(OpenFileDialog1.FileName, TStreamFormat.sfAutodetect)) Then
250
-
251
- MessageBox.Show(player.GetError(), String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error)
252
-
253
- Exit Sub
254
-
255
- End If
256
-
257
- End If
258
-
259
- showinfo()
260
-
261
- player.StartPlayback()
262
-
263
- End Sub
264
-
265
- ```
266
-
267
211
  ##dllが必要
268
212
 
269
213
 

2

修正しました

2018/04/23 06:55

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,19 +10,69 @@
10
10
 
11
11
  ##教えてほしい事
12
12
 
13
- その1:playerでファイルを開く時、一つのみしか開けない事
13
+ その1:playerでファイルを開くとリストボックスに表示させたい事
14
-
15
- 複数開く場合どのようなメリット使えば良いんでしょうか?
16
14
 
17
15
  その2:playerをリストボックスに表示させたい
18
16
 
19
-
20
-
21
- の2つついてどのようにコード書けばよろしいんでしょうか?
22
-
23
- 元参考した通りにコードを追加しただけですが、リストボックス表示と開く時に
24
-
25
- 複数開けるようにしたいです。
17
+ 元参考したコードを使って、
18
+
19
+ ```言語入力
20
+
21
+ Dim s22 As String
22
+
23
+ OpenFileDialog1_FileOk
24
+
25
+ 'リストボックスを複数開く
26
+
27
+ OpenFileDialog3.FileName = ""
28
+
29
+ OpenFileDialog3.Title = ""
30
+
31
+ OpenFileDialog3.Filter = "All Supported Files|*.mp3;*.mp2;*.mp1;*.ogg;*.oga;*.flac;*.wav;*.ac3;*.aac|Mp3 Files|*.mp3|Mp2 Files|*.mp2|Mp1 Files|*.mp1|Ogg Files|*.ogg|FLAC files|*.flac|Wav files|*.wav|AC-3|*.ac3|AAC|*.aac"
32
+
33
+ OpenFileDialog3.Multiselect = True
34
+
35
+ OpenFileDialog3.Title = "開くファイルを指定"
36
+
37
+ OpenFileDialog3.FilterIndex = 1
38
+
39
+ OpenFileDialog3.RestoreDirectory = True
40
+
41
+ If OpenFileDialog3.ShowDialog() = DialogResult.OK Then
42
+
43
+ For Each strFilePath As String In OpenFileDialog3.FileNames
44
+
45
+ s22 = IO.Path.GetFileName(strFilePath)
46
+
47
+ listbox1.Items.Add(s22)
48
+
49
+ 'zplayerリストボックスに表示
50
+
51
+
52
+
53
+ player.Close()
54
+
55
+
56
+
57
+ Listbox1.SelectedIndex = 0
58
+
59
+ Next
60
+
61
+ 'テキスト表示
62
+
63
+ Song_text.Text = System.IO.Path.GetFileName(listbox1.SelectedItem)
64
+
65
+ End If
66
+
67
+
68
+
69
+ ```
70
+
71
+ ##現在作成中
72
+
73
+ 上のコードをどのように修正したらいいがわかりません
74
+
75
+
26
76
 
27
77
  申し訳ございませんが宜しくお願い致します。
28
78
 
@@ -214,6 +264,22 @@
214
264
 
215
265
  ```
216
266
 
267
+ ##dllが必要
268
+
269
+
270
+
271
+ libZPlay-2.02-SDK (2.12 MB) -
272
+
273
+ この中に入ってたlibezplay.dllを
274
+
275
+ C:\Users\User\Documents\Visual Studio 2017\Projects\プロジェクト名\プロジェクト名\bin\Debug\Libzplay.dllに入れます。
276
+
277
+ VBフォルダの中にlibZPlay.vbを追加しました。
278
+
279
+
280
+
281
+
282
+
217
283
  ##開発バージョン
218
284
 
219
285
  Vistual Studio2017 VB

1

コード追加するのを忘れてました

2018/04/23 06:12

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -30,7 +30,67 @@
30
30
 
31
31
  ```ZPlayer
32
32
 
33
-
33
+ Imports MI_LIBZPLAY_AUDIO.libZPlay
34
+
35
+
36
+
37
+ Public Class Form1
38
+
39
+
40
+
41
+ Private player As ZPlay
42
+
43
+ Private LoadMode As Integer
44
+
45
+ Private ReverseMode As Boolean
46
+
47
+ Private Echo As Boolean
48
+
49
+ Private VocalCut As Boolean = False
50
+
51
+ Private SideCut As Boolean = False
52
+
53
+
54
+
55
+ Private NextSong As Boolean = False
56
+
57
+
58
+
59
+ Private FadeFinished As Boolean = False
60
+
61
+
62
+
63
+ ' need this for managed stream
64
+
65
+ Private fStream As System.IO.FileStream = Nothing
66
+
67
+ Private br As System.IO.BinaryReader = Nothing
68
+
69
+ Private BufferCounter As Integer
70
+
71
+
72
+
73
+ Private CallbackFunc As TCallbackFunc
74
+
75
+
76
+
77
+ Private BlockSlideLeft As Boolean = False
78
+
79
+ Private BlockSlideRight As Boolean = False
80
+
81
+
82
+
83
+ ''' <summary>
84
+
85
+ ''' Text callback
86
+
87
+ ''' </summary>
88
+
89
+ ''' <param name="text"></param>
90
+
91
+ ''' <remarks></remarks>
92
+
93
+ Public Delegate Sub SetTextCallback(ByVal text As String)
34
94
 
35
95
  Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
36
96