Class: MusicBeeIPC

Inherits:
Object
  • Object
show all
Defined in:
lib/musicbeeipc.rb

General collapse

Now Playing List collapse

Playlist collapse

Library collapse

Setting collapse

Window collapse

Instance Method Details

#clear_now_playing_listMBError

Returns:

  • (MBError)


545
546
547
# File 'lib/musicbeeipc.rb', line 545

def clear_now_playing_list()
  send_message(find_hwnd(), WM_USER, MBC_ClearNowPlayingList, 0)
end

#end_auto_djMBError

Returns:

  • (MBError)


65
66
67
# File 'lib/musicbeeipc.rb', line 65

def end_auto_dj()
  send_message(find_hwnd(), WM_USER, MBC_EndAutoDj, 0)
end

#get_artist_picture(fading_percent) ⇒ String

Parameters:

  • fading_percent (int)

Returns:

  • (String)


446
447
448
449
450
451
452
453
454
455
456
# File 'lib/musicbeeipc.rb', line 446

def get_artist_picture(fading_percent)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetArtistPicture, fading_percent)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_artist_picture_thumbString

Returns:

  • (String)


473
474
475
476
477
478
479
480
481
482
483
# File 'lib/musicbeeipc.rb', line 473

def get_artist_picture_thumb()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetArtistPictureThumb, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_artist_picture_urls(local_only) ⇒ String

Parameters:

  • local_only (bool)

Returns:

  • (String)


460
461
462
463
464
465
466
467
468
469
470
# File 'lib/musicbeeipc.rb', line 460

def get_artist_picture_urls(local_only)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetArtistPictureUrls, to_i(local_only))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_artworkString

Returns:

  • (String)


393
394
395
396
397
398
399
400
401
402
403
# File 'lib/musicbeeipc.rb', line 393

def get_artwork()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetArtwork, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_artwork_urlString

Returns:

  • (String)


406
407
408
409
410
411
412
413
414
415
416
# File 'lib/musicbeeipc.rb', line 406

def get_artwork_url()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetArtworkUrl, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_auto_dj_enabledbool

Returns:

  • (bool)


276
277
278
# File 'lib/musicbeeipc.rb', line 276

def get_auto_dj_enabled()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetAutoDjEnabled, 0))
end

#get_button_enabled(button) ⇒ bool

Parameters:

  • button (MBPlayButtonType)

Returns:

  • (bool)


585
586
587
# File 'lib/musicbeeipc.rb', line 585

def get_button_enabled(button)
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetButtonEnabled, button))
end

#get_crossfadebool

Returns:

  • (bool)


293
294
295
# File 'lib/musicbeeipc.rb', line 293

def get_crossfade()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetCrossfade, 0))
end

#get_current_indexint

Returns:

  • (int)


506
507
508
# File 'lib/musicbeeipc.rb', line 506

def get_current_index()
  send_message(find_hwnd(), WM_USER, MBC_GetCurrentIndex, 0)
end

#get_downloaded_artworkString

Returns:

  • (String)


419
420
421
422
423
424
425
426
427
428
429
# File 'lib/musicbeeipc.rb', line 419

def get_downloaded_artwork()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetDownloadedArtwork, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_downloaded_artwork_urlString

Returns:

  • (String)


432
433
434
435
436
437
438
439
440
441
442
# File 'lib/musicbeeipc.rb', line 432

def get_downloaded_artwork_url()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetDownloadedArtworkUrl, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_downloaded_lyricsString

Returns:

  • (String)


380
381
382
383
384
385
386
387
388
389
390
# File 'lib/musicbeeipc.rb', line 380

def get_downloaded_lyrics()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetDownloadedLyrics, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_dsp_enabledbool

Returns:

  • (bool)


249
250
251
# File 'lib/musicbeeipc.rb', line 249

def get_dsp_enabled()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetDspEnabled, 0))
end

#get_durationint

Returns:

  • (int)


321
322
323
# File 'lib/musicbeeipc.rb', line 321

def get_duration()
  send_message(find_hwnd(), WM_USER, MBC_GetDuration, 0)
end

#get_equalizer_enabledbool

Returns:

  • (bool)


238
239
240
# File 'lib/musicbeeipc.rb', line 238

def get_equalizer_enabled()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetEqualizerEnabled, 0))
end

#get_file_property(file_property) ⇒ String

Parameters:

  • file_property (MBFileProperty)

Returns:

  • (String)


340
341
342
343
344
345
346
347
348
349
350
# File 'lib/musicbeeipc.rb', line 340

def get_file_property(file_property)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetFileProperty, file_property)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_file_tag(field) ⇒ String

Parameters:

  • field (MBMetaData)

Returns:

  • (String)


354
355
356
357
358
359
360
361
362
363
364
# File 'lib/musicbeeipc.rb', line 354

def get_file_tag(field)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetFileTag, field)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_file_urlString

Returns:

  • (String)


326
327
328
329
330
331
332
333
334
335
336
# File 'lib/musicbeeipc.rb', line 326

def get_file_url()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetFileUrl, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_lyricsString

Returns:

  • (String)


367
368
369
370
371
372
373
374
375
376
377
# File 'lib/musicbeeipc.rb', line 367

def get_lyrics()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetLyrics, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_music_bee_versionMBMusicBeeVersion

Returns:

  • (MBMusicBeeVersion)


1369
1370
1371
# File 'lib/musicbeeipc.rb', line 1369

def get_music_bee_version()
  send_message(find_hwnd(), WM_USER, MBC_MusicBeeVersion, 0)
end

#get_music_bee_version_strString

Returns:

  • (String)


1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
# File 'lib/musicbeeipc.rb', line 1374

def get_music_bee_version_str()
  case send_message(find_hwnd(), WM_USER, MBC_MusicBeeVersion, 0)
  when MBMBV_v2_0
    "2.0"
  when MBMBV_v2_1
    "2.1"
  when MBMBV_v2_2
    "2.2"
  when MBMBV_v2_3
    "2.3"
  else
    "Unknown"
  end
end

#get_music_bee_version_symString

Returns:

  • (String)


1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
# File 'lib/musicbeeipc.rb', line 1390

def get_music_bee_version_sym()
  case send_message(find_hwnd(), WM_USER, MBC_MusicBeeVersion, 0)
  when MBMBV_v2_0
    :v2_0
  when MBMBV_v2_1
    :v2_1
  when MBMBV_v2_2
    :v2_2
  when MBMBV_v2_3
    :v2_3
  else
    :Unknown
  end
end

#get_mutebool

Returns:

  • (bool)


205
206
207
# File 'lib/musicbeeipc.rb', line 205

def get_mute()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetMute, 0))
end

#get_next_index(offset) ⇒ int

Parameters:

  • offset (int)

Returns:

  • (int)


512
513
514
# File 'lib/musicbeeipc.rb', line 512

def get_next_index(offset)
  send_message(find_hwnd(), WM_USER, MBC_GetNextIndex, offset)
end

#get_play_stateMBPlayState

Returns:

  • (MBPlayState)


70
71
72
# File 'lib/musicbeeipc.rb', line 70

def get_play_state()
  send_message(find_hwnd(), WM_USER, MBC_GetPlayState, 0)
end

#get_play_state_strString

Returns:

  • (String)


75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/musicbeeipc.rb', line 75

def get_play_state_str()
  case send_message(find_hwnd(), WM_USER, MBC_GetPlayState, 0)
  when MBPS_Loading
    "Loading"
  when MBPS_Playing
    "Playing"
  when MBPS_Paused
    "Paused"
  when MBPS_Stopped
    "Stopped"
  else
    "Undefined"
  end
end

#get_play_state_symString

Returns:

  • (String)


91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/musicbeeipc.rb', line 91

def get_play_state_sym()
  case send_message(find_hwnd(), WM_USER, MBC_GetPlayState, 0)
  when MBPS_Loading
    :Loading
  when MBPS_Playing
    :Playing
  when MBPS_Paused
    :Paused
  when MBPS_Stopped
    :Stopped
  else
    :Undefined
  end
end

#get_plugin_versionArray<int>

Returns:

  • (Array<int>)


1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
# File 'lib/musicbeeipc.rb', line 1419

def get_plugin_version()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_PluginVersion, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r.split(".").map { |s| s.to_i }
end

#get_plugin_version_strString

Returns:

  • (String)


1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
# File 'lib/musicbeeipc.rb', line 1406

def get_plugin_version_str()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_PluginVersion, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_positionint

Returns:

  • (int)


107
108
109
# File 'lib/musicbeeipc.rb', line 107

def get_position()
  send_message(find_hwnd(), WM_USER, MBC_GetPosition, 0)
end

#get_repeatMBRepeatMode

Returns:

  • (MBRepeatMode)


227
228
229
# File 'lib/musicbeeipc.rb', line 227

def get_repeat()
  send_message(find_hwnd(), WM_USER, MBC_GetRepeat, 0)
end

#get_replay_gain_modeMBReplayGainMode

Returns:

  • (MBReplayGainMode)


304
305
306
# File 'lib/musicbeeipc.rb', line 304

def get_replay_gain_mode()
  send_message(find_hwnd(), WM_USER, MBC_GetReplayGainMode, 0)
end

#get_scrobble_enabledbool

Returns:

  • (bool)


260
261
262
# File 'lib/musicbeeipc.rb', line 260

def get_scrobble_enabled()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetScrobbleEnabled, 0))
end

#get_show_rating_lovebool

Returns:

  • (bool)


579
580
581
# File 'lib/musicbeeipc.rb', line 579

def get_show_rating_love()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetShowRatingLove, 0))
end

#get_show_rating_trackbool

Returns:

  • (bool)


574
575
576
# File 'lib/musicbeeipc.rb', line 574

def get_show_rating_track()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetShowRatingTrack, 0))
end

#get_show_time_remainingbool

Returns:

  • (bool)


569
570
571
# File 'lib/musicbeeipc.rb', line 569

def get_show_time_remaining()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetShowTimeRemaining, 0))
end

#get_shufflebool

Returns:

  • (bool)


216
217
218
# File 'lib/musicbeeipc.rb', line 216

def get_shuffle()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetShuffle, 0))
end

#get_soundtrack_picture_urls(local_only) ⇒ String

Parameters:

  • local_only (bool)

Returns:

  • (String)


492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/musicbeeipc.rb', line 492

def get_soundtrack_picture_urls(local_only)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_GetSoundtrackPictureUrls,
                    to_i(local_only))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#get_stop_after_current_enabledbool

Returns:

  • (bool)


281
282
283
# File 'lib/musicbeeipc.rb', line 281

def get_stop_after_current_enabled()
  to_b(send_message(find_hwnd(), WM_USER, MBC_GetStopAfterCurrentEnabled, 0))
end

#get_volumeint

Volume - Value between 0 - 100

Returns:

  • (int)


129
130
131
# File 'lib/musicbeeipc.rb', line 129

def get_volume()
  send_message(find_hwnd(), WM_USER, MBC_GetVolume, 0)
end

#get_volumeffloat

Floating point volume - Value between 0.0 - 1.0

Returns:

  • (float)


179
180
181
# File 'lib/musicbeeipc.rb', line 179

def get_volumef()
  FloatInt.new(i:send_message(find_hwnd(), WM_USER, MBC_GetVolumef, 0))[:f]
end

#get_volumepint

Precise volume - Value between 0 - 10000

Returns:

  • (int)


154
155
156
# File 'lib/musicbeeipc.rb', line 154

def get_volumep()
  send_message(find_hwnd(), WM_USER, MBC_GetVolumep, 0)
end

#is_any_following_tracksbool

Returns:

  • (bool)


522
523
524
# File 'lib/musicbeeipc.rb', line 522

def is_any_following_tracks()
  to_b(send_message(find_hwnd(), WM_USER, MBC_IsAnyFollowingTracks, 0))
end

#is_any_prior_tracksbool

Returns:

  • (bool)


517
518
519
# File 'lib/musicbeeipc.rb', line 517

def is_any_prior_tracks()
  to_b(send_message(find_hwnd(), WM_USER, MBC_IsAnyPriorTracks, 0))
end

#is_soundtrackbool

Returns:

  • (bool)


486
487
488
# File 'lib/musicbeeipc.rb', line 486

def is_soundtrack()
  to_b(send_message(find_hwnd(), WM_USER, MBC_IsSoundtrack, 0))
end

#jump(index) ⇒ MBError

Parameters:

  • index (int)

Returns:

  • (MBError)


591
592
593
# File 'lib/musicbeeipc.rb', line 591

def jump(index)
  send_message(find_hwnd(), WM_USER, MBC_Jump, index)
end

#library_add_file_to_library(file_url, category) ⇒ String

Parameters:

  • file_url (String)
  • category (MBLibraryCategory)

Returns:

  • (String)


1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'lib/musicbeeipc.rb', line 1094

def library_add_file_to_library(file_url, category)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_AddFileToLibrary,
                    pack_si(file_url, category))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_commit_tags_to_file(file_url) ⇒ MBError

Parameters:

  • file_url (String)

Returns:

  • (MBError)


990
991
992
993
# File 'lib/musicbeeipc.rb', line 990

def library_commit_tags_to_file(file_url)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Library_CommitTagsToFile,
               pack_s(file_url))
end

#library_get_artist_picture(artist_name, fading_percent, fading_color) ⇒ String

Parameters:

  • artist_name (String)
  • fading_percent (int)
  • fading_color (int)

Returns:

  • (String)


1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/musicbeeipc.rb', line 1047

def library_get_artist_picture(artist_name, fading_percent, fading_color)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetArtistPicture,
                    pack_si(artist_name, fading_percent, fading_color))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_get_artist_picture_thumb(artist_name) ⇒ String

Parameters:

  • artist_name (String)

Returns:

  • (String)


1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
# File 'lib/musicbeeipc.rb', line 1078

def library_get_artist_picture_thumb(artist_name)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetArtistPictureThumb,
                    pack_s(artist_name))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_get_artist_picture_urls(artist_name, local_only) ⇒ String

Parameters:

  • artist_name (String)
  • local_only (int)

Returns:

  • (String)


1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
# File 'lib/musicbeeipc.rb', line 1063

def library_get_artist_picture_urls(artist_name, local_only)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetArtistPictureUrls,
                    pack_sb(artist_name, local_only))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_get_artwork(file_url, index) ⇒ String

Parameters:

  • file_url (String)
  • index (int)

Returns:

  • (String)


1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/musicbeeipc.rb', line 1014

def library_get_artwork(file_url, index)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetArtwork,
                    pack_si(file_url, index))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_get_artwork_url(file_url, index) ⇒ String

Parameters:

  • file_url (String)
  • index (int)

Returns:

  • (String)


1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
# File 'lib/musicbeeipc.rb', line 1030

def library_get_artwork_url(file_url, index)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetArtworkUrl,
                    pack_si(file_url, index))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_get_file_property(file_url, file_property) ⇒ String

Parameters:

  • file_url (String)
  • file_property (MBFileProperty)

Returns:

  • (String)


950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/musicbeeipc.rb', line 950

def library_get_file_property(file_url, file_property)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetFileProperty,
                    pack_si(file_url, file_property))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_get_file_tag(file_url, field) ⇒ String

Parameters:

  • file_url (String)
  • field (MBMetaData)

Returns:

  • (String)


966
967
968
969
970
971
972
973
974
975
976
977
# File 'lib/musicbeeipc.rb', line 966

def library_get_file_tag(file_url, field)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetFileTag,
                    pack_si(file_url, field))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_get_lyrics(file_url, lyrics_type) ⇒ String

Parameters:

  • file_url (String)
  • lyrics_type (MBLyricsType)

Returns:

  • (String)


998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
# File 'lib/musicbeeipc.rb', line 998

def library_get_lyrics(file_url, lyrics_type)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_GetLyrics,
                    pack_si(file_url, lyrics_type))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_jump(index) ⇒ MBError

Parameters:

  • index (int)

Returns:

  • (MBError)


1189
1190
1191
# File 'lib/musicbeeipc.rb', line 1189

def library_jump(index)
  send_message(find_hwnd(), WM_USER, MBC_Library_Jump, index)
end

#library_query_files(query) ⇒ MBError

Parameters:

  • query (String)

Returns:

  • (MBError)


1109
1110
1111
1112
# File 'lib/musicbeeipc.rb', line 1109

def library_query_files(query)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Library_QueryFiles,
               pack_s(query))
end

#library_query_files_ex(query) ⇒ Array<String>

Parameters:

  • query (String)

Returns:

  • (Array<String>)


1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
# File 'lib/musicbeeipc.rb', line 1142

def library_query_files_ex(query)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_QueryFilesEx,
                    pack_s(query))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_query_get_all_filesString

Returns:

  • (String)


1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
# File 'lib/musicbeeipc.rb', line 1128

def library_query_get_all_files()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_Library_QueryGetAllFiles, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_query_get_lookup_table_value(key) ⇒ Array<String>

Parameters:

  • key (String)

Returns:

  • (Array<String>)


1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
# File 'lib/musicbeeipc.rb', line 1174

def library_query_get_lookup_table_value(key)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_QueryGetLookupTableValue,
                    pack_s(key))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_query_get_next_fileString

Returns:

  • (String)


1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/musicbeeipc.rb', line 1115

def library_query_get_next_file()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_Library_QueryGetNextFile, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_query_lookup_table(key_tags, value_tags, query) ⇒ MBError

Parameters:

  • key_tags (String)
  • value_tags (String)
  • query (String)

Returns:

  • (MBError)


1167
1168
1169
1170
# File 'lib/musicbeeipc.rb', line 1167

def library_query_lookup_table(key_tags, value_tags, query)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Library_QueryLookupTable,
               pack_s(key_tags, value_tags, query))
end

#library_query_similar_artists(artist_name, minimum_artist_similarity_rating) ⇒ MBError

Parameters:

  • artist_name (String)
  • minimum_artist_similarity_rating (double)

Returns:

  • (MBError)


1158
1159
1160
1161
# File 'lib/musicbeeipc.rb', line 1158

def library_query_similar_artists(artist_name, minimum_artist_similarity_rating)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Library_QueryLookupTable,
               pack_sd(artist_name, minimum_artist_similarity_rating))
end

#library_search(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ Array<String>

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (Array<String>)


1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
# File 'lib/musicbeeipc.rb', line 1197

def library_search(query, comparison="Contains",
                   fields=["ArtistPeople", "Title", "Album"])
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_Search,
                    pack_sssa(query, comparison, fields))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_search_and_play_first(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ MBError

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (MBError)


1261
1262
1263
1264
1265
# File 'lib/musicbeeipc.rb', line 1261

def library_search_and_play_first(query, comparison="Contains",
                                  fields=["ArtistPeople", "Title", "Album"])
  send_message(find_hwnd(), WM_COPYDATA, MBC_Library_SearchAndPlayFirst,
               pack_sssa(query, comparison, fields))
end

#library_search_first(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ String

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (String)


1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/musicbeeipc.rb', line 1215

def library_search_first(query, comparison="Contains",
                         fields=["ArtistPeople", "Title", "Album"])
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_SearchFirst,
                    pack_sssa(query, comparison, fields))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_search_first_index(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ int

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (int)


1251
1252
1253
1254
1255
# File 'lib/musicbeeipc.rb', line 1251

def library_search_first_index(query, comparison="Contains",
                               fields=["ArtistPeople", "Title", "Album"])
  send_message(find_hwnd(), WM_COPYDATA, MBC_Library_SearchFirstIndex,
               pack_sssa(query, comparison, fields))
end

#library_search_indices(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ Array<int>

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (Array<int>)


1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/musicbeeipc.rb', line 1233

def library_search_indices(query, comparison="Contains",
                           fields=["ArtistPeople", "Title", "Album"])
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Library_SearchIndices,
                    pack_sssa(query, comparison, fields))
  
  r = unpack_ia(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#library_set_file_tag(file_url, field, value) ⇒ MBError

Parameters:

  • file_url (String)
  • field (MBMetaData)
  • value (String)

Returns:

  • (MBError)


983
984
985
986
# File 'lib/musicbeeipc.rb', line 983

def library_set_file_tag(file_url, field, value)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Library_SetFileTag,
               pack_sis(file_url, field, value))
end

#message_box(text, caption) ⇒ MBError

Parameters:

  • text (String)
  • caption (String)

Returns:

  • (MBError)


1439
1440
1441
1442
# File 'lib/musicbeeipc.rb', line 1439

def message_box(text, caption)
  send_message(find_hwnd(), WM_COPYDATA, MBC_MessageBox,
               pack_s(text, caption))
end

#move_files(from_indices, to_index) ⇒ MBError

Parameters:

  • from_indices (Array<int>)
  • to_index (int)

Returns:

  • (MBError)


558
559
560
561
# File 'lib/musicbeeipc.rb', line 558

def move_files(from_indices, to_index)
  send_message(find_hwnd(), WM_COPYDATA, MBC_MoveFiles,
               pack_iai(from_indices, to_index))
end

#next_trackMBError

Returns:

  • (MBError)


55
56
57
# File 'lib/musicbeeipc.rb', line 55

def next_track()
  send_message(find_hwnd(), WM_USER, MBC_NextTrack, 0)
end

#now_playing_list_get_file_property(index, file_property) ⇒ String

Parameters:

  • index (int)
  • file_property (MBFileProperty)

Returns:

  • (String)


688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/musicbeeipc.rb', line 688

def now_playing_list_get_file_property(index, file_property)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_NowPlayingList_GetFileProperty,
                    pack_i(index, file_property))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#now_playing_list_get_file_tag(index, field) ⇒ String

Parameters:

  • index (int)
  • field (MBMetaData)

Returns:

  • (String)


704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/musicbeeipc.rb', line 704

def now_playing_list_get_file_tag(index, field)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_NowPlayingList_GetFileTag,
                    pack_i(index, field))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#now_playing_list_get_item_countint

Returns:

  • (int)


772
773
774
# File 'lib/musicbeeipc.rb', line 772

def now_playing_list_get_item_count()
  send_message(find_hwnd(), WM_USER, MBC_NowPlayingList_GetItemCount, 0)
end

#now_playing_list_get_list_file_url(index) ⇒ String

Parameters:

  • index (int)

Returns:

  • (String)


673
674
675
676
677
678
679
680
681
682
683
# File 'lib/musicbeeipc.rb', line 673

def now_playing_list_get_list_file_url(index)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_NowPlayingList_GetListFileUrl, index)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#now_playing_list_play_library_shuffledMBError

Returns:

  • (MBError)


766
767
768
769
# File 'lib/musicbeeipc.rb', line 766

def now_playing_list_play_library_shuffled()
  send_message(find_hwnd(), WM_USER,
               MBC_NowPlayingList_PlayLibraryShuffled, 0)
end

#now_playing_list_query_files(query) ⇒ MBError

Parameters:

  • query (String)

Returns:

  • (MBError)


719
720
721
722
# File 'lib/musicbeeipc.rb', line 719

def now_playing_list_query_files(query)
  send_message(find_hwnd(), WM_COPYDATA, MBC_NowPlayingList_QueryFiles,
               pack_s(query))
end

#now_playing_list_query_files_ex(query) ⇒ Array<String>

Parameters:

  • query (String)

Returns:

  • (Array<String>)


752
753
754
755
756
757
758
759
760
761
762
763
# File 'lib/musicbeeipc.rb', line 752

def now_playing_list_query_files_ex(query)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_NowPlayingList_QueryFilesEx,
                    pack_s(query))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#now_playing_list_query_get_all_filesString

Returns:

  • (String)


738
739
740
741
742
743
744
745
746
747
748
# File 'lib/musicbeeipc.rb', line 738

def now_playing_list_query_get_all_files()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_NowPlayingList_QueryGetAllFiles, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#now_playing_list_query_get_next_fileString

Returns:

  • (String)


725
726
727
728
729
730
731
732
733
734
735
# File 'lib/musicbeeipc.rb', line 725

def now_playing_list_query_get_next_file()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_NowPlayingList_QueryGetNextFile, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#pauseMBError

Returns:

  • (MBError)


35
36
37
# File 'lib/musicbeeipc.rb', line 35

def pause()
  send_message(find_hwnd(), WM_USER, MBC_Pause, 0)
end

#playMBError

Returns:

  • (MBError)


30
31
32
# File 'lib/musicbeeipc.rb', line 30

def play()
  send_message(find_hwnd(), WM_USER, MBC_Play, 0)
end

#play_now(fileurl) ⇒ MBError

Parameters:

  • fileurl (String)

Returns:

  • (MBError)


528
529
530
# File 'lib/musicbeeipc.rb', line 528

def play_now(fileurl)
  send_message(find_hwnd(), WM_COPYDATA, MBC_PlayNow, pack_s(fileurl))
end

#play_pauseMBError

Returns:

  • (MBError)


25
26
27
# File 'lib/musicbeeipc.rb', line 25

def play_pause()
  send_message(find_hwnd(), WM_USER, MBC_PlayPause, 0)
end

#playlist_append_files(playlist_url, filenames) ⇒ MBError

Parameters:

  • playlist_url (String)
  • filenames (Array<String>)

Returns:

  • (MBError)


909
910
911
912
# File 'lib/musicbeeipc.rb', line 909

def playlist_append_files(playlist_url, filenames)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_AppendFiles,
               pack_ssa(playlist_url, filenames))
end

#playlist_create_playlist(folder_name, playlist_name, filenames) ⇒ String

Parameters:

  • folder_name (String)
  • playlist_name (String)
  • filenames (Array<String>)

Returns:

  • (String)


878
879
880
881
882
883
884
885
886
887
888
889
# File 'lib/musicbeeipc.rb', line 878

def playlist_create_playlist(folder_name, playlist_name, filenames)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Playlist_CreatePlaylist,
                    pack_sssa(folder_name, playlist_name, filenames))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#playlist_delete_playlist(playlist_url) ⇒ MBError

Parameters:

  • playlist_url (String)

Returns:

  • (MBError)


893
894
895
896
# File 'lib/musicbeeipc.rb', line 893

def playlist_delete_playlist(playlist_url)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_DeletePlaylist,
               pack_s(playlist_url))
end

#playlist_get_item_count(playlist_url) ⇒ int

Parameters:

  • playlist_url (String)

Returns:

  • (int)


940
941
942
943
# File 'lib/musicbeeipc.rb', line 940

def playlist_get_item_count(playlist_url)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_GetItemCount,
               pack_s(playlist_url))
end

#playlist_get_name(playlist_url) ⇒ String

Parameters:

  • playlist_url (String)

Returns:

  • (String)


780
781
782
783
784
785
786
787
788
789
790
791
# File 'lib/musicbeeipc.rb', line 780

def playlist_get_name(playlist_url)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Playlist_GetName,
                    pack_s(playlist_url))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#playlist_get_type(playlist_url) ⇒ MBPlaylistFormat

Parameters:

  • playlist_url (String)

Returns:

  • (MBPlaylistFormat)


795
796
797
798
# File 'lib/musicbeeipc.rb', line 795

def playlist_get_type(playlist_url)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_GetType,
               pack_s(playlist_url))
end

#playlist_is_in_list(playlist_url, filename) ⇒ bool

Parameters:

  • playlist_url (String)
  • filename (String)

Returns:

  • (bool)


803
804
805
806
# File 'lib/musicbeeipc.rb', line 803

def playlist_is_in_list(playlist_url, filename)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_IsInList,
               pack_s(playlist_url, filename))
end

#playlist_move_files(playlist_url, from_indices, to_index) ⇒ MBError

Parameters:

  • playlist_url (String)
  • from_indices (Array<int>)
  • to_index (int)

Returns:

  • (MBError)


926
927
928
929
# File 'lib/musicbeeipc.rb', line 926

def playlist_move_files(playlist_url, from_indices, to_index)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_MoveFiles,
               pack_siai(playlist_url, from_indices, to_index))
end

#playlist_play_now(playlist_url) ⇒ MBError

Parameters:

  • playlist_url (String)

Returns:

  • (MBError)


933
934
935
936
# File 'lib/musicbeeipc.rb', line 933

def playlist_play_now(playlist_url)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_PlayNow,
               pack_s(playlist_url))
end

#playlist_query_files(playlist_url) ⇒ MBError

Parameters:

  • playlist_url (String)

Returns:

  • (MBError)


828
829
830
831
# File 'lib/musicbeeipc.rb', line 828

def playlist_query_files(playlist_url)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_QueryFiles,
               pack_s(playlist_url))
end

#playlist_query_files_ex(playlist_url) ⇒ Array<String>

Parameters:

  • playlist_url (String)

Returns:

  • (Array<String>)


861
862
863
864
865
866
867
868
869
870
871
872
# File 'lib/musicbeeipc.rb', line 861

def playlist_query_files_ex(playlist_url)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Playlist_QueryFilesEx,
                    pack_s(playlist_url))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#playlist_query_get_all_filesString

Returns:

  • (String)


847
848
849
850
851
852
853
854
855
856
857
# File 'lib/musicbeeipc.rb', line 847

def playlist_query_get_all_files()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_Playlist_QueryGetAllFiles, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#playlist_query_get_next_fileString

Returns:

  • (String)


834
835
836
837
838
839
840
841
842
843
844
# File 'lib/musicbeeipc.rb', line 834

def playlist_query_get_next_file()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_Playlist_QueryGetNextFile, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#playlist_query_get_next_playlistString

Returns:

  • (String)


814
815
816
817
818
819
820
821
822
823
824
# File 'lib/musicbeeipc.rb', line 814

def playlist_query_get_next_playlist()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_Playlist_QueryGetNextPlaylist, 0)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#playlist_query_playlistsMBError

Returns:

  • (MBError)


809
810
811
# File 'lib/musicbeeipc.rb', line 809

def playlist_query_playlists()
  send_message(find_hwnd(), WM_USER, MBC_Playlist_QueryPlaylists, 0)
end

#playlist_remove_at(playlist_url, index) ⇒ MBError

Parameters:

  • playlist_url (String)
  • index (int)

Returns:

  • (MBError)


917
918
919
920
# File 'lib/musicbeeipc.rb', line 917

def playlist_remove_at(playlist_url, index)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_RemoveAt,
               pack_si(playlist_url, index))
end

#playlist_set_files(playlist_url, filenames) ⇒ MBError

Parameters:

  • playlist_url (String)
  • filenames (Array<String>)

Returns:

  • (MBError)


901
902
903
904
# File 'lib/musicbeeipc.rb', line 901

def playlist_set_files(playlist_url, filenames)
  send_message(find_hwnd(), WM_COPYDATA, MBC_Playlist_SetFiles,
               pack_ssa(playlist_url, filenames))
end

#positionint

Returns:

  • (int)


118
119
120
# File 'lib/musicbeeipc.rb', line 118

def position
  send_message(find_hwnd(), WM_USER, MBC_GetPosition, 0)
end

#position=(position) ⇒ Object

Parameters:

  • position (int)


123
124
125
# File 'lib/musicbeeipc.rb', line 123

def position=(position)
  send_message(find_hwnd(), WM_USER, MBC_SetPosition, position)
end

#previous_trackMBError

Returns:

  • (MBError)


50
51
52
# File 'lib/musicbeeipc.rb', line 50

def previous_track()
  send_message(find_hwnd(), WM_USER, MBC_PreviousTrack, 0)
end

#probebool

Returns:

  • (bool)


20
21
22
# File 'lib/musicbeeipc.rb', line 20

def probe()
  send_message(find_hwnd(), WM_USER, MBC_Probe, 0) != MBE_Error
end

#queue_last(fileurl) ⇒ MBError

Parameters:

  • fileurl (String)

Returns:

  • (MBError)


540
541
542
# File 'lib/musicbeeipc.rb', line 540

def queue_last(fileurl)
  send_message(find_hwnd(), WM_COPYDATA, MBC_QueueLast, pack_s(fileurl))
end

#queue_next(fileurl) ⇒ MBError

Parameters:

  • fileurl (String)

Returns:

  • (MBError)


534
535
536
# File 'lib/musicbeeipc.rb', line 534

def queue_next(fileurl)
  send_message(find_hwnd(), WM_COPYDATA, MBC_QueueNext, pack_s(fileurl))
end

#queue_random_tracksMBError

Parameters:

  • count (int)

Returns:

  • (MBError)


316
317
318
# File 'lib/musicbeeipc.rb', line 316

def queue_random_tracks()
  send_message(find_hwnd(), WM_USER, MBC_QueueRandomTracks, count)
end

#remove_at(index) ⇒ MBError

Parameters:

  • index (int)

Returns:

  • (MBError)


551
552
553
# File 'lib/musicbeeipc.rb', line 551

def remove_at(index)
  send_message(find_hwnd(), WM_USER, MBC_RemoveAt, index)
end

#search(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ Array<String>

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (Array<String>)


599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/musicbeeipc.rb', line 599

def search(query, comparison="Contains",
           fields=["ArtistPeople", "Title", "Album"])
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Search,
                    pack_sssa(query, comparison, fields))
  
  r = unpack_sa(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#search_and_play_first(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ MBError

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (MBError)


663
664
665
666
667
# File 'lib/musicbeeipc.rb', line 663

def search_and_play_first(query, comparison="Contains",
                          fields=["ArtistPeople", "Title", "Album"])
  send_message(find_hwnd(), WM_COPYDATA, MBC_SearchAndPlayFirst,
               pack_sssa(query, comparison, fields))
end

#search_first(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ String

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (String)


617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/musicbeeipc.rb', line 617

def search_first(query, comparison="Contains",
                 fields=["ArtistPeople", "Title", "Album"])
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_SearchFirst,
                    pack_sssa(query, comparison, fields))
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#search_first_index(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ int

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (int)


653
654
655
656
657
# File 'lib/musicbeeipc.rb', line 653

def search_first_index(query, comparison="Contains",
                       fields=["ArtistPeople", "Title", "Album"])
  send_message(find_hwnd(), WM_COPYDATA, MBC_SearchFirstIndex,
               pack_sssa(query, comparison, fields))
end

#search_indices(query, comparison = "Contains", fields = ["ArtistPeople", "Title", "Album"]) ⇒ Array<int>

Parameters:

  • query (String)
  • comparison (String) (defaults to: "Contains")
  • fields (Array<String>) (defaults to: ["ArtistPeople", "Title", "Album"])

Returns:

  • (Array<int>)


635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/musicbeeipc.rb', line 635

def search_indices(query, comparison="Contains",
                   fields=["ArtistPeople", "Title", "Album"])
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_SearchIndices,
                    pack_sssa(query, comparison, fields))
  
  r = unpack_ia(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#set_crossfade(crossfade) ⇒ MBError

Parameters:

  • crossfade (bool)

Returns:

  • (MBError)


299
300
301
# File 'lib/musicbeeipc.rb', line 299

def set_crossfade(crossfade)
  send_message(find_hwnd(), WM_USER, MBC_SetCrossfade, to_i(crossfade))
end

#set_dsp_enabled(enabled) ⇒ MBError

Parameters:

  • enabled (bool)

Returns:

  • (MBError)


255
256
257
# File 'lib/musicbeeipc.rb', line 255

def set_dsp_enabled(enabled)
  send_message(find_hwnd(), WM_USER, MBC_SetDspEnabled, to_i(enabled))
end

#set_equalizer_enabled(enabled) ⇒ MBError

Parameters:

  • enabled (bool)

Returns:

  • (MBError)


244
245
246
# File 'lib/musicbeeipc.rb', line 244

def set_equalizer_enabled(enabled)
  send_message(find_hwnd(), WM_USER, MBC_SetEqualizerEnabled, to_i(enabled))
end

#set_mute(mute) ⇒ MBError

Parameters:

  • mute (bool)

Returns:

  • (MBError)


211
212
213
# File 'lib/musicbeeipc.rb', line 211

def set_mute(mute)
  send_message(find_hwnd(), WM_USER, MBC_SetMute, to_i(mute))
end

#set_position(position) ⇒ MBError

Parameters:

  • position (int)

Returns:

  • (MBError)


113
114
115
# File 'lib/musicbeeipc.rb', line 113

def set_position(position)
  send_message(find_hwnd(), WM_USER, MBC_SetPosition, position)
end

#set_repeat(repeat) ⇒ MBError

Parameters:

  • repeat (MBRepeatMode)

Returns:

  • (MBError)


233
234
235
# File 'lib/musicbeeipc.rb', line 233

def set_repeat(repeat)
  send_message(find_hwnd(), WM_USER, MBC_SetRepeat, repeat)
end

#set_replay_gain_mode(mode) ⇒ MBError

Parameters:

  • mode (MBReplayGainMode)

Returns:

  • (MBError)


310
311
312
# File 'lib/musicbeeipc.rb', line 310

def set_replay_gain_mode(mode)
  send_message(find_hwnd(), WM_USER, MBC_SetReplayGainMode, mode)
end

#set_scrobble_enabled(enabled) ⇒ MBError

Parameters:

  • enabled (bool)

Returns:

  • (MBError)


266
267
268
# File 'lib/musicbeeipc.rb', line 266

def set_scrobble_enabled(enabled)
  send_message(find_hwnd(), WM_USER, MBC_SetScrobbleEnabled, to_i(enabled))
end

#set_shuffle(shuffle) ⇒ MBError

Parameters:

  • shuffle (bool)

Returns:

  • (MBError)


222
223
224
# File 'lib/musicbeeipc.rb', line 222

def set_shuffle(shuffle)
  send_message(find_hwnd(), WM_USER, MBC_SetShuffle, to_i(shuffle))
end

#set_stop_after_current_enabled(enabled) ⇒ bool

Parameters:

  • enabled (bool)

Returns:

  • (bool)


287
288
289
290
# File 'lib/musicbeeipc.rb', line 287

def set_stop_after_current_enabled(enabled)
  send_message(find_hwnd(), WM_USER, MBC_SetStopAfterCurrentEnabled,
               to_i(enabled))
end

#set_volume(volume) ⇒ MBError

Volume - Value between 0 - 100

Parameters:

  • volume (int)

Returns:

  • (MBError)


136
137
138
# File 'lib/musicbeeipc.rb', line 136

def set_volume(volume)
  send_message(find_hwnd(), WM_USER, MBC_SetVolume, volume)
end

#set_volumef(volume) ⇒ MBError

Floating point volume - Value between 0.0 - 1.0

Parameters:

  • volume (float)

Returns:

  • (MBError)


186
187
188
189
# File 'lib/musicbeeipc.rb', line 186

def set_volumef(volume)
  send_message(find_hwnd(), WM_USER, MBC_SetVolumef,
               FloatInt.new(f:volume)[:i])
end

#set_volumep(volume) ⇒ MBError

Precise volume - Value between 0 - 10000

Parameters:

  • volume (int)

Returns:

  • (MBError)


161
162
163
# File 'lib/musicbeeipc.rb', line 161

def set_volumep(volume)
  send_message(find_hwnd(), WM_USER, MBC_SetVolumep, volume)
end

#setting_get_data_type(field) ⇒ MBDataType

Parameters:

  • field (MBMetaData)

Returns:

  • (MBDataType)


1285
1286
1287
# File 'lib/musicbeeipc.rb', line 1285

def setting_get_data_type(field)
  send_message(find_hwnd(), WM_USER, MBC_Setting_GetDataType, field)
end

#setting_get_field_name(field) ⇒ String

Parameters:

  • field (MBMetaData)

Returns:

  • (String)


1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# File 'lib/musicbeeipc.rb', line 1271

def setting_get_field_name(field)
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_COPYDATA, MBC_Setting_GetFieldName, field)
  
  r = unpack_s(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#show_equalizerMBError

Returns:

  • (MBError)


271
272
273
# File 'lib/musicbeeipc.rb', line 271

def show_equalizer()
  send_message(find_hwnd(), WM_USER, MBC_ShowEqualiser, 0)
end

#show_now_playing_assistantMBError

Returns:

  • (MBError)


564
565
566
# File 'lib/musicbeeipc.rb', line 564

def show_now_playing_assistant()
  send_message(find_hwnd(), WM_USER, MBC_ShowNowPlayingAssistant, 0)
end

#start_auto_djMBError

Returns:

  • (MBError)


60
61
62
# File 'lib/musicbeeipc.rb', line 60

def start_auto_dj()
  send_message(find_hwnd(), WM_USER, MBC_StartAutoDj, 0)
end

#stopMBError

Returns:

  • (MBError)


40
41
42
# File 'lib/musicbeeipc.rb', line 40

def stop()
  send_message(find_hwnd(), WM_USER, MBC_Stop, 0)
end

#stop_after_currentMBError

Returns:

  • (MBError)


45
46
47
# File 'lib/musicbeeipc.rb', line 45

def stop_after_current()
  send_message(find_hwnd(), WM_USER, MBC_StopAfterCurrent, 0)
end

#testMBError

Returns:

  • (MBError)


1432
1433
1434
# File 'lib/musicbeeipc.rb', line 1432

def test()
  send_message(find_hwnd(), WM_USER, MBC_Test, 0)
end

#to_byte_array(str) ⇒ Array<uint8>

Converts returned String to byte array

Parameters:

  • str (String to convert)

Returns:

  • (Array<uint8>)


1455
1456
1457
# File 'lib/musicbeeipc.rb', line 1455

def to_byte_array(str)
  str.encode("UTF-16LE").force_encoding("BINARY").unpack("C*")
end

#to_bytes(str) ⇒ String

Converts returned String to bytes

Parameters:

  • str (String to convert)

Returns:

  • (String)


1448
1449
1450
# File 'lib/musicbeeipc.rb', line 1448

def to_bytes(str)
  str.encode("UTF-16LE").force_encoding("BINARY")
end

#volumeint

Volume - Value between 0 - 100

Returns:

  • (int)


142
143
144
# File 'lib/musicbeeipc.rb', line 142

def volume
  send_message(find_hwnd(), WM_USER, MBC_GetVolume, 0)
end

#volume=(volume) ⇒ Object

Volume - Value between 0 - 100

Parameters:

  • volume (int)


148
149
150
# File 'lib/musicbeeipc.rb', line 148

def volume=(volume)
  send_message(find_hwnd(), WM_USER, MBC_SetVolume, volume)
end

#volumeffloat

Floating point volume - Value between 0.0 - 1.0

Returns:

  • (float)


193
194
195
# File 'lib/musicbeeipc.rb', line 193

def volumef
  FloatInt.new(i:send_message(find_hwnd(), WM_USER, MBC_GetVolumef, 0))[:f]
end

#volumef=(volume) ⇒ Object

Floating point volume - Value between 0.0 - 1.0

Parameters:

  • volume (float)


199
200
201
202
# File 'lib/musicbeeipc.rb', line 199

def volumef=(volume)
  send_message(find_hwnd(), WM_USER, MBC_SetVolumef,
               FloatInt.new(f:volume)[:i])
end

#volumepint

Precise volume - Value between 0 - 10000

Returns:

  • (int)


167
168
169
# File 'lib/musicbeeipc.rb', line 167

def volumep
  send_message(find_hwnd(), WM_USER, MBC_GetVolumep, 0)
end

#volumep=(volume) ⇒ Object

Precise volume - Value between 0 - 10000

Parameters:

  • volume (int)


173
174
175
# File 'lib/musicbeeipc.rb', line 173

def volumep=(volume)
  send_message(find_hwnd(), WM_USER, MBC_SetVolumep, volume)
end

#window_bring_to_frontMBError

Returns:

  • (MBError)


1336
1337
1338
# File 'lib/musicbeeipc.rb', line 1336

def window_bring_to_front()
  send_message(find_hwnd(), WM_USER, MBC_Window_BringToFront, 0)
end

#window_closeMBError

Returns:

  • (MBError)


1302
1303
1304
# File 'lib/musicbeeipc.rb', line 1302

def window_close()
  send_message(find_hwnd(), WM_USER, MBC_Window_Close, 0)
end

#window_get_handleHWND (long)

Returns:

  • (HWND (long))


1292
1293
1294
# File 'lib/musicbeeipc.rb', line 1292

def window_get_handle()
  send_message(find_hwnd(), WM_USER, MBC_Window_GetHandle, 0)
end

#window_get_handle_ptrHWND (pointer)

Returns:

  • (HWND (pointer))


1297
1298
1299
# File 'lib/musicbeeipc.rb', line 1297

def window_get_handle_ptr()
  send_message_ptr(find_hwnd(), WM_USER, MBC_Window_GetHandle, 0)
end

#window_get_positionArray<int>

Returns:

  • (Array<int>)


1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
# File 'lib/musicbeeipc.rb', line 1341

def window_get_position()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_Window_GetPosition, 0)
  
  r = unpack_ii(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#window_get_sizeArray<int>

Returns:

  • (Array<int>)


1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
# File 'lib/musicbeeipc.rb', line 1354

def window_get_size()
  hwnd = find_hwnd()
  
  lr = send_message(hwnd, WM_USER, MBC_Window_GetSize, 0)
  
  r = unpack_ii(lr)
  
  send_message(hwnd, WM_USER, MBC_FreeLRESULT, lr)
  
  r
end

#window_maximizeMBError

Returns:

  • (MBError)


1317
1318
1319
# File 'lib/musicbeeipc.rb', line 1317

def window_maximize()
  send_message(find_hwnd(), WM_USER, MBC_Window_Maximize, 0)
end

#window_minimizeMBError

Returns:

  • (MBError)


1312
1313
1314
# File 'lib/musicbeeipc.rb', line 1312

def window_minimize()
  send_message(find_hwnd(), WM_USER, MBC_Window_Minimize, 0)
end

#window_moveMBError

Parameters:

  • x (int)
  • y (int)

Returns:

  • (MBError)


1324
1325
1326
# File 'lib/musicbeeipc.rb', line 1324

def window_move()
  send_message(find_hwnd(), WM_USER, MBC_Window_Move, pack_i(x, y))
end

#window_resizeMBError

Parameters:

  • w (int)
  • h (int)

Returns:

  • (MBError)


1331
1332
1333
# File 'lib/musicbeeipc.rb', line 1331

def window_resize()
  send_message(find_hwnd(), WM_USER, MBC_Window_Resize, pack_i(w, h))
end

#window_restoreMBError

Returns:

  • (MBError)


1307
1308
1309
# File 'lib/musicbeeipc.rb', line 1307

def window_restore()
  send_message(find_hwnd(), WM_USER, MBC_Window_Restore, 0)
end