@@ -98,67 +98,71 @@ static ULONG WINAPI segment_Release(IDirectMusicSegment8 *iface)
98
98
return ref ;
99
99
}
100
100
101
- static HRESULT WINAPI segment_GetLength (IDirectMusicSegment8 * iface , MUSIC_TIME * pmtLength )
101
+ static HRESULT WINAPI segment_GetLength (IDirectMusicSegment8 * iface , MUSIC_TIME * length )
102
102
{
103
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
103
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
104
104
105
- TRACE ("(%p, %p)\n" , This , pmtLength );
106
- if ( NULL == pmtLength ) {
107
- return E_POINTER ;
108
- }
109
- * pmtLength = This -> header . mtLength ;
110
- return S_OK ;
105
+ TRACE ("(%p, %p)\n" , This , length );
106
+
107
+ if (! length ) return E_POINTER ;
108
+ * length = This -> header . mtLength ;
109
+
110
+ return S_OK ;
111
111
}
112
112
113
- static HRESULT WINAPI segment_SetLength (IDirectMusicSegment8 * iface , MUSIC_TIME mtLength )
113
+ static HRESULT WINAPI segment_SetLength (IDirectMusicSegment8 * iface , MUSIC_TIME length )
114
114
{
115
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
115
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
116
116
117
- TRACE ("(%p, %ld)\n" , This , mtLength );
118
- This -> header .mtLength = mtLength ;
119
- return S_OK ;
117
+ TRACE ("(%p, %ld)\n" , This , length );
118
+
119
+ This -> header .mtLength = length ;
120
+
121
+ return S_OK ;
120
122
}
121
123
122
- static HRESULT WINAPI segment_GetRepeats (IDirectMusicSegment8 * iface , DWORD * pdwRepeats )
124
+ static HRESULT WINAPI segment_GetRepeats (IDirectMusicSegment8 * iface , DWORD * repeats )
123
125
{
124
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
126
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
125
127
126
- TRACE ("(%p, %p)\n" , This , pdwRepeats );
127
- if ( NULL == pdwRepeats ) {
128
- return E_POINTER ;
129
- }
130
- * pdwRepeats = This -> header . dwRepeats ;
131
- return S_OK ;
128
+ TRACE ("(%p, %p)\n" , This , repeats );
129
+
130
+ if (! repeats ) return E_POINTER ;
131
+ * repeats = This -> header . dwRepeats ;
132
+
133
+ return S_OK ;
132
134
}
133
135
134
- static HRESULT WINAPI segment_SetRepeats (IDirectMusicSegment8 * iface , DWORD dwRepeats )
136
+ static HRESULT WINAPI segment_SetRepeats (IDirectMusicSegment8 * iface , DWORD repeats )
135
137
{
136
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
138
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
137
139
138
- TRACE ("(%p, %ld)\n" , This , dwRepeats );
139
- This -> header .dwRepeats = dwRepeats ;
140
- return S_OK ;
140
+ TRACE ("(%p, %ld)\n" , This , repeats );
141
+ This -> header .dwRepeats = repeats ;
142
+
143
+ return S_OK ;
141
144
}
142
145
143
- static HRESULT WINAPI segment_GetDefaultResolution (IDirectMusicSegment8 * iface , DWORD * pdwResolution )
146
+ static HRESULT WINAPI segment_GetDefaultResolution (IDirectMusicSegment8 * iface , DWORD * resolution )
144
147
{
145
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
148
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
146
149
147
- TRACE ("(%p, %p)\n" , This , pdwResolution );
148
- if ( NULL == pdwResolution ) {
149
- return E_POINTER ;
150
- }
151
- * pdwResolution = This -> header . dwResolution ;
152
- return S_OK ;
150
+ TRACE ("(%p, %p)\n" , This , resolution );
151
+
152
+ if (! resolution ) return E_POINTER ;
153
+ * resolution = This -> header . dwResolution ;
154
+
155
+ return S_OK ;
153
156
}
154
157
155
- static HRESULT WINAPI segment_SetDefaultResolution (IDirectMusicSegment8 * iface , DWORD dwResolution )
158
+ static HRESULT WINAPI segment_SetDefaultResolution (IDirectMusicSegment8 * iface , DWORD resolution )
156
159
{
157
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
160
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
158
161
159
- TRACE ("(%p, %ld)\n" , This , dwResolution );
160
- This -> header .dwResolution = dwResolution ;
161
- return S_OK ;
162
+ TRACE ("(%p, %ld)\n" , This , resolution );
163
+ This -> header .dwResolution = resolution ;
164
+
165
+ return S_OK ;
162
166
}
163
167
164
168
static HRESULT WINAPI segment_GetTrack (IDirectMusicSegment8 * iface , REFGUID rguidType ,
@@ -294,56 +298,43 @@ static HRESULT WINAPI segment_RemoveTrack(IDirectMusicSegment8 *iface, IDirectMu
294
298
}
295
299
296
300
static HRESULT WINAPI segment_InitPlay (IDirectMusicSegment8 * iface ,
297
- IDirectMusicSegmentState * * ppSegState , IDirectMusicPerformance * pPerformance , DWORD dwFlags )
301
+ IDirectMusicSegmentState * * state , IDirectMusicPerformance * performance , DWORD flags )
298
302
{
299
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
300
- HRESULT hr ;
303
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
304
+ HRESULT hr ;
301
305
302
- FIXME ("(%p, %p, %p, %ld): semi-stub\n" , This , ppSegState , pPerformance , dwFlags );
303
- if (NULL == ppSegState ) {
304
- return E_POINTER ;
305
- }
306
- hr = create_dmsegmentstate (& IID_IDirectMusicSegmentState ,(void * * ) ppSegState );
307
- if (FAILED (hr )) {
308
- return hr ;
309
- }
310
- /* TODO: DMUS_SEGF_FLAGS */
311
- return S_OK ;
306
+ FIXME ("(%p, %p, %p, %ld): semi-stub\n" , This , state , performance , flags );
307
+
308
+ if (!state ) return E_POINTER ;
309
+ if (FAILED (hr = create_dmsegmentstate (& IID_IDirectMusicSegmentState , (void * * )state ))) return hr ;
310
+
311
+ /* TODO: DMUS_SEGF_FLAGS */
312
+ return S_OK ;
312
313
}
313
314
314
- static HRESULT WINAPI segment_GetGraph (IDirectMusicSegment8 * iface , IDirectMusicGraph * * ppGraph )
315
+ static HRESULT WINAPI segment_GetGraph (IDirectMusicSegment8 * iface , IDirectMusicGraph * * graph )
315
316
{
316
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
317
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
317
318
318
- FIXME ("(%p, %p): semi-stub\n" , This , ppGraph );
319
- if (NULL == ppGraph ) {
320
- return E_POINTER ;
321
- }
322
- if (NULL == This -> pGraph ) {
323
- return DMUS_E_NOT_FOUND ;
324
- }
325
- /**
326
- * should return This, as seen in msdn
327
- * "...The segment object implements IDirectMusicGraph directly..."
328
- */
329
- * ppGraph = This -> pGraph ;
330
- IDirectMusicGraph_AddRef (This -> pGraph );
331
- return S_OK ;
319
+ FIXME ("(%p, %p): semi-stub\n" , This , graph );
320
+
321
+ if (!graph ) return E_POINTER ;
322
+ if (!(* graph = This -> pGraph )) return DMUS_E_NOT_FOUND ;
323
+ IDirectMusicGraph_AddRef (This -> pGraph );
324
+
325
+ return S_OK ;
332
326
}
333
327
334
- static HRESULT WINAPI segment_SetGraph (IDirectMusicSegment8 * iface , IDirectMusicGraph * pGraph )
328
+ static HRESULT WINAPI segment_SetGraph (IDirectMusicSegment8 * iface , IDirectMusicGraph * graph )
335
329
{
336
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
330
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
337
331
338
- FIXME ("(%p, %p): to complete\n" , This , pGraph );
339
- if (NULL != This -> pGraph ) {
340
- IDirectMusicGraph_Release (This -> pGraph );
341
- }
342
- This -> pGraph = pGraph ;
343
- if (NULL != This -> pGraph ) {
344
- IDirectMusicGraph_AddRef (This -> pGraph );
345
- }
346
- return S_OK ;
332
+ FIXME ("(%p, %p): to complete\n" , This , graph );
333
+
334
+ if (This -> pGraph ) IDirectMusicGraph_Release (This -> pGraph );
335
+ if ((This -> pGraph = graph )) IDirectMusicGraph_AddRef (This -> pGraph );
336
+
337
+ return S_OK ;
347
338
}
348
339
349
340
static HRESULT WINAPI segment_AddNotificationType (IDirectMusicSegment8 * iface , REFGUID rguidNotificationType )
@@ -451,28 +442,27 @@ static HRESULT WINAPI segment_Clone(IDirectMusicSegment8 *iface, MUSIC_TIME star
451
442
return track_clone_fail ? S_FALSE : S_OK ;
452
443
}
453
444
454
- static HRESULT WINAPI segment_SetStartPoint (IDirectMusicSegment8 * iface , MUSIC_TIME mtStart )
445
+ static HRESULT WINAPI segment_SetStartPoint (IDirectMusicSegment8 * iface , MUSIC_TIME start )
455
446
{
456
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
447
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
457
448
458
- TRACE ("(%p, %ld)\n" , This , mtStart );
459
- if ( mtStart >= This -> header . mtLength ) {
460
- return DMUS_E_OUT_OF_RANGE ;
461
- }
462
- This -> header . mtPlayStart = mtStart ;
463
- return S_OK ;
449
+ TRACE ("(%p, %ld)\n" , This , start );
450
+
451
+ if ( start >= This -> header . mtLength ) return DMUS_E_OUT_OF_RANGE ;
452
+ This -> header . mtPlayStart = start ;
453
+
454
+ return S_OK ;
464
455
}
465
456
466
- static HRESULT WINAPI segment_GetStartPoint (IDirectMusicSegment8 * iface , MUSIC_TIME * pmtStart )
457
+ static HRESULT WINAPI segment_GetStartPoint (IDirectMusicSegment8 * iface , MUSIC_TIME * start )
467
458
{
468
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
459
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
469
460
470
- TRACE ("(%p, %p)\n" , This , pmtStart );
471
- if (NULL == pmtStart ) {
472
- return E_POINTER ;
473
- }
474
- * pmtStart = This -> header .mtPlayStart ;
475
- return S_OK ;
461
+ TRACE ("(%p, %p)\n" , This , start );
462
+ if (!start ) return E_POINTER ;
463
+ * start = This -> header .mtPlayStart ;
464
+
465
+ return S_OK ;
476
466
}
477
467
478
468
static HRESULT WINAPI segment_SetLoopPoints (IDirectMusicSegment8 * iface , MUSIC_TIME start , MUSIC_TIME end )
@@ -481,27 +471,25 @@ static HRESULT WINAPI segment_SetLoopPoints(IDirectMusicSegment8 *iface, MUSIC_T
481
471
482
472
TRACE ("(%p, %ld, %ld)\n" , This , start , end );
483
473
484
- if ((end || start ) &&
485
- (start >= This -> header .mtLength || end > This -> header .mtLength || start > end ))
474
+ if ((end || start ) && (start >= This -> header .mtLength || end > This -> header .mtLength || start > end ))
486
475
return DMUS_E_OUT_OF_RANGE ;
487
-
488
476
This -> header .mtLoopStart = start ;
489
477
This -> header .mtLoopEnd = end ;
490
478
491
479
return S_OK ;
492
480
}
493
481
494
- static HRESULT WINAPI segment_GetLoopPoints (IDirectMusicSegment8 * iface , MUSIC_TIME * pmtStart , MUSIC_TIME * pmtEnd )
482
+ static HRESULT WINAPI segment_GetLoopPoints (IDirectMusicSegment8 * iface , MUSIC_TIME * start , MUSIC_TIME * end )
495
483
{
496
- IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
484
+ IDirectMusicSegment8Impl * This = impl_from_IDirectMusicSegment8 (iface );
497
485
498
- TRACE ("(%p, %p, %p)\n" , This , pmtStart , pmtEnd );
499
- if ( NULL == pmtStart || NULL == pmtEnd ) {
500
- return E_POINTER ;
501
- }
502
- * pmtStart = This -> header .mtLoopStart ;
503
- * pmtEnd = This -> header . mtLoopEnd ;
504
- return S_OK ;
486
+ TRACE ("(%p, %p, %p)\n" , This , start , end );
487
+
488
+ if (! start || ! end ) return E_POINTER ;
489
+ * start = This -> header . mtLoopStart ;
490
+ * end = This -> header .mtLoopEnd ;
491
+
492
+ return S_OK ;
505
493
}
506
494
507
495
static HRESULT WINAPI segment_SetPChannelsUsed (IDirectMusicSegment8 * iface , DWORD dwNumPChannels , DWORD * paPChannels )
0 commit comments