@@ -25,9 +25,9 @@ import com.adamratzman.spotify.models.serialization.toObject
25
25
import com.adamratzman.spotify.models.serialization.toPagingObject
26
26
import com.adamratzman.spotify.utils.Market
27
27
import com.adamratzman.spotify.utils.formatDate
28
- import kotlin.reflect.KClass
29
28
import kotlinx.serialization.list
30
29
import kotlinx.serialization.serializer
30
+ import kotlin.reflect.KClass
31
31
32
32
@Deprecated(" Endpoint name has been updated for kotlin convention consistency" , ReplaceWith (" BrowseApi" ))
33
33
typealias BrowseAPI = BrowseApi
@@ -325,33 +325,33 @@ sealed class TuneableTrackAttribute<T : Number>(
325
325
val integerOnly : Boolean ,
326
326
val min : T ? ,
327
327
val max : T ? ,
328
- val tClazz : KClass <T >
328
+ internal val tClazz : KClass <T >
329
329
) {
330
330
/* *
331
331
* A confidence measure from 0.0 to 1.0 of whether the track is acoustic.
332
332
* 1.0 represents high confidence the track is acoustic.
333
333
*/
334
- object ACOUSTICNESS : TuneableTrackAttribute<Float>(" acousticness" , false , 0f , 1f , Float : :class)
334
+ object Acousticness : TuneableTrackAttribute<Float>(" acousticness" , false , 0f , 1f , Float : :class)
335
335
336
336
/* *
337
337
* Danceability describes how suitable a track is for dancing based on a combination of musical
338
338
* elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is
339
339
* least danceable and 1.0 is most danceable.
340
340
*/
341
- object DANCEABILITY : TuneableTrackAttribute<Float>(" danceability" , false , 0f , 1f , Float : :class)
341
+ object Danceability : TuneableTrackAttribute<Float>(" danceability" , false , 0f , 1f , Float : :class)
342
342
343
343
/* *
344
344
* The duration of the track in milliseconds.
345
345
*/
346
- object DURATION_IN_MILLISECONDS : TuneableTrackAttribute<Int>(" duration_ms" , true , 0 , null , Int : :class)
346
+ object DurationInMilliseconds : TuneableTrackAttribute<Int>(" duration_ms" , true , 0 , null , Int : :class)
347
347
348
348
/* *
349
349
* Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity.
350
350
* Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy,
351
351
* while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute
352
352
* include dynamic range, perceived loudness, timbre, onset rate, and general entropy.
353
353
*/
354
- object ENERGY : TuneableTrackAttribute<Float>(" energy" , false , 0f , 1f , Float : :class)
354
+ object Energy : TuneableTrackAttribute<Float>(" energy" , false , 0f , 1f , Float : :class)
355
355
356
356
/* *
357
357
* Predicts whether a track contains no vocals. “Ooh” and “aah” sounds are treated as
@@ -360,34 +360,34 @@ sealed class TuneableTrackAttribute<T : Number>(
360
360
* no vocal content. Values above 0.5 are intended to represent instrumental tracks, but
361
361
* confidence is higher as the value approaches 1.0.
362
362
*/
363
- object INSTRUMENTALNESS : TuneableTrackAttribute<Float>(" instrumentalness" , false , 0f , 1f , Float : :class)
363
+ object Instrumentalness : TuneableTrackAttribute<Float>(" instrumentalness" , false , 0f , 1f , Float : :class)
364
364
365
365
/* *
366
366
* The key the track is in. Integers map to pitches using standard Pitch Class notation.
367
367
* E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on.
368
368
*/
369
- object KEY : TuneableTrackAttribute<Int>(" key" , true , 0 , 11 , Int : :class)
369
+ object Key : TuneableTrackAttribute<Int>(" key" , true , 0 , 11 , Int : :class)
370
370
371
371
/* *
372
372
* Detects the presence of an audience in the recording. Higher liveness values represent an increased
373
373
* probability that the track was performed live. A value above 0.8 provides strong likelihood
374
374
* that the track is live.
375
375
*/
376
- object LIVENESS : TuneableTrackAttribute<Float>(" liveness" , false , 0f , 1f , Float : :class)
376
+ object Liveness : TuneableTrackAttribute<Float>(" liveness" , false , 0f , 1f , Float : :class)
377
377
378
378
/* *
379
379
* The overall loudness of a track in decibels (dB). Loudness values are averaged across the
380
380
* entire track and are useful for comparing relative loudness of tracks. Loudness is the
381
381
* quality of a sound that is the primary psychological correlate of physical strength (amplitude).
382
382
* Values typically range between -60 and 0 db.
383
383
*/
384
- object LOUDNESS : TuneableTrackAttribute<Float>(" loudness" , false , null , null , Float : :class)
384
+ object Loudness : TuneableTrackAttribute<Float>(" loudness" , false , null , null , Float : :class)
385
385
386
386
/* *
387
387
* Mode indicates the modality (major or minor) of a track, the type of scale from which its
388
388
* melodic content is derived. Major is represented by 1 and minor is 0.
389
389
*/
390
- object MODE : TuneableTrackAttribute<Int>(" mode" , true , 0 , 1 , Int : :class)
390
+ object Mode : TuneableTrackAttribute<Int>(" mode" , true , 0 , 1 , Int : :class)
391
391
392
392
/* *
393
393
* The popularity of the track. The value will be between 0 and 100, with 100 being the most popular.
@@ -396,7 +396,7 @@ sealed class TuneableTrackAttribute<T : Number>(
396
396
* the market parameter, it is expected to find relinked tracks with popularities that do not match
397
397
* min_*, max_*and target_* popularities. These relinked tracks are accurate replacements for unplayable tracks with the expected popularity scores. Original, non-relinked tracks are available via the linked_from attribute of the relinked track response.
398
398
*/
399
- object POPULARITY : TuneableTrackAttribute<Int>(" popularity" , true , 0 , 100 , Int : :class)
399
+ object Popularity : TuneableTrackAttribute<Int>(" popularity" , true , 0 , 100 , Int : :class)
400
400
401
401
/* *
402
402
* Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the
@@ -406,28 +406,28 @@ sealed class TuneableTrackAttribute<T : Number>(
406
406
* such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like
407
407
* tracks.
408
408
*/
409
- object SPEECHINESS : TuneableTrackAttribute<Float>(" speechiness" , false , 0f , 1f , Float : :class)
409
+ object Speechiness : TuneableTrackAttribute<Float>(" speechiness" , false , 0f , 1f , Float : :class)
410
410
411
411
/* *
412
412
* The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the
413
413
* speed or pace of a given piece and derives directly from the average beat duration.
414
414
*/
415
- object TEMPO : TuneableTrackAttribute<Float>(" tempo" , false , 0f , null , Float : :class)
415
+ object Tempo : TuneableTrackAttribute<Float>(" tempo" , false , 0f , null , Float : :class)
416
416
417
417
/* *
418
418
* An estimated overall time signature of a track. The time signature (meter)
419
419
* is a notational convention to specify how many beats are in each bar (or measure).
420
420
* The time signature ranges from 3 to 7 indicating time signatures of 3/4, to 7/4.
421
421
* A value of -1 may indicate no time signature, while a value of 1 indicates a rather complex or changing time signature.
422
422
*/
423
- object TIME_SIGNATURE : TuneableTrackAttribute<Int>(" time_signature" , true , -1 , 7 , Int : :class)
423
+ object TimeSignature : TuneableTrackAttribute<Int>(" time_signature" , true , -1 , 7 , Int : :class)
424
424
425
425
/* *
426
426
* A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high
427
427
* valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence
428
428
* sound more negative (e.g. sad, depressed, angry).
429
429
*/
430
- object VALENCE : TuneableTrackAttribute<Float>(" valence" , false , 0f , 1f , Float : :class)
430
+ object Valence : TuneableTrackAttribute<Float>(" valence" , false , 0f , 1f , Float : :class)
431
431
432
432
override fun toString () = attribute
433
433
@@ -446,20 +446,20 @@ sealed class TuneableTrackAttribute<T : Number>(
446
446
447
447
companion object {
448
448
fun values () = listOf (
449
- ACOUSTICNESS ,
450
- DANCEABILITY ,
451
- DURATION_IN_MILLISECONDS ,
452
- ENERGY ,
453
- INSTRUMENTALNESS ,
454
- KEY ,
455
- LIVENESS ,
456
- LOUDNESS ,
457
- MODE ,
458
- POPULARITY ,
459
- SPEECHINESS ,
460
- TEMPO ,
461
- TIME_SIGNATURE ,
462
- VALENCE
449
+ Acousticness ,
450
+ Danceability ,
451
+ DurationInMilliseconds ,
452
+ Energy ,
453
+ Instrumentalness ,
454
+ Key ,
455
+ Liveness ,
456
+ Loudness ,
457
+ Mode ,
458
+ Popularity ,
459
+ Speechiness ,
460
+ Tempo ,
461
+ TimeSignature ,
462
+ Valence
463
463
)
464
464
}
465
465
}
0 commit comments