-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
38 changed files
with
1,537 additions
and
187 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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,27 @@ | ||
{ | ||
"format": "open-board-0.1", | ||
"id": "simple", | ||
"locale": "en", | ||
"name": "Simple Board", | ||
"description_html": "This is a very basic .obf file, it contains no images or sounds, and assumes default styling.", | ||
"grid": { | ||
"rows": 2, | ||
"columns": 2, | ||
"order": [ | ||
[1, 2], | ||
[null, null] | ||
] | ||
}, | ||
"buttons": [ | ||
{ | ||
"id": 1, | ||
"label": "happy" | ||
}, | ||
{ | ||
"id": 2, | ||
"label": "sad" | ||
} | ||
], | ||
"images": [], | ||
"sounds": [] | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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,23 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
// Class for Button | ||
public class Button | ||
{ | ||
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("label")] public string Label { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("image_id")] public string ImageId { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("border_color")] public string BorderColor { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("background_color")] public string BackgroundColor { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("vocalization")] public string Vocalization { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("load_board")] public LoadBoard LoadBoard { get; set; } = new(); | ||
|
||
[JsonPropertyName("action")] public string Action { get; set; } = string.Empty; | ||
} |
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,13 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
// Class for Grid (for button layout) | ||
public class Grid | ||
{ | ||
[JsonPropertyName("rows")] public int Rows { get; set; } | ||
|
||
[JsonPropertyName("columns")] public int Columns { get; set; } | ||
|
||
[JsonPropertyName("order")] public List<List<string>> Order { get; set; } = new(); | ||
} |
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,18 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
// Class for Image | ||
public class Image | ||
{ | ||
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("url")] public string Url { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("data")] public string Data { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("content_type")] public string ContentType { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("width")] public int Width { get; set; } | ||
|
||
[JsonPropertyName("height")] public int Height { get; set; } | ||
} |
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 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
// Class for LoadBoard (button linked to another board) | ||
public class LoadBoard | ||
{ | ||
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("name")] public string Name { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("data_url")] public string DataUrl { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("url")] public string Url { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("path")] public string Path { get; set; } = string.Empty; | ||
} |
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,26 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
// Main OBF File class | ||
public class ObfFile | ||
{ | ||
[JsonPropertyName("format")] public string Format { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("locale")] public string Locale { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("name")] public string Name { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("description_html")] public string DescriptionHtml { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("grid")] public Grid Grid { get; set; } = new(); | ||
|
||
[JsonPropertyName("buttons")] public List<Button> Buttons { get; set; } = new(); | ||
|
||
[JsonPropertyName("images")] public List<Image> Images { get; set; } = new(); | ||
|
||
[JsonPropertyName("sounds")] public List<Sound> Sounds { get; set; } = new(); | ||
} |
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,18 @@ | ||
using System.IO; | ||
using System.Text.Json; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
|
||
// Class for parsing OBF files | ||
public class ObfLoader | ||
{ | ||
public static ObfFile? LoadObf(string filePath) | ||
{ | ||
// Read JSON content from the file | ||
var jsonString = File.ReadAllText(filePath); | ||
// Deserialize the JSON into an ObfFile object | ||
var obfFile = JsonSerializer.Deserialize<ObfFile>(jsonString); | ||
return obfFile; | ||
} | ||
} |
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 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
// Class for Sound | ||
public class Sound | ||
{ | ||
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("url")] public string Url { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("data")] public string Data { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("content_type")] public string ContentType { get; set; } = string.Empty; | ||
} |
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
Oops, something went wrong.