Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/polamjag/traktor-nml
Ruby library to parse NI Traktor's nml playlist file
https://github.com/polamjag/traktor-nml
Last synced: 3 months ago
JSON representation
Ruby library to parse NI Traktor's nml playlist file
- Host: GitHub
- URL: https://github.com/polamjag/traktor-nml
- Owner: polamjag
- License: mit
- Created: 2014-11-11T04:31:36.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-16T07:00:01.000Z (about 9 years ago)
- Last Synced: 2024-09-16T13:18:33.793Z (4 months ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/traktor-nml
- Size: 250 KB
- Stars: 3
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Traktor::NML
[![Gem Version](https://badge.fury.io/rb/traktor-nml.svg)](http://badge.fury.io/rb/traktor-nml)
[![Circle CI](https://circleci.com/gh/polamjag/traktor-nml.svg?style=svg)](https://circleci.com/gh/polamjag/traktor-nml)Ruby library to parse NI Traktor's .nml playlist file
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'traktor-nml'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install traktor-nml
## Usage
```ruby
require 'traktor/nml'Traktor::NML.parse File.open("path/to/playlist.nml")
Traktor::NML.load "path/to/playlist.nml"
# or
Traktor::NML.parse content_of_nml
````Traktor::NML.parse` will return array of hash like this:
```irb
irb(main):001:0> require 'traktor/nml'
=> true
irb(main):002:0> Traktor::NML.parse(File.read(File.expand_path "./spec/traktor/traktor-nml-demo.nml"))
=> #"Green Night Parade EP", :track=>"6"},
@primarykey="G:/:Music/:fu_mou/:Green Night Parade EP/:06 Green Night Parade (PandaBoY Remi.mp3",
@genre="ALTEMA Records",
@label="",
@release_date="2011/1/1",
@playtime=371.0,
@bpm=131.999,
@key="3d",
@musical_key="2",
@cues=[
#,
#,
#,
#,
#,
#,
#,
#
]
>,
#"Sweet Tear EP", :track=>"2"},
@primarykey="G:/:Music/:Calla Soiled/:Sweet Tear EP/:02 Sweet Tear(Y calla K Cut Electro.mp3",
@genre="ALTEMA Records",
@label="",
@release_date="2010/1/1",
@playtime=320.0,
@bpm=132.0,
@key="12d",
@musical_key="5",
@cues=[
#,
#,
#,
#,
#,
#,
#,
#
]
>,
#"Dirty Nucleus", :track=>"7"},
@primarykey="G:/:Music/:Calla Soiled/:Dirty Nucleus/:07 もしも星屑が泣いたとして.mp3",
@genre="",
@label="",
@release_date="2010/1/1",
@playtime=362.0,
@bpm=139.005,
@key="11m",
@musical_key="19",
@cues=[
#,
#,
#,
#,
#,
#,
#,
#,
#
]
>
]>
```## Notice
* Release date may be like `YYYY/1/1` when only YEAR is specified in file
## Contributing
1. Fork it ( https://github.com/polamjag/traktor-nml/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request