-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit eabb38a
Showing
10 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Run Build script", | ||
"program": "${workspaceFolder}\\build.js" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const ini = require('multi-ini'); | ||
const zipdir = require('zip-dir'); | ||
const semver = require('semver'); | ||
const packagejson = require('./package.json'); | ||
|
||
let fullverstring = ''; | ||
const version = packagejson.version; | ||
const file = './source/Install.ini'; | ||
const content = ini.read(file); | ||
|
||
if ( | ||
content && | ||
content.Header && | ||
content.Header.VersionBuild | ||
) { | ||
const head = content.Header; | ||
|
||
head.VersionMajor = `${semver(version).major}`; | ||
head.VersionMinor = `${semver(version).minor}`; | ||
head.VersionRelease = `${semver(version).patch}`; | ||
head.VersionBuild = `${Number(head.VersionBuild) + 1}`; | ||
|
||
fullverstring = [ | ||
head.VersionMajor, | ||
head.VersionMinor, | ||
head.VersionRelease, | ||
head.VersionBuild | ||
].join('.'); | ||
ini.write(file, content); | ||
} | ||
zipdir('./source', { | ||
saveTo: `./dist/Lyrics To Instrumental v${fullverstring}.mmip` | ||
}, () => { | ||
|
||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "lyrics-to-instrumental", | ||
"version": "1.0.0", | ||
"description": "Mediamonkey plugin: Toolbar button to set lyrics to instrumental for the currently selected songs", | ||
"main": "build.js", | ||
"scripts": { | ||
"build": "node build.js" | ||
}, | ||
"author": "Tom A. Vibeto <[email protected]> (https://onlyhuman.dk)", | ||
"license": "ISC", | ||
"dependencies": { | ||
"clean-stacktrace": "^1.1.0", | ||
"multi-ini": "^2.0.0", | ||
"semver": "^5.5.0", | ||
"zip-dir": "^1.0.2" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Header] | ||
ID="LyricsToInstrumental" | ||
Title="Lyrics To Instrumental" | ||
Description="Toolbar button to set lyrics to instrumental for the currently selected songs" | ||
VersionMajor="1" | ||
VersionMinor="0" | ||
VersionRelease="0" | ||
VersionBuild="1" | ||
Type="script" | ||
[Copy] | ||
Src="LyricsToInstrumental.vbs" | ||
Tgt="{app}\Scripts\Auto\LyricsToInstrumental.vbs" | ||
[Execute] | ||
File="{app}\Scripts\Auto\LyricsToInstrumental.vbs" | ||
Function="OnStartup()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
' A script adding a button, that sets lyrics to "Instrumental" | ||
|
||
Sub OnStartup | ||
Dim btn : Set btn = SDB.Objects("LyricsInsrumentalButton") | ||
If btn Is Nothing Then | ||
Set btn = SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard,0,0) | ||
btn.Caption = "Lyrics to Instrumental" | ||
btn.IconIndex = 17 | ||
Set SDB.Objects("LyricsInsrumentalButton") = btn | ||
End If | ||
Call Script.UnRegisterHandler("btnClick") | ||
Call Script.RegisterEvent(btn,"OnClick","btnClick") | ||
End Sub | ||
|
||
Sub btnClick(btn) | ||
Call LyricsToInstrumental() | ||
End Sub | ||
|
||
Sub LyricsToInstrumental | ||
' Define variables | ||
Dim list | ||
Dim itm | ||
Dim i | ||
|
||
' Get list of selected tracks from MediaMonkey | ||
Set list = SDB.SelectedSongList | ||
If list.count>0 Then | ||
' Process all selected tracks | ||
For i=0 To list.count-1 | ||
Set itm = list.Item(i) | ||
itm.Lyrics = "Instrumental" | ||
' Update the changes in DB | ||
itm.UpdateDB | ||
Next | ||
End If | ||
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Delete] | ||
File={app}\Scripts\Auto\LyricsToInstrumental.vbs | ||
|
||
[Execute] | ||
File=Uninstall.vbs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Dim but : Set but = SDB.Objects("LyricsInsrumentalButton") | ||
If Not (but Is Nothing) Then | ||
but.Visible = False | ||
Set SDB.Objects("LyricsInsrumentalButton") = Nothing | ||
End If |