Module: Id3Taginator

Defined in:
lib/id3taginator.rb,
lib/id3taginator/genres.rb,
lib/id3taginator/id3v1_tag.rb,
lib/id3taginator/id3v2_tag.rb,
lib/id3taginator/audio_file.rb,
lib/id3taginator/id3v22_tag.rb,
lib/id3taginator/id3v23_tag.rb,
lib/id3taginator/id3v24_tag.rb,
lib/id3taginator/frames/has_id.rb,
lib/id3taginator/util/math_util.rb,
lib/id3taginator/util/sync_util.rb,
lib/id3taginator/options/options.rb,
lib/id3taginator/frames/frameable.rb,
lib/id3taginator/frames/geo_frames.rb,
lib/id3taginator/frames/ipl_frames.rb,
lib/id3taginator/frames/tos_frames.rb,
lib/id3taginator/frames/url_frames.rb,
lib/id3taginator/frames/id3v2_frame.rb,
lib/id3taginator/frames/mcdi_frames.rb,
lib/id3taginator/frames/text_frames.rb,
lib/id3taginator/frames/ufid_frames.rb,
lib/id3taginator/header/id3v2_flags.rb,
lib/id3taginator/util/compress_util.rb,
lib/id3taginator/frames/count_frames.rb,
lib/id3taginator/frames/custom_frame.rb,
lib/id3taginator/errors/id3_tag_error.rb,
lib/id3taginator/extensions/encodable.rb,
lib/id3taginator/frames/buffer_frames.rb,
lib/id3taginator/frames/custom_frames.rb,
lib/id3taginator/frames/lyrics_frames.rb,
lib/id3taginator/extensions/comparable.rb,
lib/id3taginator/extensions/optionable.rb,
lib/id3taginator/frames/comment_frames.rb,
lib/id3taginator/frames/picture_frames.rb,
lib/id3taginator/frames/private_frames.rb,
lib/id3taginator/frames/grouping_frames.rb,
lib/id3taginator/frames/encryption_frames.rb,
lib/id3taginator/extensions/argument_check.rb,
lib/id3taginator/frames/id3v23_frame_flags.rb,
lib/id3taginator/frames/id3v24_frame_flags.rb,
lib/id3taginator/frames/text/entities/date.rb,
lib/id3taginator/frames/text/entities/time.rb,
lib/id3taginator/frames/id3v2_frame_factory.rb,
lib/id3taginator/frames/text/tbpm_bpm_frame.rb,
lib/id3taginator/frames/text/tdat_date_frame.rb,
lib/id3taginator/frames/text/time_time_frame.rb,
lib/id3taginator/frames/text/tsiz_size_frame.rb,
lib/id3taginator/frames/text/tsrc_isrc_frame.rb,
lib/id3taginator/frames/text/tyer_year_frame.rb,
lib/id3taginator/frames/text/talb_album_frame.rb,
lib/id3taginator/frames/text/tcon_genre_frame.rb,
lib/id3taginator/frames/text/tit2_title_frame.rb,
lib/id3taginator/frames/buffer/entities/buffer.rb,
lib/id3taginator/frames/text/tlen_length_frame.rb,
lib/id3taginator/frames/text/tpe1_artist_frame.rb,
lib/id3taginator/frames/tos/entities/ownership.rb,
lib/id3taginator/frames/url/entities/user_info.rb,
lib/id3taginator/header/id3v23_extended_header.rb,
lib/id3taginator/header/id3v24_extended_header.rb,
lib/id3taginator/frames/text/entities/copyright.rb,
lib/id3taginator/frames/text/entities/user_info.rb,
lib/id3taginator/frames/text/text_writers_frame.rb,
lib/id3taginator/frames/text/tsse_encoder_frame.rb,
lib/id3taginator/frames/ufid/entities/ufid_info.rb,
lib/id3taginator/frames/comment/entities/comment.rb,
lib/id3taginator/frames/picture/entities/picture.rb,
lib/id3taginator/frames/text/tcom_composer_frame.rb,
lib/id3taginator/frames/text/tit3_subtitle_frame.rb,
lib/id3taginator/frames/text/tlan_language_frame.rb,
lib/id3taginator/frames/tos/owne_ownership_frame.rb,
lib/id3taginator/frames/text/entities/part_of_set.rb,
lib/id3taginator/frames/text/tcop_copyright_frame.rb,
lib/id3taginator/frames/text/tflt_file_type_frame.rb,
lib/id3taginator/frames/text/tpe3_conductor_frame.rb,
lib/id3taginator/frames/text/tpub_publisher_frame.rb,
lib/id3taginator/frames/tos/entities/terms_of_use.rb,
lib/id3taginator/frames/comment/comm_comment_frame.rb,
lib/id3taginator/frames/picture/apic_picture_frame.rb,
lib/id3taginator/frames/private/priv_private_frame.rb,
lib/id3taginator/frames/text/entities/track_number.rb,
lib/id3taginator/frames/text/tenc_encoded_by_frame.rb,
lib/id3taginator/frames/text/tmed_media_type_frame.rb,
lib/id3taginator/frames/text/town_file_owner_frame.rb,
lib/id3taginator/frames/url/wpay_payment_url_frame.rb,
lib/id3taginator/frames/text/tkey_initial_key_frame.rb,
lib/id3taginator/frames/text/tpe4_modified_by_frame.rb,
lib/id3taginator/frames/text/tpos_part_of_set_frame.rb,
lib/id3taginator/frames/tos/user_terms_of_use_frame.rb,
lib/id3taginator/frames/count/entities/popularimeter.rb,
lib/id3taginator/frames/grouping/grp1_grouping_frame.rb,
lib/id3taginator/frames/ipl/entities/involved_person.rb,
lib/id3taginator/frames/text/tpe2_album_artist_frame.rb,
lib/id3taginator/frames/text/trck_track_number_frame.rb,
lib/id3taginator/frames/url/wcop_copyright_url_frame.rb,
lib/id3taginator/frames/url/wxxx_user_url_link_frame.rb,
lib/id3taginator/frames/count/pcnt_play_counter_frame.rb,
lib/id3taginator/frames/lyrics/entities/unsync_lyrics.rb,
lib/id3taginator/frames/url/wcom_commercial_url_frame.rb,
lib/id3taginator/frames/count/popm_popularimeter_frame.rb,
lib/id3taginator/frames/ipl/ipls_involved_people_frame.rb,
lib/id3taginator/frames/private/entities/private_frame.rb,
lib/id3taginator/frames/text/tdly_playlist_delay_frame.rb,
lib/id3taginator/frames/text/toal_original_album_frame.rb,
lib/id3taginator/frames/text/txxx_user_text_info_frame.rb,
lib/id3taginator/frames/lyrics/uslt_unsync_lyrics_frame.rb,
lib/id3taginator/frames/text/trda_recording_dates_frame.rb,
lib/id3taginator/frames/encryption/aenc_audio_encryption.rb,
lib/id3taginator/frames/geo/entities/encapsulated_object.rb,
lib/id3taginator/frames/text/toly_original_writers_frame.rb,
lib/id3taginator/frames/text/tope_original_artists_frame.rb,
lib/id3taginator/frames/text/tsoa_album_sort_order_frame.rb,
lib/id3taginator/frames/text/tsot_title_sort_order_frame.rb,
lib/id3taginator/frames/text/tofn_original_filename_frame.rb,
lib/id3taginator/frames/mcdi/mcdi_music_cd_identifier_frame.rb,
lib/id3taginator/frames/encryption/entities/audio_encryption.rb,
lib/id3taginator/frames/text/tsop_performer_sort_order_frame.rb,
lib/id3taginator/frames/url/woaf_official_file_webpage_frame.rb,
lib/id3taginator/frames/encryption/entities/encryption_method.rb,
lib/id3taginator/frames/text/tory_original_release_year_frame.rb,
lib/id3taginator/frames/grouping/entities/group_identification.rb,
lib/id3taginator/frames/text/trsn_internet_radio_station_frame.rb,
lib/id3taginator/frames/ufid/ufid_unique_file_identifier_frame.rb,
lib/id3taginator/frames/url/woar_official_artist_webpage_frame.rb,
lib/id3taginator/frames/url/woas_official_source_webpage_frame.rb,
lib/id3taginator/frames/encryption/encr_encryption_method_frame.rb,
lib/id3taginator/frames/grouping/grid_group_identification_frame.rb,
lib/id3taginator/frames/buffer/rbuf_recommended_buffer_size_frame.rb,
lib/id3taginator/frames/text/tit1_content_group_description_frame.rb,
lib/id3taginator/frames/url/wpub_official_publisher_webpage_frame.rb,
lib/id3taginator/frames/geo/geob_general_encapsulated_object_frame.rb,
lib/id3taginator/frames/url/wors_official_radio_station_homepage_frame.rb

Defined Under Namespace

Modules: Errors, Extensions, Frames, Genres, Header, Options, Util Classes: AudioFile, Id3Taginator, Id3v1Tag, Id3v22Tag, Id3v23Tag, Id3v24Tag, Id3v2Tag

Class Method Summary collapse

Class Method Details

.build_by_bytes(bytes, options = Options::Options.new, no_tag_parsing: false) ⇒ Id3Taginator::AudioFile

builds an audio file



250
251
252
# File 'lib/id3taginator.rb', line 250

def self.build_by_bytes(bytes, options = Options::Options.new, no_tag_parsing: false)
  AudioFile.new(StringIO.new(bytes), options, no_tag_parsing: no_tag_parsing)
end

.build_by_file(file, options = Options::Options.new, no_tag_parsing: false) ⇒ Id3Taginator::AudioFile

builds an audio file



240
241
242
# File 'lib/id3taginator.rb', line 240

def self.build_by_file(file, options = Options::Options.new, no_tag_parsing: false)
  AudioFile.new(file, options, no_tag_parsing: no_tag_parsing)
end

.build_by_path(path, options = Options::Options.new, no_tag_parsing: false) ⇒ Id3Taginator::AudioFile

builds an audio file



230
231
232
# File 'lib/id3taginator.rb', line 230

def self.build_by_path(path, options = Options::Options.new, no_tag_parsing: false)
  AudioFile.new(File.new(path), options, no_tag_parsing: no_tag_parsing)
end

.create_audio_encryption(owner_id, preview_start, preview_length, encryption_info) ⇒ Object

creates Audio Encryption Object



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

def self.create_audio_encryption(owner_id, preview_start, preview_length, encryption_info)
  Frames::Encryption::Entities::AudioEncryption.new(owner_id, preview_start, preview_length, encryption_info)
end

.create_buffer(buffer_size, embedded_info_flag, offset_next_tag) ⇒ Object

creates a Recommended Buffer Object



259
260
261
# File 'lib/id3taginator.rb', line 259

def self.create_buffer(buffer_size, embedded_info_flag, offset_next_tag)
  Frames::Buffer::Entities::Buffer.new(buffer_size, embedded_info_flag, offset_next_tag)
end

.create_comment(language, descriptor, text) ⇒ Object

Creates a Comment Object



268
269
270
# File 'lib/id3taginator.rb', line 268

def self.create_comment(language, descriptor, text)
  Frames::Comment::Entities::Comment.new(language, descriptor, text)
end

creates a Copyright Object



406
407
408
# File 'lib/id3taginator.rb', line 406

def self.create_copyright(year, holder)
  Frames::Text::Entities::Copyright.new(year.to_s, holder)
end

creates a custom url link



398
399
400
# File 'lib/id3taginator.rb', line 398

def self.create_custom_url_link(description, url)
  Frames::Url::Entities::UserInfo.new(description, url)
end

.create_custom_user_text_info(description, content) ⇒ Object

creates a custom user text info



446
447
448
# File 'lib/id3taginator.rb', line 446

def self.create_custom_user_text_info(description, content)
  Frames::Text::Entities::UserInfo.new(description, content)
end

.create_date(month, day) ⇒ Object

creates a date object



414
415
416
# File 'lib/id3taginator.rb', line 414

def self.create_date(month, day)
  Frames::Text::Entities::Date.new(month, day)
end

.create_encapsulated_object(mime_type, filename, descriptor, object_data) ⇒ Object

create encapsulated object



306
307
308
# File 'lib/id3taginator.rb', line 306

def self.create_encapsulated_object(mime_type, filename, descriptor, object_data)
  Frames::Geo::Entities::EncapsulatedObject.new(mime_type, filename, descriptor, object_data)
end

.create_encryption_method(owner_id, method_symbol, encryption_data) ⇒ Object

creates Encryption Method Object



296
297
298
# File 'lib/id3taginator.rb', line 296

def self.create_encryption_method(owner_id, method_symbol, encryption_data)
  Frames::Encryption::Entities::EncryptionMethod.new(owner_id, method_symbol, encryption_data)
end

.create_group_identification(owner_id, group_symbol, group_dependant_data) ⇒ Object

create group identification object



315
316
317
# File 'lib/id3taginator.rb', line 315

def self.create_group_identification(owner_id, group_symbol, group_dependant_data)
  Frames::Grouping::Entities::GroupIdentification.new(owner_id, group_symbol, group_dependant_data)
end

.create_involved_person(involvement, involvee) ⇒ Object

create involved person object



323
324
325
# File 'lib/id3taginator.rb', line 323

def self.create_involved_person(involvement, involvee)
  Frames::Ipl::Entities::InvolvedPerson.new(involvement, involvee)
end

.create_ownership(price_paid, date_of_purchase, seller) ⇒ Object

creates an ownership object



374
375
376
# File 'lib/id3taginator.rb', line 374

def self.create_ownership(price_paid, date_of_purchase, seller)
  Frames::Tos::Entities::Ownership.new(price_paid, date_of_purchase, seller)
end

.create_part_of_set(part, total) ⇒ Object

creates a part of set, e.g. curr CD / max CD



422
423
424
# File 'lib/id3taginator.rb', line 422

def self.create_part_of_set(part, total)
  Frames::Text::Entities::PartOfSet.new(part, total)
end

.create_picture_from_data(mime_type, picture_type, descriptor, picture_data) ⇒ Picture

creates a picture object using data as String



343
344
345
# File 'lib/id3taginator.rb', line 343

def self.create_picture_from_data(mime_type, picture_type, descriptor, picture_data)
  Frames::Picture::Entities::Picture.new(mime_type, picture_type, descriptor, picture_data)
end

.create_picture_from_file(mime_type, picture_type, descriptor, file_path) ⇒ Picture

creates a picture object using data from a provided file path

Raises:

  • (ArgumentError)


354
355
356
357
358
359
# File 'lib/id3taginator.rb', line 354

def self.create_picture_from_file(mime_type, picture_type, descriptor, file_path)
  picture_data = File.new(file_path).read
  raise ArgumentError, "Could not find a picture at #{file_path}" if picture_data.nil?

  create_picture_from_data(mime_type, picture_type, descriptor, picture_data)
end

.create_popularimeter(email, rating, counter) ⇒ Object

creates a Popularimeter Object



277
278
279
# File 'lib/id3taginator.rb', line 277

def self.create_popularimeter(email, rating, counter)
  Frames::Count::Entities::Popularimeter.new(email, rating, counter)
end

.create_private_frame(owner_id, private_data) ⇒ Object

the creates a private frame object



365
366
367
# File 'lib/id3taginator.rb', line 365

def self.create_private_frame(owner_id, private_data)
  Frames::Private::Entities::PrivateFrame.new(owner_id, private_data)
end

.create_terms_of_use(language, text) ⇒ Object

creates a terms of use object



382
383
384
# File 'lib/id3taginator.rb', line 382

def self.create_terms_of_use(language, text)
  Frames::Tos::Entities::TermsOfUse.new(language, text)
end

.create_time(hours, minutes) ⇒ Object

creates a Time Object



430
431
432
# File 'lib/id3taginator.rb', line 430

def self.create_time(hours, minutes)
  Frames::Text::Entities::Time.new(hours, minutes)
end

.create_track_number(track_number, total) ⇒ Object

creates a track number object



438
439
440
# File 'lib/id3taginator.rb', line 438

def self.create_track_number(track_number, total)
  Frames::Text::Entities::TrackNumber.new(track_number, total)
end

.create_unique_file_identifier(owner_id, identifier) ⇒ Object

creates a Unique File Identifier object



390
391
392
# File 'lib/id3taginator.rb', line 390

def self.create_unique_file_identifier(owner_id, identifier)
  Frames::Ufid::Entities::UfidInfo.new(owner_id, identifier)
end

.create_unsync_lyrics(language, descriptor, lyrics) ⇒ Object

create unsync lyrics



332
333
334
# File 'lib/id3taginator.rb', line 332

def self.create_unsync_lyrics(language, descriptor, lyrics)
  Frames::Lyrics::Entities::UnsyncLyrics.new(language, descriptor, lyrics)
end

.global_optionsId3Taginator

creates an Id3Taginator instance and applies the options to all created audio files



220
221
222
# File 'lib/id3taginator.rb', line 220

def self.global_options
  Id3Taginator.new(Options::Options.new)
end