1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2025-07-01 00:37:37 +00:00

Renaming project folders

This commit is contained in:
glucaci
2017-04-12 12:11:27 +02:00
parent 73bc09aa9a
commit 301c5adf59
62 changed files with 125 additions and 120 deletions

View File

@ -0,0 +1,57 @@
using System.IO;
using System.Text;
namespace MpcNET.Test
{
public class MpdConf
{
private const string MPD_CONF_FILE = "mpd.conf";
private const string MPD_LOG_FILE = "mpd_log.txt";
private const string MPD_DB_FILE = "mpd.db";
public static void Create(string rootDirectory)
{
File.Create(Path.Combine(rootDirectory, MPD_LOG_FILE)).Dispose();
CreateConfFile(rootDirectory);
}
private static void CreateConfFile(string rootDirectory)
{
var builder = new StringBuilder();
builder.AppendLine($"log_file \"{Path.Combine(rootDirectory, MPD_LOG_FILE).Replace("\\", "\\\\")}\"");
builder.AppendLine($"db_file \"{Path.Combine(rootDirectory, MPD_DB_FILE).Replace("\\", "\\\\")}\"");
builder.AppendLine("bind_to_address \"any\"");
builder.AppendLine($"music_directory \"{Path.Combine(rootDirectory, "Music").Replace("\\", "\\\\")}\"");
builder.AppendLine($"playlist_directory \"{Path.Combine(rootDirectory, "Playlists").Replace("\\", "\\\\")}\"");
builder.AppendLine("port \"6600\"");
builder.AppendLine("audio_output {");
builder.AppendLine("type \"null\"");
builder.AppendLine("name \"Enabled output to be disabled\"");
builder.AppendLine("enabled \"true\"");
builder.AppendLine("mixer_type \"none\"");
builder.AppendLine("}");
builder.AppendLine("audio_output {");
builder.AppendLine("type \"null\"");
builder.AppendLine("name \"Disabled output to be enabled\"");
builder.AppendLine("enabled \"false\"");
builder.AppendLine("mixer_type \"none\"");
builder.AppendLine("}");
builder.AppendLine("audio_output {");
builder.AppendLine("type \"null\"");
builder.AppendLine("name \"Enabled output to be toggled\"");
builder.AppendLine("enabled \"true\"");
builder.AppendLine("mixer_type \"none\"");
builder.AppendLine("}");
var mpdConfContent = builder.ToString();
using (var file = File.CreateText(Path.Combine(rootDirectory, MPD_CONF_FILE)))
{
file.Write(mpdConfContent);
file.Flush();
}
}
}
}