BigBoyConst
✅ Editing audio file metadata with TagLib Sharp
Hey there! I'm trying to make a program that streamlines the process of editing file metadata for my music while also giving me a chance to learn something, and I'm running into this problem when I want to set the artist of the track:
The way it's stored in TagLib is using a property
TagLib.File.Tag.Performers
, which is an array of strings. It's initialized to be of length zero, which makes sense, but when I try to set it to a new nonempty array of strings, it just doesn't work, which then leads me to getting an IndexOutOfRangeException
when I inevitably want to set the first value in that array.
I may be making a very very stupid mistake but nonetheless I thought i'd ask.
I don't want to post my code unless someone asks because it's actual programming gore and I know it. Thanks in advance!15 replies
Setting a template project
Hey I have a small question. I have a file which contains a lot of functions that I use often in programming and I wanted to set a sort of "template project" to start from every time I make a new solution. This template would just have nullable disabled, have the reference already added to the aforementioned file and also have set implicit usings for said file. I wasn't able to find anything useful online related to this, but my teacher told me it was possible
14 replies
Graphs OOP app
Hey there, I wanted to ask if the structure for my OOP-based graphs interface made sense or if there are some places I can change things. I want to emphasise beforehand that, althought I know i could simply represent a graph using the adjacency matrix, I want my interface to be more intuitive that hand-typing a random matrix, so I wanted to store it as a List of nodes and edges. (if there's a better way please let me know)
Anyways, the current structure for my program goes a little something like this:
- When it comes to edges, I have an abstract class for an arbitrary edge, from which 2 different classes will inherit: Directed edges (
Arc
) and undirected edges (UEdge
). I'm representing the type of edge using an EdgeType
enum. Also, for the endpoints, I'm simply representing it as a Tuple<Node, Node>
- The Node
class is one that im not sure what to put inside, for the moment all that I have in the node class is an integer for its index in the graph.
- The Graph
class is an abstract class from which 3 classes will inherit: DiGraph
(Directed Graph), UGraph
(Undirected Graph) and PGraph
(Ponderated graph, a graph in which each edge has a value i.e. the use case of Djikstra's algorithm). This class would have a List<Edge>
called Edges
for all the edges in the graph, and a List<Node>
called Nodes
for all the Nodes. Nodes
wouldn't be taken as an argument in the constructor, since I could just extract the nodes from the edges and then set the list equal to those in the constructor.
I don't wanna try and plan out everything beforehand because I feel like i'll get overwhelmed, so I would appreciate if you guys told me if this structure makes sense so far or if there are some things i could fix so they dont bite me in the ass later down the line. Thanks in advance!9 replies